Bitcoin Forum
May 28, 2024, 02:53:50 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [SOLVED] Runaway bitcoind process keeps respawning after kill!  (Read 94 times)
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1610
Merit: 6813


bitcoincleanup.com / bitmixlist.org


View Profile WWW
September 13, 2022, 08:45:33 AM
Last edit: September 13, 2022, 12:16:10 PM by NotATether
 #1

Yesterday I upgraded my Ubuntu system to 22.04.1 LTS (from 20.04.5 LTS). In the process, I had to restart my PC, which brought out some problems that were previously hidden, so this must be one of them.

There is a v0.21.1 bitcoind process running from /usr/local/bin/bitcoind that is being spawned by systemd. I can't stop it through the corresponding bitcoin-cli binary because it says there's no connection at 127.0.0.1:8332. And if I try to SIGKILL the process, systemd just recreates it again. Seeing as some systemd unit must be responsible for this, I immediately combed my services folder and got rid of all the bitcoin-related services and then ran systemctl daemon-reload. Alarmingly, some are still listed in a call to systemctl list-units though as "not-found". I am trying to upgrade Bitcoin Core on Linux by overwriting the binaries but this problem precludes this from happening since it is earing up my load average.

Screenshot from a terminal:



Temporary workaround:

Send SIGSTOP to the parent bitcoind process. It will no longer process any data and your load average will go down, if you're fine with about 80MB residue in your RAM (maybe it can be offloaded to the otherwise useless swap space, I'm not sure). Rebooting will not help you in this case! It will just come back again.

Resolution:

You probably have bitcoin core running in a Docker container. Specifically, as part of a BTCPayServer installation. You should run btcpay-down and btcpay-clean scripts as I demonstrate here.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
LoyceV
Legendary
*
Offline Offline

Activity: 3318
Merit: 16733


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
September 13, 2022, 09:17:47 AM
 #2

My interpretation from stackexchange:
Does this help?
Code:
sudo update-rc.d bitcoind disable

NotATether (OP)
Legendary
*
Offline Offline

Activity: 1610
Merit: 6813


bitcoincleanup.com / bitmixlist.org


View Profile WWW
September 13, 2022, 09:56:52 AM
 #3

My interpretation from stackexchange:
Does this help?
Code:
sudo update-rc.d bitcoind disable

That doesn't seem to work, probably because I completely removed the service from systemd's config.

I managed to figure out that the process is owned by systemd-coredump uid and gid, so not systemd. I wonder what that is supposed to mean, Bitcoind is stuck in a crash loop?

FWIW, the last entry of my debug.log says <some other instance> has shut down long ago.

It's not responding to SIGSTOP either (This signal can't be blocked!)

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
LoyceV
Legendary
*
Offline Offline

Activity: 3318
Merit: 16733


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
September 13, 2022, 09:58:26 AM
 #4

Bitcoind is stuck in a crash loop?
Try to temporarily rename it?

NotATether (OP)
Legendary
*
Offline Offline

Activity: 1610
Merit: 6813


bitcoincleanup.com / bitmixlist.org


View Profile WWW
September 13, 2022, 10:03:47 AM
 #5

Bitcoind is stuck in a crash loop?
Try to temporarily rename it?

I just tried that and killed the process, but astoundingly, systemd-coredump spawned it again from the exact same (original) file name, supposedly non-existant. Huh

Maybe it's not bitcoin core related code, but something that generates a core dump...

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
LoyceV
Legendary
*
Offline Offline

Activity: 3318
Merit: 16733


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
September 13, 2022, 10:17:33 AM
Merited by ABCbits (1)
 #6

I just tried that and killed the process, but astoundingly, systemd-coredump spawned it again from the exact same (original) file name, supposedly non-existant. Huh
Linux allows files to be (re)moved while in use. They're not actually removed until the program that uses it lets go. I assume that's the case here too.
If you reboot (I know, such a Windows term), for sure it won't start the renamed bitcoind again.

NotATether (OP)
Legendary
*
Offline Offline

Activity: 1610
Merit: 6813


bitcoincleanup.com / bitmixlist.org


View Profile WWW
September 13, 2022, 10:24:00 AM
Last edit: September 13, 2022, 12:13:07 PM by NotATether
Merited by NeuroticFish (3)
 #7

I just tried that and killed the process, but astoundingly, systemd-coredump spawned it again from the exact same (original) file name, supposedly non-existant. Huh
Linux allows files to be (re)moved while in use. They're not actually removed until the program that uses it lets go. I assume that's the case here too.
If you reboot (I know, such a Windows term), for sure it won't start the renamed bitcoind again.

I'm trying to save rebooting as a last resort as it means I have to manually start up all my services and workspaces. Undecided

Update:

It appears to be caused by an Ubuntu service called Apport (this is a red herring, it's being driven entirely by a service ironically called "whoopsie"!) that must have been enabled while I was upgrading Ubuntu. https://wiki.ubuntu.com/Apport

How do I stop this service? systemctl stop/disable/mask apport don't seem to be working.



SOLVED.

That bitcoind instance was not running directly on my system, it was running in a docker container as part of a leftover and long-abandoned BTCPayServer installation. That's why killing it kept respawning the same process. So it actually had nothing to do with Apport or whoopsie.

Running sudo btcpay-down.sh followed by sudo btcpay-clean.sh did the trick. Saved me from an unnecessary reboot (BTW that probably would not have helped anyway, since BTCPayServer Docker containers autostart with the system).

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
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!