After upgrading Linux Mint (Ubuntu), attachments in KeePass 2 do not open anymore: Access denied

Written by - 0 comments

Published on - Listed in Linux Security


After upgrading Linux Mint from 18.3 to the currently newest release (20.1) for a hardware upgrade with an AMD B550 motherboard, this also upgraded the Ubuntu packages in the background from 16.04 (Xenial) to 20.04 (Focal).

There were only a few gotchas to solve, but all the important stuff worked out of the box. In general the update was smooth. 

Keepass 2 access denied when opening attachment

However when I needed to open a specific attachment in Keepass 2, I only got an "Access denied" error:

Now with the most recent Linux Mint 20.1 and the Ubuntu 20.4 package repositories, the following Keepass 2 package is currently installed:

ck@mint ~ $ dpkg -l|grep keepass2 | awk '{print $1" "$2" "$3}'
ii keepass2 2.44+dfsg-1

But this access denied does not only happen when trying to open an attachment. When clicking on one of the links (for example on the About KeePass window), another error (Cannot find the specified file) shows up:

Keepass 2 cannot find the specified file

So something internally for all kinds of links (file paths and web URLs) seems to be broken since the upgrade.

Mono bug is the reason

It turns out that the source of the problem is a bug in Mono, a cross-platform open source dot net framework on which Keepass 2 is built. Issue 17204 mentions these exact two errors (Access denied and Cannot find the specified file).

This bug was also reported in the Keepass discussion forums and on the Red Hat bugzilla (bugs 1848653 and 1839410).

According to an information in the latter bug description, a workaround was published in KeePass 2.47. And the Mono project also merged a bug fix a month ago (in February 2021). However with the Ubuntu repositories, there is no newer KeePass 2 version available (yet).

Solution 1: Install KeePassXC

There are a lot of forks of the original KeePass project around. KeePassXC is one of these forks. The biggest advantage with KeePassXC however is that this fork does not rely on Mono, instead it's built on Qt. It is fully compatible with the kdbx password database files. And it is part of the official Ubuntu repositories as well. To install it:

ck@mint ~ $ sudo apt install keepassxc

The kdbx files can now be opened with KeePassXC and the attachments can be opened again.

KeePassXC 2.4.3

Solution 2: Update to Keepass 2.47

If you prefer to stay with Keepass2, you are forced to update to 2.47. As long as the Ubuntu repositories don't offer a newer version, you can use a PPA to install a newer version. There's a good step by step guide from Ubuntu Handbook how to install Keepass 2.47 on Ubuntu 20.04 and therefore Linux Mint 20.1.


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder