keepass2android icon indicating copy to clipboard operation
keepass2android copied to clipboard

Database changed externally when synchronised using Nexcloud

Open billie80 opened this issue 8 months ago • 3 comments

Currently I am using version 1.12-r5-test2848.

Making changes to the database works for the first time after adding it to Keepass2Android but when opening the database for a second time Keepass2Android always reports that the database has been changed externally although it isn't. Even when removing the database and the local backup from the App and adding it again the behaviour remains the same.

These are the toasts popping up when unlocking the database: Unlock database: Source file and cache are synchronized Quick unlock: Files are in sync

This message appears when trying to save the database:

Merge changes?
The database file was changed externally. Do you want to load and save the changes before merging? Select no if you want to overwrite the external changes.
Cancel
No, overwrite
Yes, merge

If then I choose overwrite or merge I can make changes without problems, even after locking it is still fine but as soon as I close the database and re-open, it happens again.

This is a bit irritating because one can never be sure if there are indeed external changes.

Something I noticed as well but I am not sure if it is related. The toasts with the same messages sometimes have a blue and sometimes a red background.

I will gladly provide additional information if required.

billie80 avatar May 27 '25 06:05 billie80

Currently I am using version 1.12-r5-test2848.

Just to make this clear: I am not expecting this to be related to the "test2848". If you think it is (and the issue is different in 1.12-r5), please let me know.

I will gladly provide additional information if required.

Please enable debug logging in the app settings and then see if it tells more details.

PhilippC avatar May 27 '25 06:05 PhilippC

Just to make this clear: I am not expecting this to be related to the "test2848". If you think it is (and the issue is different in 1.12-r5), please let me know.

I am pretty sure it also happened with older versions, I just can not tell when it started.

Please enable debug logging in the app settings and then see if it tells more details.

I have attached the log. The cloud location of the database is redacted. Before logging I merged or overwrote some changes to make it working.

27.05.2025 11:01:53:714	Save the database without problems
27.05.2025 11:02:08:816	Close the database
27.05.2025 11:02:35:349 Open it again
27.05.2025 11:03:02:400	Save the database
27.05.2025 11:03:03:793	Conflict is logged then cancel is selected in the dialogue 
27.05.2025 11:03:12:699	Save the database again
27.05.2025 11:03:13:945 Conflict is logged
27.05.2025 11:03:15:492	Merge the changes is selected in the dialogue
27.05.2025 11:03:25:589	Can save again
27.05.2025 11:03:35:132	And again
27.05.2025 11:03:41:602	Lock the database
27.05.2025 11:03:47:934	Unlock it again
27.05.2025 11:04:06:959	Can save again
27.05.2025 11:04:15:673	And again

keepass2android.log

According to the code in src/Kp2aBusinessLogic/database/edit/SaveDB.cs

Kp2aLog.Log("Conflict. " + hasStreamForOrigFile + " " + hasChangeFast + " " + hasHashChanged);

hasStreamForOrigFile = False hasChangeFast = False hasHashChanged = True

billie80 avatar May 27 '25 09:05 billie80

This issue still exists with version 1.14-r0. I an not sure if this was the case before but now it also happens when opening the file locally from the Android File Browser.

billie80 avatar Sep 20 '25 22:09 billie80