Skip to content

Don't auto close database unlock if underlying file is unavailable  #9539

@m-rz

Description

@m-rz

Summary

I'd like to address the issue that I'm experiencing on Windows with KeePassXC starting automatically on user login. My DB is synced via Google Drive, which is mounted at a certain path. In addition, I use the feature of automatically selecting the most recently used DB in KeePassXC. Unfortunately, both KeePassXC and Google Drive client are started at the same time and a specific race condition is what I get. As a result, the recently used DB file is not selected despite the proper configuration in KeePassXC. To my understanding, sometimes a following sequence of events occurs:

  1. Windows is started, a user logs in.
  2. KeePassXC and Google Drive are launched based on the registry entries in HKCU.
  3. KeePassXC starts before Google Drive finishes mounting the cloud storage at the target path.
  4. KeePassXC tries to open the DB file remembered from the last run.
  5. The DB file is not yet present at the given path.
  6. An error occurs, the DB is not being selected.
  7. Google Drive client finishes mounting the storage.
  8. There is a need for manually re-selecting the DB to open.

I guess, the issue may be related to all use cases with external file systems (e.g., #1834 seems similar).

Examples

Currently, I'm using a PowerShell script that delays the execution of KeePassXC on startup by 30 seconds. This ensures that, in most cases, at the time KeePassXC tries to read the DB file, it is already available. However, there are probably some better ways to address this. Therefore, I'd suggest some retry and backoff procedure when trying to select the recently used DB file in KeePassXC on its start. Let's say KeePassXC starts and tries to load the last DB file, and in case of an error, waits some time and tries again a few more times.

Metadata

Metadata

Assignees

Projects

Status

In review

Relationships

None yet

Development

No branches or pull requests

Issue actions