Recovering a blockchain

0 votes

I had two instances of multichain running on the same machine, and the machine crashed. I'm now unable to start either of these instances. The error I'm getting is: 

me@518781d398a5:~$ multichaind -datadir=/home/me/mc2 chain1

MultiChain Core Daemon build 1.0 alpha 14 protocol 10003

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

I checked (ps -x / ps -ef), and there's no multichain process on this machine. Is there anything I can do to restart the blockchain, or do I need to create it from scratch? 

 

asked Jan 4, 2016 by Roy
edited Jan 4, 2016

2 Answers

0 votes

Did you say there was a MultiChain process running on the machine? If so, you can use the stop command for multichain-cli to stop it. If you mistyped above, let us know and we'll come back to you.

answered Jan 4, 2016 by MultiChain
My bad (a typo in the original post): there's __NO__ multichain process running on the machine.
OK, try removing the bitcoind.pid file from the blockchain directory, then try again?
Still getting the same error: ERROR: Couldn't initialize permission database for blockchain chain1. Probably multichaind for this blockchain is already running. Exiting...
0 votes

First, it's worth checking the end of /home/me/mc2/chain1/permissions.log to see if some explanation is given for the permissions failure. The computer could have crashed while the database was in an inconsistent state.

In any event the likely solution is restarting multichaind with the flag -reindex=1

Please let me know what you find in the log and if this solution works.

answered Jan 4, 2016 by MultiChain
The database is indeed corrupted - here's an excerpt of the permissions.log file:

2016-01-04 10:42:04.281 Initialize: Database corrupted 1
2016-01-04 13:20:04.307 Initialize: Database corrupted 1

I also tried to run the blockchain with -reindex=1 - still getting the same error message.
OK, here's another suggestion from the team, to manually remove the corrupted databases first:

rm -Rf permissions*
rm -Rf assets*

And then run it with -reindex=1

Please let us know...
Well, it does behave different now ... I got a segmentation fault.
Ok, it turns out that alpha 14 broke something in reindexing and unfortunately you can't use alpha 13 to fix this because there was a blockchain protocol upgrade. Will revert shortly with options.
Thanks for your patience. So your options are: (a) zip up the blockchain folder and send it to us, and we will fix it; (b) wait until the release of alpha 15 which should be able to reindex successfully; (c) asap we will make a special pre-alpha 15 build and send it to you privately. Please let me know.
So here's the (unofficial) download with the bug fix regarding reindexing: http://www.multichain.com/download/multichain-1.0-alpha-14.1.tar.gz - since this is not an official release we recommend using this for the reindexing functionality only (i.e. run it from a directory with -reindex=1) then stop it (using multichain-cli chain1 stop), and then go back to running the regular alpha 14 release.
Don't worry about it. Since the blockchain I had is used for development purposes only, it didn't contain any critical information.
OK, no problem. Thanks anyway for bringing the issue to our attention!
HI, i am too facing same error, i had tried removing permission.* and entities.*, restart multichaind with reindex=1,

as we try to connect to other node at other instakce, it repeats the error,
we have crossed checked our security tags.
pl help
...