keepass-diff icon indicating copy to clipboard operation
keepass-diff copied to clipboard

Error opening Database A:

Open abc2006 opened this issue 2 years ago • 7 comments

After a few successfull attempts suddenly my diff doesn't work anymore. Unfortunately i cannot figure out the Error nor the Solution for this. Keepass still works fine.

keediff --passwords ***** DB1.kdbx cc.kdbx -v thread 'main' panicked at 'Error opening database A: DatabaseIntegrity { e: UTF8 { e: Utf8Error { valid_up_to: 0, error_len: Some(1) } } }', /home/stephan/.cargo/registry/src/github.com-1ecc6299db9ec823/keepass-diff-1.1.4/src/main.rs:117:18 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

so i did a user@localhost:~$ RUST_BACKTRACE=1

But the result keeps the same.

If you have any hints or i can provide any further information, thank you. Stephan

abc2006 avatar Apr 19 '23 09:04 abc2006

Hi @abc2006, the DatabaseIntegrity sounds like a broken database to me. Can you open database A in a regular client? (In your example, database A should be DB1.kdbx)

I need to update the dependencies soon but that needs a few modifications as far as I could tell, so I postponed that. If your database is working in another client, the update of the dependencies could help. Another thing to try out: What happens if you switch cc.kdbx and DB1.kdbx? Will it always tell you Error opening database A or will it change to a DatabaseIntegrity error for database B then? (This would hint even more to DB1.kdbx being broken)

Narigo avatar Apr 19 '23 11:04 Narigo

Hi,

thanks for your answer.

Your Questions:

  • Error changes to B if i change the Databases
  • Databases DB1 and cc are both working fine in my client. Don't know if this matters:

I have a local database on each sharing computer (eg DB1_stephan_home.kdbx) which i normally am working with. When i open this database, Keepass is set to synchronise the DB1.kdbx (which is in my Nextcloud and shared with other clients) The other clients should work the same way to avoid unsync-problems - obviously not as good as intended.

abc2006 avatar Apr 19 '23 11:04 abc2006

❯ keepass-diff test/test.kdbx test/test2.kdbx --passwords demopass
thread 'main' panicked at 'Error opening database A: IO { e: Os { code: 2, kind: NotFound, message: "No such file or directory" } }', src/main.rs:117:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Running it using docker.

saas786 avatar Jul 03 '23 08:07 saas786

Hi @saas786, that doesn't sound like the initial issue described in here. If you're running this in Docker, do you have the databases available inside of it at all? Is it on a mounted volume in Docker?

Narigo avatar Jul 03 '23 10:07 Narigo

@Narigo

do you have the databases available inside of it at all?

I am using test databases available in this repo.

Is it on a mounted volume in Docker?

I am not sure how to answer it, I am not well versed in docker. I have just followed your readme, and setup .zshrc alias, and as per gif, executed the command.

saas786 avatar Jul 04 '23 05:07 saas786

@saas786 please open a new issue, your issue is most probably not related to the issue that's discussed in here.

Check whether you find the alias in .zshrc that it includes this part: -v "$(pwd)":/app:ro or something similar. If it does and you still have problems, please open a new issue and add all details you have. The error message says it cannot find the file you want to check and if you don't have the files in your folder structure, that is the problem. But as I said: Please move this question to another issue then and we can figure out what could be written in the Readme file to make it better understandable for the next person.

Narigo avatar Jul 04 '23 08:07 Narigo

I’m having the same error as @abc2006: (save for the slightly different line of cause where the crash happens)

thread 'main' panicked at /home/t/.cargo/registry/src/index.crates.io-6f17d22bba15001f/keepass-diff-1.2.0/src/main.rs:122:18:
Error opening database A: DatabaseIntegrity(Xml(BadEvent { expected: "text containing a value", event: End("Key") }))

after running `keepass-diff db1.kdbx db2.kdbx --passwords '…' --keyfile-a ~/some/path --keyfile-b ~/some/path

But if i use replace --passwords by --same-password to get prompted for it, then the error turns into:

thread 'main' panicked at /home/t/.cargo/registry/src/index.crates.io-6f17d22bba15001f/keepass-diff-1.2.0/src/main.rs:122:18:
Error opening database A: Key(IncorrectKey)

And:

  • I triple-checked that the password was correct
  • Swapping the order of the two databases does not change anything and it stills says error opening database A (it does not change to B)
  • Both databases work totally fine in KeePassXD and KeePassDX

Any idea what I could do to get it working? :)

thomas-kuntz avatar Nov 22 '23 14:11 thomas-kuntz