Menu

#2429 KeePass startup unlock dialog blocks unattended updates when "Automatically Open Last Used Database on Startup" is enabled

KeePass_2.x
closed
nobody
None
5
2 days ago
3 days ago
Nick
No

(see in English below)

Modaler Datenbank-Entsperrdialog beim KeePass-Start verhindert unbeaufsichtigte Updates

Umgebung:

  • KeePass 2.61.1 x64
  • Plugin: KeePassLibN
  • Windows 11
  • KeePass wird automatisch beim Benutzer-Login/Systemstart gestartet

Betroffene Option:
Extras -> Optionen -> Erweitert ->
„Zuletzt verwendete Datenbank speichern und beim Start automatisch öffnen“

Problem:
Wenn KeePass so konfiguriert ist, dass:

  • KeePass automatisch beim Benutzer-Login/Systemstart gestartet wird
  • und gleichzeitig die Option
    „Zuletzt verwendete Datenbank speichern und beim Start automatisch öffnen“
    aktiviert ist,

öffnet KeePass unmittelbar nach dem Start einen modalen Dialog zum Entsperren der Datenbank.

Dadurch bleibt der Prozess in einem interaktiven Zustand und kann von automatisierten Installations- oder Updateprozessen nicht sauber beendet werden.

In der Praxis führt das dazu, dass automatische Software-Updates KeePass nicht aktualisieren können, weil der Prozess dauerhaft auf Benutzereingabe wartet.

Beobachtetes Verhalten:

  • Windows startet
  • KeePass wird automatisch gestartet
  • KeePass öffnet sofort den Datenbank-Entsperrdialog
  • Der Dialog ist modal/interaktiv
  • Update- oder Installationsprozesse können KeePass nicht sauber schließen
  • KeePass bleibt dauerhaft geöffnet und wartet auf Benutzereingabe

Dadurch werden unbeaufsichtigte Updates praktisch verhindert, wenn KeePass dauerhaft automatisch gestartet wird.

Erwartetes Verhalten:
Wenn die Option
„Zuletzt verwendete Datenbank speichern und beim Start automatisch öffnen“
aktiviert ist, sollte KeePass den Entsperrdialog nicht unmittelbar während der Initialisierung anzeigen.

Stattdessen sollte der Dialog erst angezeigt werden, sobald das Hauptfenster tatsächlich sichtbar bzw. aktiv für den Benutzer ist.

Alternativ könnte KeePass:

  • den Dialog verzögert anzeigen
  • oder vor der ersten Benutzerinteraktion reguläre Shutdown-Anfragen akzeptieren

Wichtig ist vor allem, dass der Hintergrundstart nicht sofort einen blockierenden modalen Zustand erzeugt, der Wartungs- oder Updateprozesse verhindert.

Vorgeschlagene Verbesserung:
Anstatt den Entsperrdialog sofort während des Prozessstarts zu öffnen, könnte KeePass:

  • zunächst die normale Initialisierung abschließen
  • reguläre Shutdown-Anfragen zulassen
  • und den Entsperrdialog erst anzeigen, wenn die Benutzeroberfläche tatsächlich präsentiert wird

Dadurch würde die Kompatibilität verbessert mit:

  • automatischen Software-Updates
  • Paketmanagern
  • Enterprise-Deployment-Tools
  • Wartungs- und Automatisierungsskripten

Aktueller Workaround:
Entweder:

  • den automatischen KeePass-Start deaktivieren
    oder
  • die Option
    „Zuletzt verwendete Datenbank speichern und beim Start automatisch öffnen“
    deaktivieren

Dadurch geht jedoch ein wesentlicher Komfortvorteil der automatischen Datenbanköffnung verloren.

**KeePass startup unlock dialog blocks unattended updates when "Automatically Open Last Used Database on Startup" is enabled
**
Environment:

  • KeePass 2.61.1 x64
  • Plugin: KeePassLibN
  • Windows 11 
  • KeePass configured to start automatically at user logon/startup

Relevant option:
Tools -> Options -> Advanced ->
"Remember and automatically open last used database on startup"

Problem:
When KeePass is configured:

  • to start automatically after user logon/system startup
  • and the option "Remember and automatically open last used database on startup" is enabled

KeePass immediately shows the database unlock dialog as a modal window during startup.

This modal dialog blocks unattended software update workflows because the KeePass process remains interactive and cannot be closed cleanly by an installer or update automation.

As a result, automatic software update systems may fail to replace/update KeePass binaries because KeePass is stuck waiting for user interaction with the unlock dialog.

Observed behavior:

  • Windows starts
  • KeePass auto-starts
  • KeePass immediately opens the database unlock dialog
  • The dialog is modal and interactive
  • Update/install automation cannot cleanly close KeePass
  • KeePass remains running indefinitely waiting for user input

This effectively prevents unattended updates in environments where KeePass is always started automatically.

Expected behavior:
When the option:
"Remember and automatically open last used database on startup"

is enabled, KeePass should defer showing the unlock dialog until the main KeePass window becomes visible/active to the user.

Alternatively:

  • KeePass could delay the modal dialog during startup
  • or allow clean shutdown requests before user interaction occurs

The important part is that background startup should not immediately create a blocking modal state that prevents software maintenance operations.

Suggested improvement:
Instead of showing the unlock dialog immediately during process startup, KeePass could:

  • complete application initialization first
  • allow normal shutdown handling
  • and only trigger the unlock dialog once the main UI is actually presented to the user

This would improve compatibility with:

  • unattended software updates
  • package managers
  • enterprise deployment tools
  • automated maintenance scripts

Current workaround:
Disable either:

  • KeePass auto-start
    or
  • "Remember and automatically open last used database on startup"

However, this reduces usability and defeats the purpose of automatic database reopening.

Discussion

  • Paul

    Paul - 3 days ago

    This is not really something KeePass can manage because it doesn't know the update is occurring.
    It would be better for your update software to check if KeePass is set to run on startup and change it to run after a delay / let the update run KeePass if there is no update.

    cheers, Paul

     
  • Dominik Reichl

    Dominik Reichl - 2 days ago
    • status: open --> closed
     
  • Dominik Reichl

    Dominik Reichl - 2 days ago

    I agree with Paul.

    You propose to show the main window before the master key dialog. However, this wouldn't resolve the problem; the master key dialog would still be modal. Delaying the master key dialog also cannot be realized (the main problem is that KeePass cannot know how long the master key dialog should be delayed, and even if it knew that, that may be too long).

    The master key dialog is a normal dialog (which can be closed by pressing Alt+F4 or Esc, etc.), and it does not seem to block a Windows shutdown (I've just tested it on two up-to-date Windows 11 systems). If your update software has problems with closing KeePass, my suggestion would be to start KeePass manually (e.g. using a shortcut on the desktop) instead of letting it start automatically.

    Best regards,
    Dominik

     

Log in to post a comment.

MongoDB Logo MongoDB