bitpay / bitcore-node

Extensible full node using Bitcore
https://bitcore.io/
Other
352 stars 644 forks source link

error: uncaught exception: AssertionError [ERR_ASSERTION] #521

Closed MarcHagen closed 6 years ago

MarcHagen commented 7 years ago

/home/bitcoin/.nvm/versions/node/v8.4.0/lib └── bitcore@5.0.0-beta.9

I cannot run bitcore because it's keeps crashing on this error. If i comment the assert on 641 it will work just fine and start syncing

[info] (net) Added inbound peer (127.0.0.1:57226).
[info] (net) Received version (127.0.0.1:57226): version=70001 height=0 services=1 agent=/bitcore:5.0.0-beta.1/
[2017-09-14T18:45:35.651Z] info: Connected to peer: 127.0.0.1, network: livenet, version: 70015, subversion: /bcoin:v1.0.0-beta.14/, status: ready, port: 8333, best height: 485252
[2017-09-14T18:45:35.652Z] error: uncaught exception: { AssertionError [ERR_ASSERTION]: Our peer does not seem to be fully synced: best height: 485252 tip height: 576001
at HeaderService._onBestHeight (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bitcore-node/lib/services/header/index.js:641:3)
at Object.onceWrapper (events.js:316:30)
at emitOne (events.js:115:13)
at P2P.emit (events.js:210:7)
at P2P._onPeerReady (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bitcore-node/lib/services/p2p/index.js:351:10)
at emitTwo (events.js:125:13)
at Pool.emit (events.js:213:7)
at Peer.peerReady (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bitcore-p2p/lib/pool.js:247:10)
at emitNone (events.js:105:13)
at Peer.emit (events.js:207:7)
generatedMessage: false,
name: 'AssertionError [ERR_ASSERTION]',
code: 'ERR_ASSERTION',
actual: false,
expected: true,
operator: '==' }
[2017-09-14T18:45:35.655Z] error: AssertionError [ERR_ASSERTION]: Our peer does not seem to be fully synced: best height: 485252 tip height: 576001
at HeaderService._onBestHeight (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bitcore-node/lib/services/header/index.js:641:3)
at Object.onceWrapper (events.js:316:30)
at emitOne (events.js:115:13)
at P2P.emit (events.js:210:7)
at P2P._onPeerReady (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bitcore-node/lib/services/p2p/index.js:351:10)
at emitTwo (events.js:125:13)
at Pool.emit (events.js:213:7)
at Peer.peerReady (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bitcore-p2p/lib/pool.js:247:10)
at emitNone (events.js:105:13)
at Peer.emit (events.js:207:7)
[2017-09-14T18:45:35.655Z] info: Beginning shutdown
[2017-09-14T18:45:35.655Z] warn: Node is stopping, gently closing the database. Please wait, this could take a while.
[2017-09-14T18:45:35.656Z] info: P2P Service: disconnecting pool and peers. SIGINT issued, system shutdown initiated
[2017-09-14T18:45:35.656Z] info: Disconnected from peer: 127.0.0.1
[2017-09-14T18:45:35.656Z] info: Stopping insight-ui
[2017-09-14T18:45:35.657Z] info: Stopping insight-api
[2017-09-14T18:45:35.659Z] info: Stopping web
[2017-09-14T18:45:35.659Z] info: Stopping fee
[2017-09-14T18:45:35.659Z] info: Stopping address
[2017-09-14T18:45:35.660Z] info: Stopping transaction
[2017-09-14T18:45:35.660Z] info: Stopping mempool
[2017-09-14T18:45:35.660Z] info: Stopping block
[2017-09-14T18:45:35.660Z] info: Stopping header
[2017-09-14T18:45:35.660Z] info: Stopping timestamp
[2017-09-14T18:45:35.661Z] info: Stopping p2p
[2017-09-14T18:45:35.661Z] error: uncaught exception: TypeError: peer.blockMap.reset is not a function
at Pool.stopSync (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bcoin/lib/net/pool.js:748:19)
at FullNode.stopSync (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bcoin/lib/node/fullnode.js:361:20)
at Bcoin.stop (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bitcore-node/lib/services/p2p/bcoin.js:28:15)
at P2P.stop (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bitcore-node/lib/services/p2p/index.js:133:24)
at /home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bitcore-node/lib/node.js:227:36
at /home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/async/dist/async.js:3083:16
at replenish (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/async/dist/async.js:946:17)
at Immediate.iterateeCallback (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/async/dist/async.js:931:17)
at Immediate._onImmediate (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/async/dist/async.js:906:16)
at runCallback (timers.js:781:20)
[2017-09-14T18:45:35.663Z] error: TypeError: peer.blockMap.reset is not a function
at Pool.stopSync (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bcoin/lib/net/pool.js:748:19)
at FullNode.stopSync (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bcoin/lib/node/fullnode.js:361:20)
at Bcoin.stop (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bitcore-node/lib/services/p2p/bcoin.js:28:15)
at P2P.stop (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bitcore-node/lib/services/p2p/index.js:133:24)
at /home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/bitcore-node/lib/node.js:227:36
at /home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/async/dist/async.js:3083:16
at replenish (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/async/dist/async.js:946:17)
at Immediate.iterateeCallback (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/async/dist/async.js:931:17)
at Immediate._onImmediate (/home/bitcoin/.nvm/versions/node/v8.4.0/lib/node_modules/bitcore/node_modules/async/dist/async.js:906:16)
at runCallback (timers.js:781:20)
[2017-09-14T18:45:35.663Z] info: Beginning shutdown
[2017-09-14T18:45:35.663Z] warn: Node is stopping, gently closing the database. Please wait, this could take a while.
[2017-09-14T18:45:35.663Z] info: P2P Service: disconnecting pool and peers. SIGINT issued, system shutdown initiated
[2017-09-14T18:45:35.663Z] info: Stopping insight-ui
[2017-09-14T18:45:35.663Z] info: Stopping insight-api
[2017-09-14T18:45:35.664Z] info: Stopping web
[2017-09-14T18:45:35.664Z] info: Stopping fee
[2017-09-14T18:45:35.664Z] info: Stopping address
[2017-09-14T18:45:35.664Z] info: Stopping transaction
[2017-09-14T18:45:35.664Z] info: Stopping mempool
[2017-09-14T18:45:35.664Z] info: Stopping block
[2017-09-14T18:45:35.664Z] info: Stopping header
[2017-09-14T18:45:35.664Z] info: Stopping timestamp
[2017-09-14T18:45:35.665Z] info: Stopping p2p
[info] (net) Removed loader peer (193.46.80.101:8333).
[error] (node) Database is closed.
[error] (node) Database is closed.
[error] (node) Database is closed.
[error] (node) Database is closed.
[error] (node) Database is closed.
[error] (node) Database is closed.
[info] (node) Node is closed.
Mirobit commented 7 years ago

I get a different Assertion Error every time a getHeaders response was not received (which happens every time I started the node after a few messages).

I am connected to a 0.15.99 remote node.

[2017-10-16T19:42:35.357Z] info: Header Service: download progress: 272000/490188  (55.49%)
[2017-10-16T19:42:35.920Z] info: Header Service: download progress: 274000/490188  (55.90%)
[2017-10-16T19:42:38.110Z] info: Header Service: we have not received a response to getHeaders from the network, retrying.
[2017-10-16T19:42:40.112Z] info: Header Service: we have not received a response to getHeaders from the network, retrying.
[2017-10-16T19:42:42.115Z] info: Header Service: we have not received a response to getHeaders from the network, retrying.
[2017-10-16T19:42:44.114Z] info: Header Service: we have not received a response to getHeaders from the network, retrying.
[2017-10-16T19:42:45.228Z] error: uncaught exception: { AssertionError [ERR_ASSERTION]: headers not in order: 0000000000000004b8ed801f8a09ba8c1248a5b1dd1533a35124a80438573f59 -and- 0000000000000003fe2d3425e9f9b906f02f40b3db90d908ba0fbd1e44cf43f8 Last header at height: 276000