How to recover from database corrupt

+2 votes
Using MultiChain Core RPC client build 1.0 alpha 17 protocol 10004.

When trying to start multichaind, now I get this:

ERROR: Couldn't initialize permission database for blockchain chain2. Probably multichaind for this blockchain is already running. Exiting...

Using ps, I don't see any multichain running. When I look at the permission.log, I see a bunch of database corrupted logs like this:

[root@dil-blk02 chain2]# tail permissions.log

2016-07-01 05:00:09.885    Initialize: Database corrupted 1

2016-07-01 05:00:34.242    Initialize: Database corrupted 1

 

 

What are steps to recover?
asked Jul 1, 2016 by rldincr

1 Answer

+1 vote

First, more recent versions of MultiChain deal with this situation much better.

If you don't want to upgrade, you should restart multichaind with the extra option -reindex=1, and if that doesn't help, first remove the permissions.* and assets.* files from the blockchain directory, then try again.

answered Jul 1, 2016 by MultiChain
Thanks. I tried that, it sort of worked. I can start multichaind again, but it seems to be running EXTREMELY slowly. Using multichain-cli, any commands takes like 5+ minutes to return the result, whereas before the db got corrupted it was almost instant. Now if I look at the permission.log file, there's a ton of activity (~5 to 6 Block commit traces per second). Is this normal? Is the db just still reindexing? (It's been about half a day since I restarted multichaind.
Can you please try quitting MultiChain, installing alpha 21, then relaunching (with -reindex=1) and seeing if the problem persists? If so we'll take a look at your blockchain directory to see if we can reproduce and solve it.
After reindexing, it worked shortly but very soon afterwards I got the database corrupt error again, see below. How can I send you the blockchain directory?

2016-07-13 13:23:06.768    Grant: (00000000-d0b35837-00000002-30a9d01a) (0-4294967295, 1468429360), In consensus: 1, Admin count: 1, Miner count: 2
2016-07-13 13:23:06.768    Grant: (00000000-d0b35837-00000004-30a9d01a) (0-4294967295, 1468429360), In consensus: 1, Admin count: 1, Miner count: 2
2016-07-13 13:23:06.768    Grant: (00000000-d0b35837-00000002-30a9d01a) (0-4294967295, 1468429360), In consensus: 1, Admin count: 1, Miner count: 2
2016-07-13 13:23:06.768    Grant: (00000000-d0b35837-00000004-30a9d01a) (0-4294967295, 1468429360), In consensus: 1, Admin count: 1, Miner count: 2
2016-07-13 13:23:06.770    Mempool copy:    704820, Admin count: 1, Miner count: 2, DB rows: 707800, Ledger Rows: 1409761
2016-07-13 13:23:07.012    Mempool clr :    704820, Admin count: 1, Miner count: 2, DB rows: 707800, Ledger Rows: 1409759
2016-07-13 13:23:07.012    Mempool rstr:    704820, Admin count: 1, Miner count: 2, DB rows: 707800, Ledger Rows: 1409761
2016-07-13 13:23:07.225    Mempool clr :    704820, Admin count: 1, Miner count: 2, DB rows: 707800, Ledger Rows: 1409759
2016-07-13 13:24:45.282    Initialize: Database corrupted 1
2016-07-13 13:25:19.877    Initialize: Database corrupted 1
I've asked a developer to look at this and will get back to you shortly.
Yes, can you please zip up your blockchain directory and send it to multichain.debug at Gmail. Thanks.
...