Bitcoin Forum
December 13, 2024, 08:12:26 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin core shutdown fails / hungs  (Read 289 times)
croxNN (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 3


View Profile
August 31, 2019, 04:51:43 PM
 #1

Hi everyone!

I have problem with shutting down bitcoin core on linux platform for years with different bitcoin core versions Sad
bitcoind and bitcoin-qt hungs after shutdown it. In bitcon.conf only one line - server=1

Note that is with empty database (like 1st bitcoind run!)

Here is debug.log with debug=0:
...

2019-08-31T16:29:46Z Shutdown: In progress...
2019-08-31T16:29:46Z net thread exit
2019-08-31T16:29:47Z msghand thread exit

Here is debug.log with debug=1:
...
019-08-31T16:46:40Z Shutdown: In progress...
2019-08-31T16:46:40Z Stopping HTTP RPC server
2019-08-31T16:46:40Z Unregistering HTTP handler for / (exactmatch 1)
2019-08-31T16:46:40Z Unregistering HTTP handler for /wallet/ (exactmatch 0)
2019-08-31T16:46:40Z Stopping RPC
2019-08-31T16:46:40Z RPC stopped.
2019-08-31T16:46:40Z Stopping HTTP server
2019-08-31T16:46:40Z Waiting for HTTP worker threads to exit
2019-08-31T16:46:40Z libevent: epoll_dispatch: epoll_wait reports 1
2019-08-31T16:46:40Z libevent: event_active: 0x559cf948bda0 (fd 24), res 2, callback 0x7fc92f469610
2019-08-31T16:46:40Z libevent: event_process_active: event: 0x559cf948bda0, EV_READ   call 0x7fc92f469610
2019-08-31T16:46:40Z libevent: event_base_loop: asked to terminate loop.
2019-08-31T16:46:40Z libevent: event_del: 0x7fc914000d00 (fd -1), callback 0x559cf681f6d0
2019-08-31T16:46:40Z torcontrol thread exit
2019-08-31T16:46:40Z addcon thread exit
2019-08-31T16:46:40Z opencon thread exit
2019-08-31T16:46:40Z libevent: event_del: 0x559cf8d236c8 (fd 9), callback 0x7fc92f476500
2019-08-31T16:46:40Z libevent: Epoll DEL(1) on fd 9 okay. Old events were 2; read change was 2 (del); write change was 0 (none); close change was 0 (none)
2019-08-31T16:46:40Z libevent: event_del: 0x559cf8d230a8 (fd 10), callback 0x7fc92f476500
2019-08-31T16:46:40Z libevent: Epoll DEL(1) on fd 10 okay. Old events were 2; read change was 2 (del); write change was 0 (none); close change was 0 (none)
2019-08-31T16:46:40Z Waiting for HTTP event thread to exit
2019-08-31T16:46:40Z libevent: epoll_dispatch: epoll_wait reports 1
2019-08-31T16:46:40Z libevent: event_active: 0x559cf8d228e0 (fd Cool, res 2, callback 0x7fc92f469610
2019-08-31T16:46:40Z libevent: event_process_active: event: 0x559cf8d228e0, EV_READ   call 0x7fc92f469610
2019-08-31T16:46:40Z libevent: event_base_loop: no events registered.
2019-08-31T16:46:40Z Exited http event loop
2019-08-31T16:46:40Z libevent: event_del: 0x559cf8d228e0 (fd Cool, callback 0x7fc92f469610
2019-08-31T16:46:40Z libevent: Epoll DEL(1) on fd 8 okay. Old events were 2; read change was 2 (del); write change was 0 (none); close change was 0 (none)
2019-08-31T16:46:40Z libevent: event_base_free_: 0 events freed
2019-08-31T16:46:40Z Stopped HTTP server
2019-08-31T16:46:40Z BerkeleyEnvironment::Flush: [/bitcoin/bitcoin/] Flush(false)
2019-08-31T16:46:40Z BerkeleyEnvironment::Flush: Flushing wallet.dat (refcount = 0)...
2019-08-31T16:46:40Z BerkeleyEnvironment::Flush: wallet.dat checkpoint
2019-08-31T16:46:40Z BerkeleyEnvironment::Flush: wallet.dat detach
2019-08-31T16:46:40Z net thread exit
2019-08-31T16:46:40Z BerkeleyEnvironment::Flush: wallet.dat closed
2019-08-31T16:46:40Z BerkeleyEnvironment::Flush: Flush(false) took              72ms
2019-08-31T16:46:40Z msghand thread exit

The same configuration with bitcoin testnet shutdowns fine.

Maybe someone can help me with finding where problem is ? I'm very tired with it. Thanks in advance.
pereira4
Legendary
*
Offline Offline

Activity: 1610
Merit: 1183


View Profile
September 04, 2019, 11:31:05 PM
 #2

This has been happening to me for years too, tested on Windows nodes as well. The only workaround I've found is run a shortcut with this:

-reindex-chainstate

Remove the shortcun when completed. I think it may be related to RPC calls, a lot of people complained for years with problems related to crashes while shutting down and it's still not nailed down for all system it seems. I can't see anything odd on the logs. I have to run that shortcut whenever it starts derping again.

AndreyVen
Newbie
*
Offline Offline

Activity: 38
Merit: 0


View Profile
September 05, 2019, 02:36:10 AM
 #3

So it basically wants to re-download the whole chain after you shut it down and start again? Odd I have never observed that issue. Which OS are you exactly running?
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
September 05, 2019, 02:04:37 PM
Last edit: September 05, 2019, 02:15:33 PM by AdolfinWolf
 #4

So it basically wants to re-download the whole chain after you shut it down and start again? Odd I have never observed that issue. Which OS are you exactly running?

Quote
I have problem with shutting down bitcoin core on linux platform for years with different bitcoin core versions Sad
Seems like OP is using Linux and i don't see any indication of OP telling, or by looking at the debug log that he needs to reindex or download the entire chain after booting up the wallet again. (Hard to tell when it's first ran anyway.

This has been happening to me for years too, tested on Windows nodes as well. The only workaround I've found is run a shortcut with this:

-reindex-chainstate

Remove the shortcun when completed. I think it may be related to RPC calls, a lot of people complained for years with problems related to crashes while shutting down and it's still not nailed down for all system it seems. I can't see anything odd on the logs. I have to run that shortcut whenever it starts derping again.
OP should try this. I've seen luke-jr recommend this (albeit on an issue which was a bit different) a couple times for similar problems. (Although OP seems to indicate that he has installed/uninstalled bitcoin core multiple times, so the issue might not be directly related to his Bitcoin Core software but rather... settings/hardware .. ?)

pereira4
Legendary
*
Offline Offline

Activity: 1610
Merit: 1183


View Profile
September 05, 2019, 10:38:49 PM
 #5

So it basically wants to re-download the whole chain after you shut it down and start again? Odd I have never observed that issue. Which OS are you exactly running?

Quote
I have problem with shutting down bitcoin core on linux platform for years with different bitcoin core versions Sad
Seems like OP is using Linux and i don't see any indication of OP telling, or by looking at the debug log that he needs to reindex or download the entire chain after booting up the wallet again. (Hard to tell when it's first ran anyway.

This has been happening to me for years too, tested on Windows nodes as well. The only workaround I've found is run a shortcut with this:

-reindex-chainstate

Remove the shortcun when completed. I think it may be related to RPC calls, a lot of people complained for years with problems related to crashes while shutting down and it's still not nailed down for all system it seems. I can't see anything odd on the logs. I have to run that shortcut whenever it starts derping again.
OP should try this. I've seen luke-jr recommend this (albeit on an issue which was a bit different) a couple times for similar problems. (Although OP seems to indicate that he has installed/uninstalled bitcoin core multiple times, so the issue might not be directly related to his Bitcoin Core software but rather... settings/hardware .. ?)

Right now im not sure if uninstalling Bitcoin Core typically in your "uninstall wizard" doesn't necessarily delete the files on the bitcoin folder. And if it does, I guess it not necessary, if keeps happening often then it must be an error involving faulty RAM, so scan your RAM for errors.
croxNN (OP)
Newbie
*
Offline Offline

Activity: 13
Merit: 3


View Profile
September 16, 2019, 08:29:16 AM
Merited by joniboini (2), AdolfinWolf (1)
 #6

UPD: Resolved!

Not know in details but problem with my local (ISP) DNS server. When I start bitcoind with local DNS - it fails to shutdown all time.
When I change DNS to 8.8.8.8 - and start bitcoind - shutdown works ideally!

Maybe my ISP blocks something etc. I just don't have time now to explore this question. Maybe later. For now I just changed to use 8.8.8.8 in my local net and problem gone!
JetHustle
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
September 16, 2019, 12:17:38 PM
 #7

UPD: Resolved!

Not know in details but problem with my local (ISP) DNS server. When I start bitcoind with local DNS - it fails to shutdown all time.
When I change DNS to 8.8.8.8 - and start bitcoind - shutdown works ideally!

Maybe my ISP blocks something etc. I just don't have time now to explore this question. Maybe later. For now I just changed to use 8.8.8.8 in my local net and problem gone!

Do you have a router? If so, can there be a problem in it?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3570
Merit: 6927


Just writing some code


View Profile WWW
September 16, 2019, 03:42:03 PM
 #8

This is very likely to be a bug in Bitcoin Core. There is already an open issue for this problem: https://github.com/bitcoin/bitcoin/issues/16778.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!