kee-org / KeeFox

Legacy browser and XUL application integration with KeePass Password Safe. See https://github.com/kee-org/browser-addon for the new version for Firefox 57+
https://forum.kee.pm
418 stars 48 forks source link

Input string was not in a correct format #567

Closed pavelonline closed 8 years ago

pavelonline commented 8 years ago

After addition of some entries I couldn't get keefox work. When I try to open my database KeePass is falling with error:

System.FormatException: Input string was not in a correct format.
  at System.Number.StringToNumber (System.String str, NumberStyles options, System.NumberBuffer& number, System.Globalization.NumberFormatInfo info, Boolean parseDecimal) [0x00000] in <filename unknown>:0 
  at System.Number.ParseInt32 (System.String s, NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00000] in <filename unknown>:0 
  at System.Int32.Parse (System.String s) [0x00000] in <filename unknown>:0 
  at KeePassRPC.KeePassRPCExt.OnKPDBOpen (System.Object sender, KeePass.Forms.FileOpenedEventArgs e) [0x00000] in <filename unknown>:0 
  at KeePass.Forms.MainForm.OpenDatabase (KeePassLib.Serialization.IOConnectionInfo ioConnection, KeePassLib.Keys.CompositeKey cmpKey, Boolean bOpenLocal) [0x00000] in <filename unknown>:0 
  at KeePass.Forms.MainForm.OnFormLoad (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e) [0x00000] in <filename unknown>:0 
Christian2604 commented 8 years ago

I have the same issue. Keepass itself is showing no errors. Is there any workaround?

luckyrat commented 8 years ago

The settings (configuration) part of your database has been corrupted and KeeFox can't work out what version of its own configuration is stored in the database.

KeeFox can handle this problem more gracefully so I'll include a fix in the next version (due for beta release in a week or so).

In the mean time you can workaround by manually editing the XML of your database (security risk!) or maybe the advanced database tools - more details here: https://zohodiscussions.com/keefox/topic/system-formatexception-input-string-was-not-in-a-correct-format.

If that's difficult or undesirable (understandable given the risks) you'll just have to remove the KeePassRPC.plgx plugin from your KeePass installation until the new beta of KeeFox is released.

There is definitely something else wrong though. There is nothing in the KeeFox code that can cause this corruption so there must be a bug in KeePass or some kind of system/hardware bug on your system. Given the feedback in the linked thread I think a KeePass bug (maybe introduced by another plugin?) is the most likely reason for the database getting corrupt in the first place.

I'm sure that any further information you can provide that might allow us to reproduce the corruption would be really appreciated by whoever is responsible for that code and I'm happy to help triage the issue since data corruption is a very serious problem.

Christian2604 commented 8 years ago

Just for documentation: I also had an empty version tag. Deleting it worked like a charm. Thanks!