Bitcoin Forum
April 02, 2026, 04:29:19 PM *
News: Latest Bitcoin Core release: 30.2 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Persistent "Error reading from database, shutting down." after many attempts  (Read 117 times)
alwynkrupp (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 7


View Profile
February 07, 2025, 03:14:45 AM
Merited by LoyceV (6), ABCbits (1)
 #1

Hi.

After about 1-2 months of not using bitcoin core in my Ubuntu 20.04 machine, I relaunched it using bitcoin-qt in the terminal as I always do.

It began synchronizing until it gave me this "Error reading from database, shutting down." error.

So I tried re-synching as I saw suggested in several references online, most of them are from about 5 years ago. After about 7 hours, the same error popped and had to shut it down again.
I tried one more time which isn't very practical since each time it takes many hours until it stumbles upon the same error when I'm not even looking.

So I didn't care if I had to wait to download it again. I deleted the blockchain and had it download it again. Same error after perhaps 9 hours.

I deleted, uninstalled bitcoin core 25.0 which I had previously gotten from bitcoin.org, and tried installing it again. When I reinstalled, It didn't prompt what drive I wanted to download the blockchain to, it just assumed the previous one like I never uninstalled it.

This is a 1TB Samsung drive, the famed samsung SSDs that are reputable as the best make. I bought it only to store blockchains.

So I ran it again after reinstalled and after many hours I got the same error again. Each time it would be at a different block; running Core again will give me the same error at the same block, except for when I re-download the blockchain again, then it fails at a different one and stays on it.

So I tried deleting that particular block, and ran it again. After several hours, got the same error this time at a different block.

This entire debugging process as you can see has been taking days, days me trying to fix.

I downloaded the new version at bitcoin.org, 27.0, and installed that one. Again it didn't launch as when I first installed it, it assumed everything as the previous 25.0 installation was configured. Which is strange because nothing in my computer that says "bitcoin", no file at all, is left each time I uninstall it again.

Of course, I tried again with 27.0 and it did the same thing.

I tested my hard drive and apparently it is healthy.

I just want to get over this I need to use it. I don't even understand why each installation doesn't seem to be fresh. I haven't been able to find any references online to any of its behaviours.

The console says:
Code:
"Corruption: block checksum mismatch: [some block file]
Error: Error reading from database, shutting down."

That's the recurrent error of the nightmare.

I hope you have great insights as to why this keeps happening. I also would like to know if there's a more efficient way of safely downloading the blockchain, maybe torrent, and then have it indexed by Bitcoin Core or something. I just don't know what is actually legit. The references I found are from last year which sound like going through the hassle again for it to jump at me with the same error anyway.

Thank you.
nc50lc
Legendary
*
Offline Offline

Activity: 3108
Merit: 8540


Self-proclaimed Genius


View Profile
February 07, 2025, 03:54:08 AM
Merited by LoyceV (6), ABCbits (1)
 #2

So I tried re-synching as I saw suggested in several references online, most of them are from about 5 years ago. After about 7 hours, the same error popped and had to shut it down again.
I tried one more time which isn't very practical since each time it takes many hours until it stumbles upon the same error when I'm not even looking.

So I didn't care if I had to wait to download it again. I deleted the blockchain and had it download it again. Same error after perhaps 9 hours.

So I ran it again after reinstalled and after many hours I got the same error again. Each time it would be at a different block; running Core again will give me the same error at the same block, except for when I re-download the blockchain again, then it fails at a different one and stays on it.
-snip-
I tested my hard drive and apparently it is healthy.
Try to replace the HDD's sATA cable or switch to the other ports.
Then try IBD again.

If it still produced a random corrupted block or other data, check for other hardware issues specially the RAM and others.

BTW, you should consider checking the "debug.log" in each of your attempts, you can find it inside your bitcoin data directory.
Open it as text, then check for the related error(s), usually such issue has the error in the last few lines.

Quote from: alwynkrupp
I just want to get over this I need to use it. I don't even understand why each installation doesn't seem to be fresh. I haven't been able to find any references online to any of its behaviours.
Check if you have a data directory in the default location: https://en.bitcoin.it/wiki/Data_directory#Default_Location
In Windows, v28 may use the local appdata instead of roaming if it can't find one in the previous default.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
alwynkrupp (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 7


View Profile
February 07, 2025, 06:34:19 AM
 #3

Hi, thanks for the reply. I opened a new sata cable and also changed the port of the drive again, this time the error showed up really fast. Now when running again, the error is the first thing it does which used not to happen. I had already checked the debug.log which is the same I get printed on the terminal:

Code:
2025-02-07T06:21:42Z LevelDB read failure: Corruption: block checksum mismatch: /media/bhost/chainstate/095399.ldb
2025-02-07T06:21:42Z Fatal LevelDB error: Corruption: block checksum mismatch: /media/bhost/chainstate/095399.ldb
2025-02-07T06:21:42Z You can use -debug=leveldb to get more complete diagnostic messages
2025-02-07T06:21:42Z Error: Error reading from database, shutting down.
2025-02-07T06:21:55Z Error reading from database: Fatal LevelDB error: Corruption: block checksum mismatch: /media/bhost/chainstate/095399.ldb

It doesn't really lead me much.

Quote from: nc50lc
If it still produced a random corrupted block or other data, check for other hardware issues specially the RAM and others.

How would you check for other hardware or what hardware? I just don't know how other factors could cause an error. Mistral suggested the time of my computer may mismatch or something but what it suggested to fix it seemed like it would break new things since it was pretty manual.

My last resort would be to just try a new drive which would be very disappointing of this one even if the tests came out good.

Regarding on other ways of downloading the blockchain that could help pinpoint the issue, do you know any?

Thanks.
nc50lc
Legendary
*
Offline Offline

Activity: 3108
Merit: 8540


Self-proclaimed Genius


View Profile
February 07, 2025, 07:22:48 AM
 #4

I had already checked the debug.log which is the same I get printed on the terminal:

Code:
2025-02-07T06:21:55Z Error reading from database: Fatal LevelDB error: Corruption: block checksum mismatch: /media/bhost/chainstate/095399.ldb

It doesn't really lead me much.
Fair enough, this can only tell if the corrupted file is persistent or not which could roughly tell if it's caused by the software or hardware.
In any case, that indicates that you can just use --reindex-chainstate rather than full IBD which saves you a lot of testing time and internet bandwidth.
That is considering that there's no other errors in the logs.

Quote from: alwynkrupp
How would you check for other hardware or what hardware?
Depends on the OS, usually most of those have a tool that can check for RAM integrity.
For the processor, you may need a complete hardware tester or something dedicated to CPU, search for a full hardware tester.

Quote from: alwynkrupp
My last resort would be to just try a new drive which would be very disappointing of this one even if the tests came out good.
Yeah, most of the time, that kind of error is disk-related.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits PREDICT..
█████████████████████████
█████████████████████████
███████████▀▀░░░░▀▀██████
██████████░░▄████▄░░████
█████████░░████████░░████
█████████░░████████░░████
█████████▄▀██████▀▄████
████████▀▀░░░▀▀▀▀░░▄█████
██████▀░░░░██▄▄▄▄████████
████▀░░░░▄███████████████
█████▄▄█████████████████
█████████████████████████
█████████████████████████
.
.WHERE EVERYTHING IS A MARKET..
█████
██
██







██
██
██████
Will Bitcoin hit $200,000
before January 1st 2027?

    No @1.15         Yes @6.00    
█████
██
██







██
██
██████

  CHECK MORE > 
LoyceV
Legendary
*
Offline Offline

Activity: 4004
Merit: 21519


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
February 07, 2025, 08:30:20 AM
 #5

My last resort would be to just try a new drive which would be very disappointing of this one even if the tests came out good.
Have you checked the drive's Smart data? It sounds like it's failing.

When you first start Bitcoin Core, it gives this warning:
Quote
The initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed.

How's your CPU temperature? No dust in the fan?

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
mcdouglasx
Hero Member
*****
Offline Offline

Activity: 952
Merit: 532



View Profile WWW
February 07, 2025, 03:18:37 PM
Last edit: February 07, 2025, 04:05:49 PM by mcdouglasx
 #6

Hi, thanks for the reply. I opened a new sata cable and also changed the port of the drive again, this time the error showed up really fast. Now when running again, the error is the first thing it does which used not to happen. I had already checked the debug.log which is the same I get printed on the terminal:

Code:
2025-02-07T06:21:42Z LevelDB read failure: Corruption: block checksum mismatch: /media/bhost/chainstate/095399.ldb
2025-02-07T06:21:42Z Fatal LevelDB error: Corruption: block checksum mismatch: /media/bhost/chainstate/095399.ldb
2025-02-07T06:21:42Z You can use -debug=leveldb to get more complete diagnostic messages
2025-02-07T06:21:42Z Error: Error reading from database, shutting down.
2025-02-07T06:21:55Z Error reading from database: Fatal LevelDB error: Corruption: block checksum mismatch: /media/bhost/chainstate/095399.ldb

It doesn't really lead me much.

I would follow these steps:
Before formatting, make backups of the wallets if necessary.

1-Format the SSD drive.

2.Reinstall Ubuntu from scratch, to prevent problems in the operating system.

3-Reinstall Core.

If the problem persists, try testing with each RAM individually.

LoyceV
Legendary
*
Offline Offline

Activity: 4004
Merit: 21519


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
February 07, 2025, 03:43:56 PM
Merited by mcdouglasx (1)
 #7

2-Create a 100GB partition and leave it unused so that the defective sector is not used (defective sectors in an SSD are areas of the memory that have been damaged and cannot store data correctly). Hopefully, we will ignore those sectors.
That's pointless because of SSD wear leveling. If the disk is bad, replace it.

¡uʍop ǝpᴉsdn pɐǝɥ ɹnoʎ ɥʇᴉʍ ʎuunɟ ʞool no⅄
mcdouglasx
Hero Member
*****
Offline Offline

Activity: 952
Merit: 532



View Profile WWW
February 07, 2025, 04:04:57 PM
 #8

2-Create a 100GB partition and leave it unused so that the defective sector is not used (defective sectors in an SSD are areas of the memory that have been damaged and cannot store data correctly). Hopefully, we will ignore those sectors.
That's pointless because of SSD wear leveling. If the disk is bad, replace it.

You're right, my bad, I didn't take into account that ssd operate a bit differently from traditional hard drives and manage defective sectors internally through their firmware. But performing a clean installation is still a good starting point before considering changing a component.
philipma1957
Legendary
*
Offline Offline

Activity: 4816
Merit: 11704


'The right to privacy matters'


View Profile WWW
February 07, 2025, 11:21:24 PM
 #9

first off you should have a 2tb ssd not a 1 tb.

Samsung are good but what one ?

lastly you should clone your new drive.

I am using Samsung 990 evo plus 4tb

or Samsung 990 evo plus 2tb

ssd's

https://www.amazon.com/SAMSUNG-Technology-Intelligent-Turbowrite-MZ-V9S2T0B/dp/B0DHLCRF91/ref=sr_1_1?

2tb 990 evo plus is pretty good. and not costly

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
████████████████████████████████▀
██████████████████████████████▀██▄█
████████████████████████████▀██████
█████████████████████████▀█████████
██████████████████████▀████████████
█▄██▀▀█████████████▀███████▄▄▄█████
███▄████▀▀██████▀▀█████▄▄▀▀▀███████
█████▄▄█████▀▀█▀██████████▄████████
████████▀▀███▄███████████▄█████████
█████████▄██▀▀▀▀███▀▀██████████████
███████████▄▄█▀████▄███████████████
███████████████▄▄██████████████████

 AltairTech.io    Miners  Parts 🖰 Accessories 
_______Based in Missouri, USA._________________Your One-Stop Shop for Bitcoin Mining Solutions_____________________Mining Farm Consulting__________
.
.🛒SHOP NOW .
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!