-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-Sync on database save doesn't seem to be working? #49
Comments
Hello, thank you for your report. "Clicking the save button" should always perform a sync because you have enabled Auto-Sync for Save commands. I have not seen other reports of users explicitly running the Save command with this configuration and it failing to engage the plugin's sync (unless you are holding the Shift key! #47). However, implicitly running a Save command via the KP auto lock scenarios is a known issue and only partially supported. Do you use any of the KP auto lock/exit features, or changed the associated configuration recently? The most recent plugin releases have changed how KP auto lock is handled (#36). Have you enabled the "Resume on return from Auto-Lock or Exit" feature to avoid the plugin's warning about the deferred sync that may occur after returning from auto lock/exit? KP auto lock/exit has surely saved a few missed Save commands over the years, which is great. But unfortunately it cannot also be relied upon to immediately engage the plugin's sync. There's more discussion about this in #45. |
So, just to recap, Auto Sync on Save is configured as shown in your screenshot above.
Let me know if I missed anything. Also you witnessed this behavior,
If all of that is correct, then there can only be some unknown mechanism, most likely a plugin, that is interfering with KP Save command events. KeePass must inform interested plugins about Save command processing. It's fairly fundamental stuff that "just works", but if there are multiple interested parties, one of them could be fouling the signals KP is sending. You could try disabling other plugins that work in conjunction with KP Save. If you aren't sure if a plugin uses Save or not, go ahead and disable it anyway. Then try again and see if anything changes. If nothing changes by disabling the plugins and you want to dig in further, you could try out the logging facility. The current release of KPSync features rudimentary, mostly undocumented diagnostic logging. Three paragraphs or so into the Release Notes topic are instructions for configuring the feature to produce KPSync log files on your PC. When you get that working, make note of the time you run the KeePass Save command as outlined above, and correlate with the times shown in log entries, if any. This might (or not) reveal something interesting. |
Good evening Walter, Your recap and witnessed behavior description above is spot on. I removed plugins one by one and observed the same behavior. Next, I enabled debugging as described in your release notes, and left two minutes time between actions to make it very clear what was occurring and when. The below is a synopsis: 1144pm : logged in to keepass. KPSyncforDrive did a sync operation once I was logged in. Did no further action, until: 1146pm: New Test entry created in db and save button clicked. KPSyncforDrive did NOT do a sync operation. Did no further action, until: 1148pm: Manually went into Tools/KPSync For Google Drive/ and clicked Sync With Drive. KPSyncforDrive did a sync operation. Went back and examined the log file: Found this entry, which the timestamp would correlate with when I clicked the Save icon after creating a new DB test entry:
It seems that "deferred Auto Sync (reason 1)" is possibly the cause? Is there some other setting or condition that I need to check, or something to edit/delete from the database to prevent this "deferred Auto Sync (reason 1)" Thanks! Jay |
Nice work. Now, open that database in KP, and look at the plugin data (Tools ⇒ Database Tools ⇒ Database Maintenance..., then click the Plugin Data tab). There should be at least one KeePassSyncForDrive.* entry similar to this: If there are other entries, let us know the name/value of each, then delete all but the one shown above (select the row, click Delete). With extraneous entries deleted, Auto Sync should work again (at least once!). If that works, then for now that is your workaround if you lose Auto Sync this way again. I can replicate the behavior you report this way:
Does this sound like a plausible sequence for your scenario? At any rate, there should be a fix for the removable drive problem in the next release. |
Hello Walter, I do not use keepass databases from a flash drive or removable media, or over a network drive/share. I only open it from on a local hard drive or phone storage on all the devices I use it on. However, I understand there's other conditions that can cause a disk error. The possibility of a disk error is probably safe to assume exponentially INCREASES with the amount of additional computers / mobile devices that are used with the database file on the google drive. The devices that I use for this database are as follows: 3 home computers (2 desktops, 1 laptop) 7 total diverse devices using the keepass database, so still a lot of real estate for something to happen! I checked the entries that were under the Plugin Data tab under Database Maintenance as you instructed. Here are the entries below. I had to type them out, because one of them was so long and the window could not be enlarged to be able to get a screenshot of everything: KeePassOTP.MigrationStatus / Entry2CustomeData, KeepassOTP2OtpAuth, SanitizeSeed, OTPAuthFormatCorrection, CleanOTPDB, ProcessReferences, EntryStrings2CustomData I deleted the extra entries, clicked the close button on Database Maintenance and then clicked the save icon. Sync worked successfully as expected, but just a single time! I checked the Plugin Data tab after that one successful sync, and noticed the entries had returned... So I figured, they were being put back into the database by the sync process, including the "KeePassSyncForDrive.Extensions.DeferredAutoSync / Exiting" entry, and I decided to try something and see if it was possibly a workaround. I went into the KPSync For Google Drive settings, Options and Defaults tab, and un-checked "Sync when Saving a KeePass Database". I then returned to the Plugin Data tab under Database Maintenance, and deleted the following entry: KeePassSyncForDrive.Extensions.DeferredAutoSync / Exiting I then clicked the save icon to save the database locally. I then went to my google drive folder in my browser that has the keepass database file, and then right clicked Manage Versions and then Upload New Version. I then uploaded the locally saved keepass database that I had manually removed the "KeePassSyncForDrive.Extensions.DeferredAutoSync / Exiting" entry from. I then re-opened the keepass database in keepass. The normal "sync before opening a keepass database" operation occurred successfully. I then returned to the Plugin Data tab under Database Maintenance, and noticed that the "KeePassSyncForDrive.Extensions.DeferredAutoSync / Exiting" entry had NOT been put back into the database! I then went back into the KPSync For Google Drive settings, Options and Defaults tab, and checked "Sync when Saving a KeePass Database". I then clicked the save icon, and sync occurs normally, and I can repeatedly click the save icon and sync occurs as it should! To test this further, I remotely put this latest keepass database file onto a computer remotely, and then opened keepass. The sync operations all perform properly and normally as expected, also on this additional computer! It appears that the extra steps I took of manually putting a "current" version of the keepass database without the "KeePassSyncForDrive.Extensions.DeferredAutoSync / Exiting" entry onto the google drive, as well as locally on the computers ensures that entry is NOT put back into the database, and therefore sync operations continue normally when keepass is opened, when the save icon is clicked, etc. and I would recommend this as a temporary work around this issue. Thank you for your help, and I learned something new today thanks to you, Walter! I learned about the "Plugin Data" tab under Database Maintenance" and therefore I now know to include checking that area if I need to help debug plugin problems. Have a good weekend, @walterpg! Jay |
Hey, just want to let you know that i had the same issue. I was able to fix it with SirSilentBobs Workaround. Disabeling Autosync, deleting the "KeePassSyncForDrive.Extensions.DeferredAutoSync / Exiting" entry and uploading this database (with the Plugin) instat of Syncing did solve the problem. |
@lucaislearning , I am glad my info helped assist you as well. Take care. |
SirSilentBobs workaround worked perfectly for me as well. Thanks! I've had this issue for a quite a while now, but now the autosync works just fine. |
Good afternoon,
@walterpg and everyone else who helps, thanks for your great efforts and hard work on this plugin!
I noticed a recent change where the plugin does not auto-sync on database save. If I want the database to sync right then, I have to manually go to Tools/KPSync For Google Drive/ and click Sync With Drive for it to happen. If I make a change and save/close, the file is auto synced when I open keepass again, so the change does eventually make it to the cloud so my other computer and mobile devices will get it, but if I change something and then forget to force sync and then eg. leave for the weekend, I won't be able to get the latest credentials till I go back to that computer and open keepass and the file then gets synced. It used to be I could click the save button, sync would occur from the work computer, and then on the home computer I could just click the save button again if keepass was already open and then the database would sync and all good.
Attached a screenshot of the related config screens, I think it is configured correctly? Using latest 2.48.1 version of keepass.
Also shot of the update page, showing what else I am using for plugins. I haven't changed any of these, so not sure if any of them matter or not.
Thanks you, and appreciate any suggestions, and let me know if you need me to do anything for diagnostic or testing for more info/debug.
Jay
The text was updated successfully, but these errors were encountered: