Keeweb App Mime Detection Breaks After Editing Database File in KeePass

Hello folks,

I believe I may have found a potential bug with the Keeweb App for NextCloud, and I’m wondering if someone here would be willing to test and confirm this for me so I can decide whether to file a bug report on Github or simply abandon using the app altogether and look for alternatives.

I appears that whenever the KeePass database file (.kdbx) is written to from an external source (such as the KeePass desktop application or even a mobile phone app such as Keepass2Android), the database file that is stored on my NextCloud server looses its custom mime detection settings (as defined in …/config/mimetypealiases.json). This causes the icon to change from a gear to a blank one and then clicking on the file no longer opens the database within the Keeweb app but rather downloads it to the local computer. However, this problem doesn’t present itself if I make changes from within the Keeweb app.

I’ve posted some images below to show what the icons look like when the problem appears vs. not.

Currently, the only way to get around the above problem is to manually run “sudo -u www-data /php path/to/occ files:scan --all” after making a change to the database file.

This is what the file icon looks like after it’s been written to from an external source.

This is what it should look like (i.e., after running sudo -u www-data /path/to/php occ files:scan --all)


  1. Nextcloud v16.0.5 / Update Chanel: Stable

  2. Keeweb App v0.5.1

  3. Server: Debian GNU/Linux 10 (buster)

  4. Web Server: Nginx v1.17.4

  5. PHP Version: 7.3.9-1+0~20190902.44+debian10~1.gbpf8534c

I would appreciate it very much if someone here could test on their system and let me know if they see the same behavior, thanks.

Hi! I experience exactly the same problem. I can’t give you exact information about the server now, it is Univention, Debian 9, Nextcloud 16 as docker app, apache. It would be nice to find a solution

Thanks for the confirmation Katerina. I will see if I can file a bug report on the NextCloud github issues page.

anything new on the topic?

Yep. The keeweb app is not loaded for dav requests (upload via desktop or mobile client is via dav) hence the mapping (kdbx => application/x-kdbx) is not defined. Nextcloud 18 will ship these mapping by default.

It’s possible to workaround this by adding a custom definition. The right file is /config/mimetypemapping.json and not /config/mimetypealiases.json.

Some more information about the mimetype detection and keeweb.

Thanks for the reply and confirmation of the problem. It’s nice to know that a permanent solution is forthcoming, even if one must wait for the next full release. A small price to pay, really, for such great software for FREE.

Thanks again.

By adding the mapping to /config/mimetypemapping.json it will work. You’ll find all information at the link from my previous post.

Yes, it worked. Looks like the custom file name was wrong, as you correctly pointed out. Hmm, not sure where I got the other name from then. Anyway, it’s working now so I’ve re-enabled the app so I can use it again.