Bitcore down - "Corrupted block database detected" Help!


(Michael Smyers) #1

Hello! We run Bitcore as a full node for a Bitcoin ATM company.

Here’s the version of Bitcore

  "description": "A full Bitcoin node build with Bitcore",
  "repository": "https://github.com/user/project",
  "license": "MIT",
  "readme": "README.md",
  "dependencies": {
    "bitcore-lib": "^v0.13.11",
    "bitcore-node": "^1.0.1",
    "bitcore-wallet-service": "^1.4.0",
    "insight-api": "^0.3.1",
    "insight-ui": "^0.3.0"
  }
}

It seems that “out of nowhere” we got a corrupted block. What should I do?

[2017-06-30T21:01:56.153Z] info: Starting db
[2017-06-30T21:01:56.516Z] info: Bitcoin Database Ready
[2017-06-30T21:01:56.516Z] info: Starting address
[2017-06-30T21:01:56.528Z] info: Starting web
[2017-06-30T21:01:56.556Z] info: Starting insight-api
[2017-06-30T21:01:56.557Z] info: Starting bitcore-wallet-service
info Using message broker server at http://localhost:3380 
info Using locker server:localhost:3231 
ERR! Error connecting to Insight (livenet) @ http://localhost:3001 
Connection established to  mongodb://localhost:27017/bws
info Using locker server:localhost:3231 
info Using message broker server at http://localhost:3380 
Connection established to  mongodb://localhost:27017/bws
info Using message broker server at http://localhost:3380 
[2017-06-30T21:01:56.719Z] info: Starting insight-ui
[2017-06-30T21:01:56.722Z] info: Bitcore Node ready
info Connected to Insight (testnet) @ https://test-insight.bitpay.com:443 
info Connected to Insight (livenet) @ http://localhost:3001 
 ::ffff:54.227.110.6 2017-06-30T21:02:14.193Z "POST /bws/api/v1/addresses/scan" 200 16 53.818 "-" 2bd446fc-c625-4e7f-a25e-b41730054892 f7bb5b0c3186c029236f12d6ed1cb887d93336fc11c4cac664a91a421d06c9c4
[2017-06-30T21:02:15.631Z] info: Starting bitcoind
: Corrupted block database detected.

Do you want to rebuild the block database now?

The last good message was:

verb Notification ScanFinished { result: 'success' }
 ::ffff:54.227.110.6 2017-06-30T20:53:17.199Z "GET /bws/api/v1/balance/?r=61274" 200 866 69.925 "-" aba64eb4-1ac7-4700-ba3f-6ef5c0e3bf77 12327c932777f1028e1f5348822e29c6617764f83f50e61b863716bc3a755345
 ::ffff:54.227.110.6 2017-06-30T20:53:17.398Z "GET /bws/api/v1/txhistory/?limit=10&r=74374" 200 5222 67.257 "-" aba64eb4-1ac7-4700-ba3f-6ef5c0e3bf77 12327c932777f1028e1f5348822e29c6617764f83f50e61b863716bc3a755345
verb Notification ScanFinished { result: 'success' }
bitcored: /home/k/bitcore-node/bin/../libbitcoind/depends/x86_64-linux/include/boost/unordered/detail/table.hpp:537: std::size_t boost::unordered::detail::table<Types>::delete_nodes(boost::unordered::detail::table<Types>::link_pointer, boost::unordered::detail::table<Types>::link_pointer) [with Types = boost::unordered::detail::map<std::allocator<std::pair<const uint256, CCoinsCacheEntry> >, uint256, CCoinsCacheEntry, CCoinsKeyHasher, std::equal_to<uint256> >, std::size_t = long unsigned int, boost::unordered::detail::table<Types>::link_pointer = boost::unordered::detail::ptr_bucket*]: Assertion `prev->next_ != end' failed.
[2017-06-30T20:53:39.722Z] info: Starting bitcoind
: Corrupted block database detected.```

(Michael Smyers) #2

I was able to work around this by adding checklevel=2 to ~/.bitcore/data/bitcoin.conf

On a side note, these forums are a ghost town.