status-im / status-console-client

Status messaging console user interface
Mozilla Public License 2.0
10 stars 2 forks source link

Error: file is encrypted or is not a database #46

Closed decanus closed 5 years ago

decanus commented 5 years ago

Since the SQLite update, I keep getting the error "file is encrypted or is not a database" when trying to run the console client, is there some kind of setup that needs to be run beforehand? If yes this should be added to the readme so people can actually run the client.

mandrigin commented 5 years ago

hmm, never had this issue, @adambabik @dshulyak maybe you know?

dshulyak commented 5 years ago

could it be that you are using multiple different keys with the same datadir? i think this error is raised when sqlite tries to decrypt db with wrong key

cammellos commented 5 years ago

sqlite version differences, kdf iterations as well might be the culprit, I can have a look as well

decanus commented 5 years ago

@dshulyak so it seems like I don't even have a datadir, which would be located under /tmp/status-term-client

dshulyak commented 5 years ago

@dshulyak so it seems like I don't even have a datadir, which would be located under /tmp/status-term-client

so have you tried with clean directory? sorry for dumb question :). unless you changed things mentioned by @cammellos i have no clue how to get this error

we can add a note to README that db in datadir is now encrypted. so user will have to make sure that one key = one datadir.

oskarth commented 5 years ago

Same issue.

SQLite version 3.26.0 2018-12-01 12:34:55

EDIT: If I do

> rm -rf /tmp/status-term-client/*

And make sure to only generate one key it seems to work (well, launch curses interface)

Can we make this a bit smoother so having multiple keys doesn't throw error like this? Not sure what the best solution would be

decanus commented 5 years ago

@oskarth I generated a keypair and I am still experiencing this issue.

oskarth commented 5 years ago

@decanus When you generate a keypair it should persist to above tmp directory (or maybe different dir). Did you find this directory? If yes, did you remove it and regen keypair? If no, wtf maybe trace go code to see why it succeeds but doesn't persist (file dir permissions? mkdir -p /tmp/status-term-client/?)

decanus commented 5 years ago

Ok so I tried again it doesn’t seem to create the data dir. even though the ownership should be completely fine

adambabik commented 5 years ago

This is reproducible when using the same data directory but with different private keys. As we want to keep it user-friendly and don't require passing a unique data dir for each key, I suggest prefixing data dir with the public key.

This will be transparent from the user perspective.