ironfish icon indicating copy to clipboard operation
ironfish copied to clipboard

DatabaseIsLockedError

Open chenzongxiong opened this issue 2 years ago • 3 comments

What happened?

image

Version

0.1.36@6dfc7c36

Debug output

root@zq1-desktop:~# ironfish debug
DatabaseIsLockedError: Corruption: 5160 missing files; e.g.: /root/.ironfish/databases/default/151054.ldb
    at /usr/lib/node_modules/ironfish/node_modules/@ironfish/sdk/build/src/storage/levelup/database.js:42:32
    at /usr/lib/node_modules/ironfish/node_modules/levelup/lib/levelup.js:119:14
    at /usr/lib/node_modules/ironfish/node_modules/abstract-leveldown/abstract-leveldown.js:38:14
    at /usr/lib/node_modules/ironfish/node_modules/deferred-leveldown/deferred-leveldown.js:31:21
    at /usr/lib/node_modules/ironfish/node_modules/abstract-leveldown/abstract-leveldown.js:38:14
Database in use, skipping output that requires database.
Stop the node and run the debug command again to show full output.

Iron Fish version       0.1.36 @ 6dfc736
Iron Fish library       0.0.14 @ 6dfc736
Operating system        Linux x64
CPU model(s)            Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz
CPU threads             16
RAM total               30.99 GiB
Node version            v16.15.0
ironfish in PATH        true
Telemetry enabled       true
root@zq1-desktop:~#

Relevant log output

No response

Graffiti

bear_Graffiti

chenzongxiong avatar Jun 27 '22 22:06 chenzongxiong

How did you sync your chain?

Anything interesting happen before this that may have corrupted the DB?

lwisne avatar Aug 03 '22 18:08 lwisne

The database is easily corrupted across different version of ironfish.

From what I observed, 1. If someone removes LOCK in the ~/.ironfish/*/LOCK forcibly, and starts another node, then the database will be corrupted. 2. When I send transactions for an account, which tokens are minted by other nodes. The local node won't witness latest tokens, I have to run ironfish accounts:rescan to sync account first. This will cause nullify error. I think someone already reported. 3. And if the second case takes place, then the database can also easily be corrupted. I have no idea.

I strongly suggest the official binary should trap the signal of SIGINT, SIGTSTP, SIGKILL. Also provide a easier way to setup for systemd to make the process run smoothy.

chenzongxiong avatar Aug 03 '22 19:08 chenzongxiong

We don't support 1) - if you are manually deleting files in that data_dir, that is user error if something breaks.

Would love to dig into 2) - do you have a set of steps to reproduce this? I think "tokens minted by other nodes cause an error" is likely too broad. There's probably something more specific about your particular workflow.

lwisne avatar Aug 03 '22 22:08 lwisne

We've made significant changes to the wallet since this issue was created. Please create a new issue if you've run into this again on a more recent version. Thanks!

hughy avatar Feb 27 '23 18:02 hughy