Menu

Invalid composite key

2016-04-01
2016-04-02
  • Andre Arseneault

    I installed this plugin a couple of months ago on my Win7 laptop. Everything worked fine until a few days ago when I changed the master paswword for KeePass. Since then, whenever I try to sync with Google Drive, either manually or when the database is saved, I get a message that the composite key is invalid. I tried a few things: clear the plugin cache, restart KeePass, delete the kdbx file on Drive, upload then sync... I did not change anything on the Drive side other than deleting the file before uploading it.

    My primary backup/sync is with Dropbox through the DB Backup Plugin. My android tablet and phone sync with the Dropbox file and this continues to work fine after the master password change. I mainly use the Drive copy as a second backup and I would like to fix the issue.

    Any help would be appreciated.

     
  • Uranium235

    Uranium235 - 2016-04-01

    The local and remote database need to have the same password.
    Upload your local database from the Tools Menu once to overwrite the remote database with the local copy so that both have the same password again.

    You should have gotten this error message from the Plugin:

    Synchronization failed.

    If the error was that master keys (passwords) do not match, use Upload / Download commands instead of Sync or change the local master key to match that of the remote database.

     
    • Andre Arseneault

      As mentioned in the original post, I did the upload and then tried a forced sync. It did not work, same as when syncing on save. The message I get is "The composite key is invalid! Make sure that the two databases use the same composite master key. This is required for synchronization."

      I know the upload works because the file time stamp changes on the Drive file.

      Actually, I just figured out that the Drive file is also updated when syncing on save, so it does work. But why is the message displayed then?

       
      • Uranium235

        Uranium235 - 2016-04-01

        It is strange that you seem to just get one error message. The mesage you mentioned is the one KeePass itself issues.
        Right after that you should get another error message from the Plugin with the text I cited above.

        So what seems to happen is, that the actual KeePass Sync (as in merge) is not working but the error is not passed to the plugin which in turn thinks everything is ok and uploads the database to the Drive - hence the new timestamp in Drive.

        If you delete the file in Google Drive and then use Sync (auto or manual) without using upload first, what happens then?
        If it just uploads the file and you get no error message, everything should be fine.

        If you still get an error message about the Key, you must have another database with the same filename in your Drive somewhere. Is that possible at all?

        Try to empty your Drive Trash folder as well and see if that makes any difference.

         
      • Uranium235

        Uranium235 - 2016-04-01

        You may also want to try and download the file from Drive to somewhere local and then do the KeePass Sync manually to see if the Problem is with the Plugin or KeePass itself.

        KeePass - File - Synchronize - Synchronize with File...

        And you may want to temporarily disable any DropBox Syncs / Plugins to see if that makes any difference.

         

        Last edit: Uranium235 2016-04-01
        • Andre Arseneault

          I may actually be getting two messages. The first one is only displayed very briefly then the second one overlays/replaces it, so I can't read what the first one says.

          If I delete the file on Drive and sync manually, I get no error messages and the new file on Drive has the right timestamp. So this works as it should. But if I force a second sync a few seconds later, I get the error message(s).

          I did a search on Drive. It found no other KeePass file, not even in the Trash folder.

          When I sync (and get the error message), this is the message I get at the bottom of the KeePass screen: Google Sync Plugin: Local file synchronized. File on Google Drrive updated. Name: KeePass.kdbx. ID: 0B1M-...

          I don't know if they should match, but the ID in the previous paragraph is not the same as the KeePass UUID in the plugin configuration page.

          Finally, when I download the Drive file to a local folder and try to synchronize KeePass with this file, it fails and I end up with the same error message as originally. It seems to make two attempts which both fail.

           
          • Uranium235

            Uranium235 - 2016-04-01

            The ID you get in the status message is the Google Drive File ID and has nothing to do with KeePass.

            What the Plugin on Sync does is:
            - download the remote file to a temp file locally
            - use the KeePass Sync with File feature to merge the local and temp database
            - upload the new and merged database

            After you successfully uploaded the database with the Plugin Sync command (after first deleting the file in Drive), the local file and the Drive file should be exactly the same. As a 1st indicator you can compare the file size of both (in Bytes).

            Try to download that file and open it directly in KeePass instead of your local copy. Does your password work?

            Try this:
            Make a copy of your local database and try to use the KeePass Sync with File feature with that file. If that is not working either, you have a problem elsewhere but this Plugin.

            I strongly suggest you try to disable Dropbox and see if that makes a difference. Especially if you have the local folder where the database is located auto synced.with the DropBox Windows client or any other Cloud software for that matter.

             

            Last edit: Uranium235 2016-04-01
  • Andre Arseneault

    I'm at work now. I'll make more tests and report back here over the weekend. Thank you for your dedication and your patience.

     
    • Andre Arseneault

      I downloaded the Drive file to a local folder and opened it with KeePass: the password works fine.

      I made a copy of the local file and opened it with KeePass: the password works fine. Syncing with that same file (local copy of the original file) has the same composite key issue. I get the same result when I sync the copy (loaded in KeePass) with the original Drive file.

      I unchecked "automatically backup DB" in the Dropbox plugin menu and synced to Google Drive: I get the same error message.

      So the bottom line is that it works despite the error message. The plugin does update the Drive file as evidenced by the file timestamp. The result is the same whether the Dropbox backup plugin is set to automatic or not. I will just need to ignore the message.

      Any other ideas?

       
  • Andre Arseneault

    OK, I figured it out :-)

    I was using an older DropBox synchronization plugin (DB_Backup) which seems to only be compatible with KeePass 1.x. I never noticed any issues until I modified the KP master password. I then started getting the invalid composite key messages, which I assumed to be related to the Google Drive Sync plugin because it was happening last in the process. All the above tests seemed to confirm that the Google plugin was working fine despite the messages. So I started looking more closely at the DB syncing plugin. I ended up replacing the older plugin with KPDataSave (Dropbox), which is more compatible with KP 2.x. Now, when I save a modified database, both cloud-based backups (Drive and DB) sync right away with no error messages.

    Again, thank you for your assistance.

    Andre

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.