Current mono package breaks ability to sync db from trigger
A lightweight and easy-to-use password manager
Brought to you by:
dreichl
Just to let you know the current mono package on linux arch (and probably other variants) is not able to successgully perform the action "Syncronize active database with file/URL" anymore due to unability to save DB. The plain FTP url is used. Tmp file seems to appear indefinitely, the saving status window doesn't close until cancelled. The last mono version that still works is 5.10.1.47-1 (already few months old, sorry for the late report!), the current one is 5.12.0.260-1. Please provide a fix or workaround, thanks!
Not sure how KeePass can fix a bug introduced by mono.
Does a straight save to FTP work?
Manual sync?
Sync to local via trigger?
What version of KeePass? Have you updated this recently?
cheers, Paul
Well, there has to be workaround at least. There were several mono versions already after sync stopped.
Last edit: Anonymous 2018-07-05
To test where the problem is you need to try to sync manually and locally. Without this we can only guess where the issue might be.
cheers, Paul
Last edit: Anonymous 2018-07-04
This implies a problem with saving to the FTP server. Can you do a manual save?
Does your FTP server allow multiple connections from a single client?
Try turning off "File Transactions". Tools > Options > Advanced > File input /output connections.
cheers, Paul
Last edit: Paul 2018-07-05
No, SaveAs to URL... via the same FTP has the same failure: it creates .tmp file of similar size, then showing the status in the pic below, then app crashes/disappears after timeout.
Never had problems with file managers on diff OSes with that FTP, I think it supports multiple connects from the same app, but can't say 100% sure. But it works as expected with older mono packages, so I don't see the relation.
Turning File Transactions OFF makes a remote file without .tmp extension, otherwise the status is the same and timeout + crash happens the same way.
Last edit: Anonymous 2018-07-05
As the FTP server works with a client it would appear to be a problem with either mono or KeePass 2.39.1. Can you try a manual save with an older version of KeePass? (Use a portable version to save installing.)
If it is mono you may have to resort to using a script to download the remote version, sync locally, then upload. :(
cheers, Paul
@Dominik Reichl
I don't think the Paul's suggestion is the adequate answer to the issue. Basically, it is your responsibility to check what causes the KeePass crash. I provided you even FTP server logs, and also version numbers of mono. Obviously, the app can't handle some new changes introduced by updated mono and crashes. I have no idea how to fix your app while you guys even don't want to test it at your site and either locate and fix the issue or prove it's working alright!
Last edit: Anonymous 2018-07-05
KeePass is written for Windows. Dominik does his best to work around mono issues, but he can't fix them all. (Very good service from a free app IMO.)
cheers, Paul
Mono apparently changed something in its FTP implementation and now it's incompatible with your server. The FTP implementation is basically a black box for KeePass: KeePass simply requests to download/upload a file and all the details (connecting to the server, issuing FTP commands, transferring the data, etc.) are handled by Mono. Thus, I don't see how a workaround could look like (except including a different FTP implementation, but that isn't really reasonable); the issue should be fixed in Mono.
Until the Mono developers fix it, my suggestion would be to use a different protocol. For example, the SftpSync plugin adds support for SFTP and SCP (and should also work on Linux).
https://keepass.info/plugins.html#sftpsync
Best regards,
Dominik
Same exact issue here on a freshly installed Xubuntu 19.10 and KeePass 2.43.
While syncing, the tmp file is created on the FTP server, but the the interface hangs and the sync is not completed by replacing the tmp file with the real one. If there's something I can do to provide more info for fixes / workaround, I'd be happy to help. In the meantime I'll try disabling File Transactions, using Wine instead of Mono, or rewriting the trigger to download, sync locally and re-upload with an external command.
Also, strangely, while KeePass is "locked" during syncronization, my entire system UI (XFCE) is unresponsive, I have to force kill KeePass with a terminal session to be able my desktop environment again. This happened also before updating to 19.10, but when KeePass finished syncing successfully, system got "unlocked" again.
Last edit: Lorenzo Stanco 2019-10-21
Let us know how you go with a copy/sync/copy script. It might be useful for others here.
cheers, Paul
Sure, I think I did it with a 3-actions trigger using only "curl" as an external command (which is well-known and available everywhere):
curlas File/URL,"ftp://HOST/PATH/{DB_NAME}" -o "/tmp/{DB_NAME}" --user USER:PWDas Arguments, and Wait for exit enabled./tmp/{DB_NAME}as File/URL.curlas File/URL,-T "/tmp/{DB_NAME}" "ftp://HOST/PATH/{DB_NAME}" --user USER:PWDas Arguments, and Wait for exit enabled.rmand"/tmp/{DB_NAME}".Hope this helps!
PS: Here's the XML for quick pasting from clipboard. The trigger Event must be changed according to preferences, since I used a test toolbar button.
Last edit: Lorenzo Stanco 2019-10-21
Great workaround, Lorenzo! I wonder would this fix help to resolve FTP sync?
I think it isn't related, but don't take my words for granted, since I don't know anything about the FTP client implementation in Mono.
Hi Lorenzo, where and how do you apply the "3-actions trigger"? Where do you paste the XML?
Thanks
Triggers system is accessibile from Tools menu, then Triggers...
There you can click "Add..." for manually entering events and actions, or you can use the "Tools" button to paste the XML that you previously copied in the clipboard (CTRL+C):
Great, thanks for the quick reply, I ignored their existence.
Hi, why has this issue been closed? The problem still exists on my Gentoo (~amd64) install. Do we know if there is a bug in Mono regarding this? Maybe we can get to the base of the problem and report it upstream? I wonder if the FTP rename operation is simply broken in the mono FTP client library? Or maybe it does not allow a rename "onto" an existing file? I. e. from the kdbx.tmp file to the kdbx file. It almost looks like we're waiting for the file rename to unblock, doesn't it?
This is closed because it can't be fixed in KeePass.
As far as we can tell mono is the problem. If you can show exactly how it fails in mono you could report the issue to the mono developers.
Have you tried the SftpSync plug-in?
Do the triggers work for you?
cheers, Paul
Hello Paul
I tried both: the triggers trick synchronises, but ends with KeePass and all programs with GUI freezing. I have to kill the process in a terminal to free all.
Regarding the SftpSync, I can't say: the sftp://host/path ends with an error "An exception occurred during a WebClient request. No such file". It is the same URL as the FTP one, but just with 's' in front.
Regards
I just add that the mere 'save' freezes all programs the same way.
Regarding the SftpSync plugin, may be I don't know how to use it? I haven't seen any settings for it.
(System: LUbuntu on x86_64)
Maybe the trigger is not correct on your system.
Are you able to see the triggers in the trigger system after you paste the trigger data?
Editing triggers in the GUI may not work in mono - we have had that problem reported before. How did you change the trigger to work for your system?
Can you post the trigger you used so we can test it?
cheers, Paul
The trigger does work, since the files are well synchronised by the trigger. The only issue is the freezing at the end.
I suppose that it is more related to the mono FTP issue whilst the program saves the modifications and synchronises itself. But it occurs after each tie I use the trigger.