FS#58634 - [keepass] Crash when saving database to FTP with latest mono

Attached to Project: Community Packages
Opened by ashka (ashka) - Thursday, 17 May 2018, 10:55 GMT
Last edited by Toolybird (Toolybird) - Sunday, 16 April 2023, 00:44 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Giancarlo Razzolini (grazzolini)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
KeePass hangs then crashes when a database is saved to a FTP server using mono 5.12.0.226-1. The following stack trace appears:
Unhandled Exception:
System.Net.WebException: Request aborted
at System.Net.FtpWebRequest.CheckIfAborted () [0x00014] in <45c8befefe304a1a9b9d862c538c5b1f>:0
at System.Net.FtpWebRequest.set_State (System.Net.FtpWebRequest+RequestState value) [0x00011] in <45c8befefe304a1a9b9d862c538c5b1f>:0
at System.Net.FtpWebRequest.ProcessRequest () [0x00087] in <45c8befefe304a1a9b9d862c538c5b1f>:0
at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in <cae080c8689e4af39d0ab2b313d012f5>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <cae080c8689e4af39d0ab2b313d012f5>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <cae080c8689e4af39d0ab2b313d012f5>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in <cae080c8689e4af39d0ab2b313d012f5>:0
at System.Threading.ThreadHelper.ThreadStart () [0x00008] in <cae080c8689e4af39d0ab2b313d012f5>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.Net.WebException: Request aborted
at System.Net.FtpWebRequest.CheckIfAborted () [0x00014] in <45c8befefe304a1a9b9d862c538c5b1f>:0
at System.Net.FtpWebRequest.set_State (System.Net.FtpWebRequest+RequestState value) [0x00011] in <45c8befefe304a1a9b9d862c538c5b1f>:0
at System.Net.FtpWebRequest.ProcessRequest () [0x00087] in <45c8befefe304a1a9b9d862c538c5b1f>:0
at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in <cae080c8689e4af39d0ab2b313d012f5>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <cae080c8689e4af39d0ab2b313d012f5>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <cae080c8689e4af39d0ab2b313d012f5>:0
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in <cae080c8689e4af39d0ab2b313d012f5>:0
at System.Threading.ThreadHelper.ThreadStart () [0x00008] in <cae080c8689e4af39d0ab2b313d012f5>:0

Downgrading to mono 5.10.1.47-1 fixes the issue.

Additional info:
keepass 2.39.1-1
mono 5.12.0.226-1


Steps to reproduce:
- Open a KeePass database through FTP (File > Open > Open URL...)
- Save the database
This task depends upon

Closed by  Toolybird (Toolybird)
Sunday, 16 April 2023, 00:44 GMT
Reason for closing:  Upstream
Additional comments about closing:  See comments
Comment by Doug Newgard (Scimmia) - Thursday, 17 May 2018, 14:12 GMT
Still an issue with keepass 2.39.1-2?
Comment by ashka (ashka) - Thursday, 17 May 2018, 14:32 GMT
Yes, the issue persists with 2.39.1-2.
Comment by Giancarlo Razzolini (grazzolini) - Thursday, 17 May 2018, 15:14 GMT
Looks like a regression with mono, not keepass. Can you try a couple of things?
1) Open the DB locally and try to sync to the ftp
2) Disable SSL on FTP (if any)

I've never synced using FTP, only webdav, which is working.
Comment by ashka (ashka) - Thursday, 17 May 2018, 15:43 GMT
1) Opening the DB locally and syncing has the same issue.
2) Disabling FTPS on the server makes no change. Inspecting traffic with Wireshark, it does not look like KeePass tries to negociate a connection in FTPS.
Comment by Giancarlo Razzolini (grazzolini) - Thursday, 17 May 2018, 16:17 GMT
More and more sounding like a mono, not keepass issue. I'm going to try to reproduce it here, and report upstream.
Comment by Jérôme De Greef (jdegreef) - Wednesday, 30 May 2018, 14:23 GMT
Definitely a Mono problem.
I downgraded Mono from 5.12 to 5.10 and the problem disappears.
Let me know if I can be of any help.
Comment by Giancarlo Razzolini (grazzolini) - Thursday, 20 September 2018, 23:25 GMT
Hi Jerome, is this still happening with latest mono and keepass?
Comment by Jérôme De Greef (jdegreef) - Friday, 21 September 2018, 15:19 GMT
Hi Giancarlo,
Well, at that time I was using the compiled binary from keepass.org.
Since I switched to the arch package (keepass 2.40-1) and everything is ok with the latest mono from arch repository (mono 5.14.0.177-1).
Sorry for forgetting to update my comment here.
Comment by ashka (ashka) - Tuesday, 25 September 2018, 11:20 GMT
Hi,

This still happens for me with keepass 2.40-1 and mono 5.14.0.177-1.
Comment by Giancarlo Razzolini (grazzolini) - Tuesday, 25 September 2018, 12:05 GMT
Hi ashka, can you elaborate a bit? Jerome mentioned it is working for him using the same versions as you are.
Comment by ashka (ashka) - Tuesday, 25 September 2018, 12:09 GMT
Yes Giancarlo, I see no change from mono 5.12 to 5.14 using a ftp:// url, keepass hangs indefinitely while saving. The software isn't crashed, but its UI is disabled while it saves. I tried reinstalling keepass along with mono and nothing changed.
Comment by Levente Polyak (anthraxx) - Tuesday, 25 September 2018, 14:15 GMT
the right place would be to report this upstream as i don't believe this is a packaging issue
Comment by Jérôme De Greef (jdegreef) - Tuesday, 25 September 2018, 16:42 GMT
Hi ashka are you sure you are using the packaged version (keepass 2.40-1) and not another version hanging somewhere in your system ? I had this problem :(
Version from keepass.org (keepass2.exe 2.40) is not working on Arch.
Comment by Giancarlo Razzolini (grazzolini) - Wednesday, 26 September 2018, 00:40 GMT
Yes, it is looking like an upstream issue, and with mono even, not even with keepass. But, before I close this, I want to hear back from ashka. It's weird that two people using the same versions are having different results.
Comment by ashka (ashka) - Wednesday, 26 September 2018, 12:03 GMT
I have checked and I am using the packaged version. paccheck --md5sum keepass returns that all files match the database. If I'm the only one affected, I'd be glad to report upstream to work it out; however my colleague has the same issue using FTP with the same package versions on a more recent arch install.
Comment by Giancarlo Razzolini (grazzolini) - Wednesday, 26 September 2018, 13:46 GMT
Hi Ashka,

What do you mean by more recent? If arch is updated, all the installations should be the same, with the exception of different packages installed. Please, send the output of pacman -Qi keepass and pacman -Qi mono.
Comment by ashka (ashka) - Wednesday, 26 September 2018, 14:01 GMT
Hi Giancarlo, I meant in a "less user-installed packages" way. Here are the pacman -Qi outputs:

Name : keepass
Version : 2.40-1
Description : A easy-to-use password manager for Windows, Linux, Mac OS X and mobile devices.
Architecture : any
URL : http://keepass.info/
Licenses : GPL
Groups : None
Provides : None
Depends On : mono desktop-file-utils xdg-utils shared-mime-info gtk-update-icon-cache
Optional Deps : xdotool: if you want to use auto-type [installed]
xsel: clipboard operations in order to work around Mono clipboard bugs [installed]
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 3.08 MiB
Packager : Giancarlo Razzolini <grazzolini@archlinux.org>
Build Date : Wed Sep 12 00:42:02 2018
Install Date : Wed Sep 26 15:52:57 2018
Install Reason : Explicitly installed
Install Script : Yes
Validated By : Signature

Name : mono
Version : 5.14.0.177-1
Description : Free implementation of the .NET platform including runtime and compiler
Architecture : x86_64
URL : http://www.mono-project.com/
Licenses : GPL LGPL2.1 MPL
Groups : None
Provides : monodoc
Depends On : zlib libgdiplus>=4.2 sh python ca-certificates
Optional Deps : None
Required By : gtk-sharp-2 keepass nuget
Optional For : avahi graphviz
Conflicts With : monodoc
Replaces : None
Installed Size : 236.43 MiB
Packager : Levente Polyak <anthraxx@archlinux.org>
Build Date : Fri Aug 17 18:46:23 2018
Install Date : Wed Sep 26 15:52:54 2018
Install Reason : Installed as a dependency for another package
Install Script : Yes
Validated By : Signature
Comment by Giancarlo Razzolini (grazzolini) - Wednesday, 26 September 2018, 17:13 GMT
Are you using any plugins? If so, please disable all of them and test with a clean keepass, just to sure no plugin is interfering with this. I currently have no way to test this, because I don't have a ftp server. Also, and this is a personal note here, I don't know if you know this, but everytime an admin spawn a new ftp server, 10 kittens die somewhere. This is a known scientific fact. But, jokes aside, I don't see reasons for using ftp nowadays.
Comment by Jérôme De Greef (jdegreef) - Wednesday, 26 September 2018, 23:08 GMT
Hi,
grazzolini, you're right but sometime we don't have alternative...

The difference I have running pacman -Qi is that mono reports "Install Reason : Explicitly installed". That's because after holding the old version I update mono manually.
My only plugin is KeePassNatMsg.

By the way, Asaka, what is "paccheck" ? I don't find it in the repositories or in aur.
Comment by ashka (ashka) - Thursday, 27 September 2018, 17:32 GMT
Hi,
Giancarlo, I'm usually using plugins, I tried both with them installed and removed and the behavior was the same. I'll migrate away from ftp at some point, for now it's more convenient for me.
Jérôme, paccheck is from pacutils, and allows to check file consistency between your filesystem and packages, including file hashes.
Comment by Jérôme De Greef (jdegreef) - Friday, 28 September 2018, 18:16 GMT
Asaka Very useful. ;) Thanks
Comment by Toolybird (Toolybird) - Sunday, 16 April 2023, 00:44 GMT
FTP is dead as a doornail. It's a mono limitation and therefore an upstream issue and not an Arch packaging bug.

Loading...