Skip to content

How to sync using Synology NAS

This guide explains how to sync KeePassium database with other devices using Synology network attached storage (NAS).

KeePassium supports two synchronization methods for Synology NAS:

Method 1: Direct connection via WebDAV

With this approach, KeePassium would communicate directly with your Synology server, using WebDAV protocol.

For more info, refer to Synology documentation: (Accessing Synology files using WebDAV](https://docs.Synology.com/server/latest/user_manual/en/files/access_webdav.html)

Method 2: Integration with iOS Files app

  • Install Synology DS File app and enter your credentials
  • Open KeePassium, go to Databases screen (tap < Back if necessary)
  • Tap MoreOpen Database
  • If DS File is not visible in the list, make it visible
  • Select your database file

Troubleshooting

Sticky caching in Synology Drive

Databases added via the Synology Drive app (not DS File) are not always automatically downloaded/uploaded. Therefore, if the database was changed on the server, these changes might not become visible to KeePassium. If the database was changed in KeePassium, Synology Drive might not detect the changes and will not upload the file. This is an issue in Synology Drive app.

We have reported the bug to Synology in August 2020 (ticket #2604475). The company acknowledged the problem:

Upon further inspection, our developer confirmed that on some occasions, when using the iOS Files app to browse files on Drive, it does not show the latest version of the files.

They are currently working on a fix that will be released on a later date.

As a solution, use DS File app or direct WebDAV connection instead.

DS File does not work offline

DS File app requires a working network connection to the server. If the NAS is not available, KeePassium will cancel the connection attempt after several seconds.

If you need access to your database even when the NAS is not available, the best solution is to avoid DS File altogether and use the direct WebDAV connection instead.

Unrecognized database format

Sometimes KeePassium fails to load a database from Synology NAS, with the following error in the log:

Unrecognized database format [firstBytes: 7b226572726f7222]

This error is caused by two Synology bugs (reported under ticket #2591926):

  • When DS File connects to the NAS, the mobile app is given a random session_id value. With about 1% probability, this parameter starts with a digit. Since the app does not properly escape the value in further requests, the server is unable to parse the session_id and responds with error code 119.
  • Error code 119 is not documented in Synology API documentation. Apparently, DS File app fails to handle it properly — and considers the error message to be the actual file contents. In other words, KeePassium receives the database as {"error":{"code":119},"success":false} — which is obviously not a valid database.

There are three possible workarounds for this error:

  • Re-add your database to KeePassium. The idea is to force DS File to re-login to the server (thus generating a new, likely valid, session_id value).
  • Turn off the Wi-Fi connection on your device, wait for a minute, then turn it on back again. The NAS should become available again. (The rationale is the same as above.)
  • As a long-term solution, use a direct WebDAV connection to your NAS.

See also