Hi,
I use the latest version of both Keepass and KeepassGoogleSync from a usb key.
Everything's ok on windows but when I try to sync on linux (ubuntu 14.04) I get a "An exception was thrown by the type initializer for DotNetOpenAuth.Logger"
I have latest version of mono fully installed as well as mono-dmcs.
Any idea ?
Thanks in advance,
Jérôme
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi,
Can you explain me a little bit how can i get installed log4net in linux mint?
I'm not a programmer and i'm stucked.
I could install Nuget, but i can't make it install log4net. Also no tutorials online because if you use nuget it's supposed you're kind of an expert...well i'm not.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
--I am on Fedora20x64.
--KeePass works ok.
--Gsynch gets the same dot net auth logger error
--log4net seems to be used somewhere and that wasn't installed for me
--I put the log4net dll in my dir where keepass was installed...
that error is gone....
--but...libgluezilla seems to be used for open browser and maybe get the 'ok to access google from this app' form.
--libgluezilla seems like dead wood, but still laying around if you search hard enough.
--I found a 64bit rpm for OpenSuse --- seemed to install
--but KP doing a google sync operation crashes hard...
--this crash isn't because something missing...
So the libgluezilla really isn't meant for my rig -- so that could be it....only way I'd really know is by building from sources to make a libglue that at least is 'matching' my OS....if still crashy..maybe end of line...not sure I will take time to build from sources.....
shoveled enough time on this....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tried with Plugin v2.0 and a working configuration. Unfortunately I only get: "Web request to 'https://accounts.google.com/o/oauth/token' failed."
I am not sure why. It could be that the http client used by google is not working at all or that it is a certificate (https) problem.
I will try and extract some more debug information when I have some more time...
But hey, at least it didn't crash ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is that with the new Plugin Version 2.0?
Yes, some google dlls net log4net. That dll is not included because it works fine on windows without that library. The version that comes with the included Google dlls is here
Try configuring and initially syncing the database with a windows machine then copy the database (and KeePass config) to Linux. Once initial setup is done, the Plugin does not open the internal Browser anymore. That is only needed once to get authorization. Maybe that helps.
Last edit: Uranium235 2014-11-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried using the most up to date Google API DLLs that use different http clients. Unfortunately that only makes things worse, as mono does not support async programming required by the non-beta Google SDK yet.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm attempting to use the Google Drive Sync on Linux and I feel like i'm getting somewhere, but I've hit a roadblock. I have an Archlinux installation with mono 3.10. I installed mono-tools and log4net. I then sym-linked the log4net.dll file to the root of Keepass (/usr/share/keepass/). This fixed the logger error. However, I'm now getting this error "Could not load type 'System.Runtime.Serialization.Json.JsonReaderWriterFactory' from assembly 'DotNetOpenAuth'". Anyone have ideas of where to look to fix this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
At what stage do you get that error?
When loading the Plugin at KeePass statup or when trying to sync?
Do you use the compiled plugin or the plgx format?
Did you use the log4net.dll I linked above?
Also see my next post:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My suspicion was right. The problem was that Mono does not install any root certificates by default. I tried manually importing certificates until I got it working. Long story short, the easiest way is to import the mozilla root certificates into Mono.
I used:
Ubuntu 12.04 LTS
Mono 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.2)
Here's what I did to get it working:
Put the GoogleSyncPlugin.plgx into the KeePass folder (where the KeePass.exe is)
Prepare a KeePass database on a Windows machine. The database needs to have been synced (or uploaded) at least once so that the authentication process is complete
Thank you very much for this information. I tried it and have been unable to sync with the DB on my Google drive. I have attached the error that I am getting. This occurs whether or not running mono; so my assumption is something else is wrong. Can you please help me to trouble shoot this problem?
Thanks in advance,
Your article was very helpful and useful.
By "not running mono", do you mean that you get the same error with Windows? Or did you mean that you have registered the .exe as a non-native binary and simply call the .exe from the shell. In that case mono is automatically invoked.
Anyway, looks like you are missing the log4net.dll inside your KeePass folder. That solved that error for me.
Have a look at the bullet points #4 and #5 in my post above.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried the above steps, but it's not working - I'm getting the following error message.
Google Sync Plugin
Could not load type 'System.Runtime.Serialization.Json.JsonReaderWriterFactory' from assembly 'DotNetOpenAuth'.
Running Mono with --debug gives the following output just before the above error message is displayed:
Missing method CreateJsonReader in assembly /home/dregad/.local/share/KeePass/PluginCache/i9bFr4M1G5PTUeIFYZag/DotNetOpenAuth.dll, type System.Runtime.Serialization.Json.JsonReaderWriterFactory
This is on Ubuntu 15.04 with Keepass 2.28, KPGoogleSync 2.1.2,
* Mono 3.2.8 (Debian 3.2.8+dfsg-4ubuntu4)
Any ideas ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've managed to get this to work. On ArchLinux with Mono 3.12.0, I was required to copy System.ServiceModel.Web.dll from /usr/lib/mono/gac/System.ServiceModel.Web/3.5.0.0__31bf3856ad364e35/ tot /usr/local/keepass/
Once i did this, I got the same response as Mizo. Running the --debug option, the output seems quite unhelpful:
SendMessage (0, 0x1204, 0x4, 0x7ffffd2e05f0)
Stacktrace:
Native stacktrace:
/usr/lib/libmonosgen-2.0.so.1(+0xd6092) [0x7f444311e092]
/usr/lib/libmonosgen-2.0.so.1(+0x1324bb) [0x7f444317a4bb]
/usr/lib/libmonosgen-2.0.so.1(+0x3fc43) [0x7f4443087c43]
/usr/lib/libpthread.so.0(+0x10210) [0x7f4442e38210]
Debug info from gdb:
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Doing a bit of research, it looks like aggressive garbage collection on in-use variables. A quick look at the code and I don't see any culprits. I tried downgrading to mono 3.2.8, and I observe the same behavior.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I posted this response once, but it doesn't show up. I'm almost using this plugin in ArchLinux with Mono 3.12.8. I did have to link/move System.ServiceModel.Web.dll from /usr/lib/mono/gac/System.ServiceModel.Web/3.5.0.0__31bf3856ad364e35/ to the keepass folder to get past my previous error. After that, all other steps seem to work until following a save, there's a crash.
Yes, this looks like a serious problem. SIGSEGV means some native code is trying to access memory it shouldn't.
Unfortunately I have not enough experience with mono to have any idea what the problem could be.
Does the save work? I mean does it crash after it successfully uploaded or before even trying to upload?
I also do not have the environment you have to try and narrow down the issue.
Have you tried using a different version of mono? Maybe a version of the 2.x family helps.
Next I would try a poor man's debugging attempt by inserting popup messages at various points in the Plugin's code to pinpoint the location of the error.
It may very well be that the problem is inside one of the 3rd party dlls - either Google or Log4Net. In fact, that is where I would put my money. Unfortunately using more up to date versions of the Google SDK is not an option either (no async support in mono).
It looks like chances are good, that there is no fix possible at this time, unfortunately.
My best guess at a solution attempt right now would be to try a different version of mono.
Last edit: Uranium235 2015-01-25
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm able to get it work work if I remove the "try-catch" inside the "finally" command of the function syncWithGoogle. I used the poors man debugging to identify that I was getting a crash at the end of the finally block. Patch attached if you wish to see my changes. Not sure the purpose of this particular try/catch, but I'm now living happily without it....
I am responsible for that particular piece of code.
The UpdateUI statement refreshes the main window and updates where the focus is.
Initially the plugin always reset the focus to the root group, probably to not have an issue where after a sync the previously selected entry/group was deleted by the sync. I removed that and let KeePass deal with that issue.
But I only tested the new method with the most recent version and even looked at the KeePass code to see if it is even possible to throw an exception in case the previously selected item is not present anymore. I found that KeePass handles that by itself and does not throw an exception. But I couldn't be 100% sure if that was the case for past KeePass versions, hence I put the old UpdateUI statement inside the catch block.
It is weird that the client crashes because of that though. That should not have happened in this case. The interesting thing is, that you only removed the fallback to the old method, but the new method seems to work just fine. If that is the case, code execution inside the catch-block should have never occurred. So from a theoretical point of view, your patch should not make any difference.
Yet it does...
Maybe it's the construct of a try-catch inside a finally block?
Could you try just commenting out the line inside the catch-block but letting the try-catch itself be? If it crashes again, I think that is a bug with mono. If it doesn't, I am at a loss...
Anyway, I think it's safe to remove the old update method. That piece of code was probably being overly cautious anyway.
Last edit: Uranium235 2015-02-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Simply commenting out the command to UpdateUI inside the catch didn't fix the issue.. So I moved the try-catch inside the finally block to outside the finally block (up one function into the OnSyncWithGoogle function). When I did this, the crash went away (I did lose the 'status' variable, so I output just "Done").
Per a quick search of the Xamarin bug tracker, Mono does exhibit some errors with finally blocks... perhaps this is an example. Perhaps as a workaround, you could refactor the code without a finally block?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I use the latest version of both Keepass and KeepassGoogleSync from a usb key.
Everything's ok on windows but when I try to sync on linux (ubuntu 14.04) I get a "An exception was thrown by the type initializer for DotNetOpenAuth.Logger"
I have latest version of mono fully installed as well as mono-dmcs.
Any idea ?
Thanks in advance,
Jérôme
Hi!
I got it working on Ubuntu 18.4
https://marc-bouvier.github.io/2018/08/22/using-keepass2-on-ubuntu-18-4/
hi,
Can you explain me a little bit how can i get installed log4net in linux mint?
I'm not a programmer and i'm stucked.
I could install Nuget, but i can't make it install log4net. Also no tutorials online because if you use nuget it's supposed you're kind of an expert...well i'm not.
Thanks
Hi Jérôme,
Did you find solution for this error ?
Thanks,
Adrian
I myself have no experience with using mono on Linux distros and this plugin was only developed for Windows with .NET 4 framework.
So, does windows version of KeePass work fine in mono? If so, I will try to look into why my plugin requires .NET 4.
No solution -- but this is what i found
--I am on Fedora20x64.
--KeePass works ok.
--Gsynch gets the same dot net auth logger error
--log4net seems to be used somewhere and that wasn't installed for me
--I put the log4net dll in my dir where keepass was installed...
that error is gone....
--but...libgluezilla seems to be used for open browser and maybe get the 'ok to access google from this app' form.
--libgluezilla seems like dead wood, but still laying around if you search hard enough.
--I found a 64bit rpm for OpenSuse --- seemed to install
--but KP doing a google sync operation crashes hard...
--this crash isn't because something missing...
So the libgluezilla really isn't meant for my rig -- so that could be it....only way I'd really know is by building from sources to make a libglue that at least is 'matching' my OS....if still crashy..maybe end of line...not sure I will take time to build from sources.....
shoveled enough time on this....
I have tried with Plugin v2.0 and a working configuration. Unfortunately I only get: "Web request to 'https://accounts.google.com/o/oauth/token' failed."
I am not sure why. It could be that the http client used by google is not working at all or that it is a certificate (https) problem.
I will try and extract some more debug information when I have some more time...
But hey, at least it didn't crash ;)
Is that with the new Plugin Version 2.0?
Yes, some google dlls net log4net. That dll is not included because it works fine on windows without that library. The version that comes with the included Google dlls is here
Try configuring and initially syncing the database with a windows machine then copy the database (and KeePass config) to Linux. Once initial setup is done, the Plugin does not open the internal Browser anymore. That is only needed once to get authorization. Maybe that helps.
Last edit: Uranium235 2014-11-03
I tried using the most up to date Google API DLLs that use different http clients. Unfortunately that only makes things worse, as mono does not support async programming required by the non-beta Google SDK yet.
I'm attempting to use the Google Drive Sync on Linux and I feel like i'm getting somewhere, but I've hit a roadblock. I have an Archlinux installation with mono 3.10. I installed mono-tools and log4net. I then sym-linked the log4net.dll file to the root of Keepass (/usr/share/keepass/). This fixed the logger error. However, I'm now getting this error "Could not load type 'System.Runtime.Serialization.Json.JsonReaderWriterFactory' from assembly 'DotNetOpenAuth'". Anyone have ideas of where to look to fix this?
At what stage do you get that error?
When loading the Plugin at KeePass statup or when trying to sync?
Do you use the compiled plugin or the plgx format?
Did you use the log4net.dll I linked above?
Also see my next post:
Got The Plugin working with Linux and Mono!
My suspicion was right. The problem was that Mono does not install any root certificates by default. I tried manually importing certificates until I got it working. Long story short, the easiest way is to import the mozilla root certificates into Mono.
I used:
Ubuntu 12.04 LTS
Mono 2.10.8.1 (Debian 2.10.8.1-1ubuntu2.2)
Here's what I did to get it working:
The Plugin should now work.
You need to prepare the database on a Windows machine, as the authentication process with the native browser window does not work with linux and mono.
Related
Support: Getting Started
Support: GoogleSyncPlugin-2.1.0
Thank you very much for this information. I tried it and have been unable to sync with the DB on my Google drive. I have attached the error that I am getting. This occurs whether or not running mono; so my assumption is something else is wrong. Can you please help me to trouble shoot this problem?
Thanks in advance,
Your article was very helpful and useful.
T
By "not running mono", do you mean that you get the same error with Windows? Or did you mean that you have registered the .exe as a non-native binary and simply call the .exe from the shell. In that case mono is automatically invoked.
Anyway, looks like you are missing the log4net.dll inside your KeePass folder. That solved that error for me.
Have a look at the bullet points #4 and #5 in my post above.
Hi,
I tried the above steps, but it's not working - I'm getting the following error message.
Running Mono with --debug gives the following output just before the above error message is displayed:
This is on Ubuntu 15.04 with
Keepass 2.28,
KPGoogleSync 2.1.2,
* Mono 3.2.8 (Debian 3.2.8+dfsg-4ubuntu4)
Any ideas ?
The suggestions in this post didn't help?
That didn't work for for me (debian testing). I'm still getting the oauth token failed😕
I'm running keepass on wine now
but Now when The Plugin Finishes KeePass Crashes
Last edit: Mizo 2014-12-31
That is unfortunate. I did not experience that.
Try opening KeePass from the shell with the --debug parameter:
$ mono --debug KeePass.exe
Is there anything indicating the cause of the crash?
I've managed to get this to work. On ArchLinux with Mono 3.12.0, I was required to copy System.ServiceModel.Web.dll from /usr/lib/mono/gac/System.ServiceModel.Web/3.5.0.0__31bf3856ad364e35/ tot /usr/local/keepass/
Once i did this, I got the same response as Mizo. Running the --debug option, the output seems quite unhelpful:
Doing a bit of research, it looks like aggressive garbage collection on in-use variables. A quick look at the code and I don't see any culprits. I tried downgrading to mono 3.2.8, and I observe the same behavior.
I posted this response once, but it doesn't show up. I'm almost using this plugin in ArchLinux with Mono 3.12.8. I did have to link/move System.ServiceModel.Web.dll from /usr/lib/mono/gac/System.ServiceModel.Web/3.5.0.0__31bf3856ad364e35/ to the keepass folder to get past my previous error. After that, all other steps seem to work until following a save, there's a crash.
Running with mono --debug shows:
Looks like an unhandled exception to me....
Yes, this looks like a serious problem. SIGSEGV means some native code is trying to access memory it shouldn't.
Unfortunately I have not enough experience with mono to have any idea what the problem could be.
Does the save work? I mean does it crash after it successfully uploaded or before even trying to upload?
I also do not have the environment you have to try and narrow down the issue.
Have you tried using a different version of mono? Maybe a version of the 2.x family helps.
Next I would try a poor man's debugging attempt by inserting popup messages at various points in the Plugin's code to pinpoint the location of the error.
It may very well be that the problem is inside one of the 3rd party dlls - either Google or Log4Net. In fact, that is where I would put my money. Unfortunately using more up to date versions of the Google SDK is not an option either (no async support in mono).
It looks like chances are good, that there is no fix possible at this time, unfortunately.
My best guess at a solution attempt right now would be to try a different version of mono.
Last edit: Uranium235 2015-01-25
I'm able to get it work work if I remove the "try-catch" inside the "finally" command of the function syncWithGoogle. I used the poors man debugging to identify that I was getting a crash at the end of the finally block. Patch attached if you wish to see my changes. Not sure the purpose of this particular try/catch, but I'm now living happily without it....
Great work!
I am responsible for that particular piece of code.
The UpdateUI statement refreshes the main window and updates where the focus is.
Initially the plugin always reset the focus to the root group, probably to not have an issue where after a sync the previously selected entry/group was deleted by the sync. I removed that and let KeePass deal with that issue.
But I only tested the new method with the most recent version and even looked at the KeePass code to see if it is even possible to throw an exception in case the previously selected item is not present anymore. I found that KeePass handles that by itself and does not throw an exception. But I couldn't be 100% sure if that was the case for past KeePass versions, hence I put the old UpdateUI statement inside the catch block.
It is weird that the client crashes because of that though. That should not have happened in this case. The interesting thing is, that you only removed the fallback to the old method, but the new method seems to work just fine. If that is the case, code execution inside the catch-block should have never occurred. So from a theoretical point of view, your patch should not make any difference.
Yet it does...
Maybe it's the construct of a try-catch inside a finally block?
Could you try just commenting out the line inside the catch-block but letting the try-catch itself be? If it crashes again, I think that is a bug with mono. If it doesn't, I am at a loss...
Anyway, I think it's safe to remove the old update method. That piece of code was probably being overly cautious anyway.
Last edit: Uranium235 2015-02-01
Simply commenting out the command to UpdateUI inside the catch didn't fix the issue.. So I moved the try-catch inside the finally block to outside the finally block (up one function into the OnSyncWithGoogle function). When I did this, the crash went away (I did lose the 'status' variable, so I output just "Done").
Per a quick search of the Xamarin bug tracker, Mono does exhibit some errors with finally blocks... perhaps this is an example. Perhaps as a workaround, you could refactor the code without a finally block?