Menu

KeeAutoExec and trigger synchronization at load creates error

2021-11-21
2021-11-21
  • Adrian Nagle

    Adrian Nagle - 2021-11-21

    I use the plugins KeeAutoExec and KeePassSync and triggers to synchronization KeePass databases at load and save.

    When I open my main KeePass database and KeeAutoExec loads additional databases, end each database is sync'd with the trigger, I get an error:
    "Failed to import the specified file!

    The mast key is invalid!

    Make sure that the two databases use the same master key. The is required for a synchronization."

    If I remove the trigger "Opened data file" trigger that synchronizes the main database, everything appears to load and is synchronized. When I re-add the "Opened database file" trigger the error above returns.

    The main database synchronizes fine when I manually synchronize both files. And saving synchronizes correctly with the "Save database file". The trigger actions include 1) change trigger on/off state to "Off", 2) synchronize database, 3) change trigger on/off state to "On"

    Unrelated question, is there a way to ignore the file open history for KeeAutoExec in the file history so that my main database is the "last opened file". Now I must always manually load my main database.

     
  • Adrian Nagle

    Adrian Nagle - 2021-11-21

    In fairness, I've ignored this issue for many years. I did finally find my original question in the group discussions: https://sourceforge.net/p/keepass/discussion/329221/thread/c01eec96/?limit=25#0765

    The answers didn't quite help me, but I'll review more carefully.

     
  • wellread1

    wellread1 - 2021-11-21

    The master key is wrong because a trigger tries to synchronize the current/active database with the wrong target database. To help diagnose the problem, add a Show message box action immediately preceding the Synchronize active database with a file/URL in every trigger that uses this action. Add the {DB_PATH} placeholder to the Text field and some descriptive text such as 'Current database path' to the Main Instruction field of the Show message box action. This message box will display the current/active database path whenever it runs. Run the trigger set. Compare the Current database path to the database path shown on the failed to import error that follows.

    I suspect you will find an Opened database file event is causing every opened database to try to synchronize with the target database of the Main database. Update the filter conditions of this event to prevent this.

     

    Last edit: wellread1 2021-11-21
  • Adrian Nagle

    Adrian Nagle - 2021-11-21

    wellread1, thanks. I'll try your suggestion to help debug.

    I've implemented a suggestion you gave me years ago regarding opening last used database. This appears to be working for my last issue.

     
  • wellread1

    wellread1 - 2021-11-21

    The name of the trigger is shown on the bottom of the Show Message Box. This will help you identify which trigger is causing the problem.

     

Log in to post a comment.

MongoDB Logo MongoDB