Author

Topic: [solved]bitcoin-qt shut down while downloading the blockchain (Read 299 times)

newbie
Activity: 20
Merit: 4
With my new kernel i have debugged the problem ;
Code:
due to memory pressure for /user.slice/user-1000.slice/[email protected] being 71.38% > 50.00% for > 20s with reclaim activity
Bitcoin-qt takes 12GB of RAM while downloading the blockchain.
hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange
~~~
When you wrote in your initial post that you're on Ubuntu 22.04.x (with x as unspecified), I'm wondering why you've been on such an old kernel like 5.15.0? (I'm not entirely convinced that this matters, because if kernel 5.15.0 supports your hardware well enough, it should run with it just fine.)

I usually accept Ubuntu kernel updates when they're offered by the Ubuntu update process. Never had an issue with it so far.


Now i'm full paranoid, i turn off all services and nothing happened since 33minutes, i believe it's a security issue. Embarrassed
i add a .htaccess file in the database directory, i'm mad but now 42minutes quiet.
Are you sure, you know what you're doing?? I'm not convinced when you place a .htaccess file and think this might  solve something or is appropriate at all. And your reasoning it could be a security issue is very likely flawed.

Of course, nobody here has an idea what services are running on your Ubuntu and what components you've installed. But... I clearly doubt that you know which services you can safely turn off or better shouldn't.


With my new kernel i have debugged the problem ;
Code:
due to memory pressure for /user.slice/user-1000.slice/[email protected] being 71.38% > 50.00% for > 20s with reclaim activity
Bitcoin-qt takes 12GB of RAM while downloading the blockchain.

Now we're coming to something more concrete.
Code:
journalctl --no-pager --since "2024-09-18 21:47" --until "2024-09-18 21:49"
sept. 18 21:47:01 localhost systemd-oomd[763]: Killed /user.slice/user-1000.slice/[email protected]/app.slice/app-org.gnome.Terminal.slice/vte-spawn-2b8e69c4-9a86-45f6-b1a5-90c523681b99.scope due to memory pressure for /user.slice/user-1000.slice/[email protected] being 71.38% > 50.00% for > 20s with reclaim activity
sept. 18 21:47:01 localhost systemd[8336]: vte-spawn-2b8e69c4-9a86-45f6-b1a5-90c523681b99.scope: systemd-oomd killed 25 process(es) in this unit.
sept. 18 21:47:01 localhost systemd[8336]: vte-spawn-2b8e69c4-9a86-45f6-b1a5-90c523681b99.scope: Consumed 28min 49.683s CPU time.
sept. 18 21:47:02 localhost  gnome-shell[8515]: Unhandled promise rejection. To suppress this warning, add an error handler to your promise chain with .catch() or a try-catch block around your await expression. Stack trace of the failed promise:
                                                 _registerItem/<@/usr/share/gnome-shell/extensions/[email protected]/statusNotifierWatcher.js:106:59
                                                 _emit@resource:///org/gnome/gjs/modules/core/_signals.js:114:47
                                                 _nameOwnerChanged@/usr/share/gnome-shell/extensions/[email protected]/appIndicator.js:162:14
                                                 Async*_emit@resource:///org/gnome/gjs/modules/core/_signals.js:114:47
                                                 AppIndicatorsNameWatcher/this._watcherId<@/usr/share/gnome-shell/extensions/[email protected]/util.js:212:22

If the OOM daemon has reasons to kick in (either by too high memory consumption pressure of some processes or when it's ill configuered; I doubt the latter, because unlikely you fiddled with it or it's default config is bad in the first place), it will just kill processes to reclaim memory and lower memory pressure. Likely your Bitcoin Core won't be spared...
The OOM daemon shouldn't need to slice through your processes!

Question is why your Bitcoin-Qt is allowed to grab that much memory, even when you have 16GB installed. It won't do it on it's own (my guess, as it doesn't seem likely to me, that memory demand of v27 branch has changed that drastically from v26 that I'm still on), there is likely an ill-configuered setting for Bitcoin Core OR other apps and stuff that runs on your Ubuntu needs too much at the same time.

My daily internet driver with Ubuntu has only 8GB RAM, a bitcoind with a watch-only wallet runs permanently in the background. I surf with Firefox and quite a bunch of tabs open. That's basically it. No visible issues with high memory pressure on my system and Bitcoin Core and Firefox run rock-solid.

Have a closer look at bitcoin.conf and settings.json in your ~/.bitcoin/ directory (not sure if Bitcoin-Qt stores settings somewhere else).
newbie
Activity: 20
Merit: 4
No i didn't but this nightmare is going to an end this hour.
I WIN! ; https://www.kohaku.fr/phpBB3/viewtopic.php?t=11
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Bitcoin-qt takes 12GB of RAM while downloading the blockchain.
Did you set dbcache to 12000?
newbie
Activity: 20
Merit: 4
Well i ask the technical support of ubuntu to see how can i repair this error.
https://forum.ubuntu-fr.org/viewtopic.php?pid=22786959#p22786959



Problem solved, i change of linux kernel
from 5.15.0-121 to
6.8.0-40
and now it works!



No it wasn't this  Huh



Now i'm full paranoid, i turn off all services and nothing happened since 33minutes, i believe it's a security issue. Embarrassed
i add a .htaccess file in the database directory, i'm mad but now 42minutes quiet.



With my new kernel i have debugged the problem ;
Code:
due to memory pressure for /user.slice/user-1000.slice/[email protected] being 71.38% > 50.00% for > 20s with reclaim activity
Bitcoin-qt takes 12GB of RAM while downloading the blockchain.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Here is my hardware (2 years old)
Great. Now do this:
Also (since this mostly an isolated case), consider a hardware issue, try stress-testing your machine's RAM, CPU, HDD.

i believe ubuntu is not clean and maybe have a backdoor.
That's quite an assumption. Either way, if you think your system is compromised, wipe it and start over.
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
Also (since this mostly an isolated case), consider a hardware issue, try stress-testing your machine's RAM, CPU, HDD.
This is not a hardware problem because i used to run bitcoin core since 2022, but after a mistake i lost all the db. The problem came when the timestamp of the txo start in april 2024.
Note that any version of the bitcoin core do the same error.
I can't see why this would eliminate the possibility of a hardware issue but have you done any stress testing?
That is to accurately deduce that from the possible issues.

Take note that at that timestamp, Bitcoin Core (v27.1 and below) should be doing all those heavy script verifications that it skipped in blocks older than 824000.
A hardware issue may not be noticeable when it's doing lighter process the early blocks but may show symptoms when it's near the tip.

And other than that, without logs from Bitcoin Core and your system, no one can give you any concrete answer to the cause of that crash.
newbie
Activity: 20
Merit: 4
i believe ubuntu is not clean and maybe have a backdoor.
i don't know how to catch the fault when bitcoind crash (which is not a snap)
in fact it's easy to upgrade bitcoin core, i just did it ;
Quote
tar xzf bitcoin-27.1-x86_64-linux-gnu.tar.gz
sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-27.1/bin/*
My mistake on the old db is to have run bitcoin-qt with 1 sudo, fatal error.
hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange
I run Ubuntu 22.04.5 LTS on a Lenovo Thinkpad T520 with 8GB RAM and a sort of ancient CPU Intel® Core™ i5-2520M. I'm still on Bitcoin Core v26.0.0 installed from binaries from bitcoincore.org, not from the Snap store. Storage is an internal 1TB SATA SSD.

I can report that my system and Core runs for days or weeks continuously. I reboot it only when a reboot is required after installation of certain updates that ask for a reboot. Of course I shutdown bitcoind gracefully before I reboot. Currently my Bitcoin Core started last time on August 22nd and from then on 24/7...

I didn't observe issues during IBD (which is years ago, so not comparable with OPs situation), nor if I have to rescan the blockchain when I fiddle around with some old or new wallets that I create for specific reasons. Of course my rock-solid experience is only for the version of Bitcoin Core that I run, but I doubt that v27.1.0 would behave less stable.

I will upgrade my Core on this machine soonish and can report back after a week or two of 24/7 runtime.


P.S.
I installed my Ubuntu from an official Ubuntu image downloaded from ubuntu.com, all software or images are checked via checksums and/or signatures.
newbie
Activity: 20
Merit: 4
Here is my hardware (2 years old), i put it on my board to not use your memory storage ;
https://www.kohaku.fr/phpBB3/viewtopic.php?t=9
Here is my software ;
https://www.kohaku.fr/phpBB3/viewforum.php?f=2
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
This is not a hardware problem because i used to run bitcoin core since 2022, but after a mistake i lost all the db. The problem came when the timestamp of the txo start in april 2024.
Note that any version of the bitcoin core do the same error.
Your logic to rule out hardware errors is flawed.
newbie
Activity: 20
Merit: 4

Talking about buffering, for UTXO set;
If you didn't set a custom dbbatchsize, it'll write from dbcache to datadir in 16MiB batches.
If your dbcache is high, you can experiment with higher size like dbbatchsize=1073741824 for 1GiB batches.
That interesting me because with every crash give up more than 200MiB lost, so can i ask to bitcoind to set dbcachesize explicitly?

Do you have any other settings in your bitcoin.conf file that can cause instability depending on the hardware?
e.g.: par, dbcache, dbbatchsize, etc. / your machine's specs.

Also (since this mostly an isolated case), consider a hardware issue, try stress-testing your machine's RAM, CPU, HDD.
This is not a hardware problem because i used to run bitcoin core since 2022, but after a mistake i lost all the db. The problem came when the timestamp of the txo start in april 2024.
Note that any version of the bitcoin core do the same error.
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
bitcoind crashed too after 217MiB downloaded and there is nothing mentioned in journalctl! So i'm going to install an older version of bitcoin core.

As stated by other member, check debug.log file which generated by Bitcoin Core. You can find that file on directory which store blockchain file. And unless you start bitcoind using SystemD service, AFAIK log produced by bitcoind wouldn't shown on journalctl.
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
I believe bitcoin-qt does a memory violation because it buffering the tx before saving it in datadir, so i bypass this by using bitcoind which save directly the blocks in datadir. Thank you for the tip.
There's no difference in Bitcoin-qt and bitcoind's internal working, Bitcoin-qt basically has bitcoind running in the background controlled with GUI elements.
The suggestions was based on the lingering issue of Bitcoin-qt freezing during heavy script verifications that may have been a flag for the system to kill it.

Talking about buffering, for UTXO set;
If you didn't set a custom dbbatchsize, it'll write from dbcache to datadir in 16MiB batches.
If your dbcache is high, you can experiment with higher size like dbbatchsize=1073741824 for 1GiB batches.

bitcoind crashed too after 217MiB downloaded and there is nothing mentioned in journalctl! So i'm going to install an older version of bitcoin core.
You probably deduced this already, but in that case, it has something to do with the normal IBD process, not just an issue with bitcoin-qt.
But since there's no logs provided, people can only do guesswork.

Do you have any other settings in your bitcoin.conf file that can cause instability depending on the hardware?
e.g.: par, dbcache, dbbatchsize, etc. / your machine's specs.

Also (since this mostly an isolated case), consider a hardware issue, try stress-testing your machine's RAM, CPU, HDD.
newbie
Activity: 20
Merit: 4
bitcoind crashed too after 217MiB downloaded and there is nothing mentioned in journalctl! So i'm going to install an older version of bitcoin core.
newbie
Activity: 20
Merit: 4
I believe bitcoin-qt does a memory violation because it buffering the tx before saving it in datadir, so i bypass this by using bitcoind which save directly the blocks in datadir. Thank you for the tip.
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
This doesn't explain me why bitcoin-qt crashed -snip-
May be related to Bitcoin-qt's lag during heavy script verifications and your system.

Can you check if your 'journal' has any log related to Bitcoin Core's crash?
Use the terminal and use the command: journalctl --since "date time" --until "date time" (date time in: YYYY-MM-DD HH:MM:SS format)
Set a good range to cover the date and time when Bitcoin Core crashed.

But bitcoind shouldn't be affected by the issue if it's caused by your system killing Bitcoin Core.
newbie
Activity: 20
Merit: 4

In bitcoin.conf:
Code:
onlynet=onion
proxy=127.0.0.1:9050

https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service
This doesn't explain me why bitcoin-qt crashed but it help very much for downloading the blockchain! Thank you sir.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Apparently, the disk usage of bitcoind is lighter than bitcoin-qt, i can see it directly on the disk led.
That only means it's doing less.
newbie
Activity: 20
Merit: 4
Apparently, the disk usage of bitcoind is lighter than bitcoin-qt, i can see it directly on the disk led.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Does bitcoind work as same as bitcoin-qt for download blockchain?
Yes, it's just that bitcoind gives you immediate logs in the console.

Quote
2024-09-15T14:17:37Z Socks5() connect to 2003:f7:570b:1f25:864b:2561:42ae:59d3:8333 failed: general failure
2024-09-15T14:17:52Z UpdateTip: new best=0000000000000000000082ba91a65ce28885b541dad95a60884fb95b3780a643 height=843465 version=0x21b98000 log2_work=94.923637 tx=1004840591 date='2024-05-14T19:34:04Z' progress=0.934651 cache=91.1MiB(755673txo)
No signals of an error in here, apart from failure to connect to a node. If the problem is that you cannot connect to any node (or that you rarely connect), try setting up a hidden service, because there may be problems with your IP. It had worked with me in the past.

In bitcoin.conf:
Code:
onlynet=onion
proxy=127.0.0.1:9050

https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service
newbie
Activity: 20
Merit: 4
the default progress without peers is only 0.02% per hour.
You can't have any progress without peers.

Well i run bitcoin-qt on a ssd disk so that is not the problem.
Share a bit more information: start with system specs and debug.log.

Quote
Does bitcoind work as same as bitcoin-qt for download blockchain?
Yes.
This is wrong the progress exist without peers but it's extremely slow.
So now i am trying to work with bitcoind and i will be back if it crashed too.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
the default progress without peers is only 0.02% per hour.
You can't have any progress without peers.

Well i run bitcoin-qt on a ssd disk so that is not the problem.
Share a bit more information: start with system specs and debug.log.

Quote
Does bitcoind work as same as bitcoin-qt for download blockchain?
Yes.
newbie
Activity: 20
Merit: 4
Well i run bitcoin-qt on a ssd disk so that is not the problem.
Does bitcoind work as same as bitcoin-qt for download blockchain?
here is a crash log ;
Quote
2024-09-15T14:17:37Z Socks5() connect to 2003:f7:570b:1f25:864b:2561:42ae:59d3:8333 failed: general failure
2024-09-15T14:17:52Z UpdateTip: new best=0000000000000000000082ba91a65ce28885b541dad95a60884fb95b3780a643 height=843465 version=0x21b98000 log2_work=94.923637 tx=1004840591 date='2024-05-14T19:34:04Z' progress=0.934651 cache=91.1MiB(755673txo)
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Why not continue in your earlier topic?
Start by responding to this:
So this is a tip : select your peers, it's very very important, you must disconnect who lock your downloading process
I've never had to manually block peers. It normally works fine on it's own.

Well i had to restart a new blockchain, but curiously when 2024arrive, the ratio of downloading fail under 0.02% per hour
I'm pretty sure this is just due to your Hard Drive being the bottleneck
Agreed. In 2024, Ordinal spam caused chainstate to grow fast. If you don't have enough RAM and use an SSD, this is going to be very slow. I (still) have my blocks directory on HDD, but chainstate has been on SSD for years. That makes a huge difference in download speed, while it doesn't take too much space on your SSD.
If you don't have an SSD: buy one Smiley

Chances are your hardware doesn't like what Bitcoin Core is demanding.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
  • Would be comfortable showing us the debug.log? This probably tells what the problem is.
  • Had your node synced until May 2024, and then it suddenly shut down? Did you maybe configure it and restart it at some point?
  • Have you tried running ./bitcoind instead of ./bitcoin-qt?
newbie
Activity: 20
Merit: 4
Hello,
I'm on ubuntu 22.04LTS and before i was on ubuntu 20.04LTS.
Bitcoin27.1.0 works bad, after half an hour it shut down while downloading the blockchain until may 2024.
So a human presence is needed, i must sleep you know, what can i do to let the software working by night?
This appears after a crash of my database, now i was late for 17 weeks and the default progress without peers is only 0.02% per hour.
thank you for your help.
Jump to: