bitpay / bitcore

A full stack for bitcoin and blockchain-based applications
https://bitcore.io/
MIT License
4.81k stars 2.08k forks source link

Problem `Another node is the primary syncing node` when using docker-compose up & down #3572

Closed kasrakhamesi closed 1 year ago

kasrakhamesi commented 1 year ago

I started bitcore with docker-compose and using docker-compose down command. after one hour I trying to start bitcore with docker-compose up --build but every time get this error : Another node is the primary syncing node

how can fix it ? help me

airstring commented 1 year ago

This log will also appear on my node, but it doesn't affect the main program.

kasrakhamesi commented 1 year ago

This log will also appear on my node, but it doesn't affect the main program.

but stopped syncing progress for me :(

airstring commented 1 year ago

reference: https://github.com/bitpay/bitcore/issues/2973#issuecomment-852236221

1.First enter on the machine where the Bitcore was running. 2.Start the MongoDB CLI: mongo --port 27017 3.List the databases: show dbs 4.locate the bitcore db 5.select db: use bitcore 6.display the collections: show collections 7.locate state collection and check its content: db.state.find() 8.You should see one entry. Delete it: db.state.deleteOne({_id: ObjectId('XXXXXXXXX')})

I tested it and it worked.

kajoseph commented 1 year ago

If you only have one instance of bitcore-node running, this will happen when there's an unclean shutdown (i.e. kill -9 or hitting stop on a debugger). If you let it run, it should auto-resolve in a few minutes, or if you're impatient can do the above solution and manually modify the state db doc.