Bitcoin Forum
June 22, 2021, 09:01:14 AM *
News: Latest Bitcoin Core release: 0.21.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Safe to restart Core after out of space crash?  (Read 123 times)
jnano
Member
**
Offline Offline

Activity: 303
Merit: 62


View Profile
June 09, 2021, 11:27:02 AM
Last edit: June 09, 2021, 02:45:44 PM by jnano
 #1

Bitcoin Core (0.18) crashed due to chainstate LevelDB hitting "not enough space".
Freeing up some space and restarting seemed to have worked without a hitch. I think not even a hint in the log file (after the restart, not the previous crash run).

Is it absolutely safe as far as data consistency is concerned, or is it better to continue from a backup?


Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
BitMaxz
Legendary
*
Offline Offline

Activity: 2198
Merit: 1636


Lock down again :(


View Profile
June 09, 2021, 12:15:40 PM
 #2

I just a little confused about your question what actually do you want to do with your wallet?

Do you want to fix the "Not enough space"? or are you planning to use your backup to export private keys and import them to another wallet?

If you want to fix the "not enough space" you will need an extra hard drive that can fit 350GB of blockchain you can just copy the whole bitcoin data to the new hard drive and change the properties of bitcoin core under target by adding this

Code:
-datadir=D:\BitcoinData

Just put it at the end with the right bitcoin data path from your new hard drive. Now it should safe to restart the bitcoin core after you apply this.

If you don't have an extra hard drive then your last hope is to backup and export the private keys and import them into Electrum(This is fast and easy).

jnano
Member
**
Offline Offline

Activity: 303
Merit: 62


View Profile
June 09, 2021, 02:31:58 PM
Last edit: June 09, 2021, 02:57:21 PM by jnano
 #3

I just want to continue using it normally. The backup, if needed, includes the chainstate and block data.

I fixed the out of space issue, restarted Core and let it continue catching up with the blockchain, and it seems to work.
The space issue affected only the chainstate, not the blocks (it runs in pruned mode).

But I do wonder if there may be some inconsistency in the chainstate or block data, despite the fact that it doesn't complain and everything seems to work fine.


By the way, I've had it crash twice due to disk space. The second time the GUI's error message complained about something else, maybe a block hash mismatch, but the log only mentioned LevelDB running out of space.
ranochigo
Legendary
*
Offline Offline

Activity: 2380
Merit: 2229

@ me if you need my response


View Profile
June 09, 2021, 03:55:00 PM
 #4

The space issue affected only the chainstate, not the blocks (it runs in pruned mode).

But I do wonder if there may be some inconsistency in the chainstate or block data, despite the fact that it doesn't complain and everything seems to work fine.


By the way, I've had it crash twice due to disk space. The second time the GUI's error message complained about something else, maybe a block hash mismatch, but the log only mentioned LevelDB running out of space.
The last time I checked, Bitcoin Core shuts down gracefully upon running out of disk space so not really a lot of concern for any corruption there. Even if there is, it wouldn't be a big issue, just replace your data.

The leveldb should have CRC32 checksum for the records and would throw an error upon a mismatch.

jnano
Member
**
Offline Offline

Activity: 303
Merit: 62


View Profile
June 09, 2021, 05:15:06 PM
 #5

It crashed with apparent C++ exceptions, though maybe with some cleanup afterwards.
LevelDB might keep the records valid, but what about Bitcoin-level consistency?

The logged error messages are (summarized, some lines were repeated):

Code:
Fatal LevelDB error: IO error: Win32WriteableFile.Append::WriteFile: (...*.ldb): There is not enough space on the disk.
*** System error while flushing: (...)
Error: Error: A fatal internal error occurred, see debug.log for details.
You can use -debug=leveldb to get more complete diagnostic messages
FlushStateToDisk: failed to flush state (...)
 (code 0))
[...] Releasing wallet
shutdown: done

The second crash had less lines, less repetitions, and one new line:
Code:
ERROR: ProcessNewBlock: ActivateBestChain failed (System error while flushing ...)

Although it did follow the above with some thread exit messages, there was no "Releasing wallet" message, but maybe I copied the log file before it fully flushed.

FWIW, later, after it finished syncing the blockchain, I tried a restart and it did not complain about anything.

NotATether
Hero Member
*****
Online Online

Activity: 560
Merit: 1610


Cryptographic Crawler


View Profile WWW
June 09, 2021, 08:51:54 PM
 #6

It crashed with apparent C++ exceptions, though maybe with some cleanup afterwards.
LevelDB might keep the records valid, but what about Bitcoin-level consistency?

Usually, during an out-of-space crash, only one block or chainstate file gets corrupted by the DB engine not being able to finish writing data to it. Deleting any of those files isn't fatal, it's not like it destroys wallets or anything. It should just re-fetch that information, particularly if you use -reindex.

jnano
Member
**
Offline Offline

Activity: 303
Merit: 62


View Profile
June 09, 2021, 11:01:50 PM
 #7

I didn't run with any special commands, and can't run a full reindex because it's pruned mode. But if it's localized to one or two files, and Core can detect it, then I guess no harm done and the usual startup rewind-rescan can handle it.

BTW, I never understood how chainstate is stored, but it seems every run touches practically all chainstate files, based on file modification times.

ranochigo
Legendary
*
Offline Offline

Activity: 2380
Merit: 2229

@ me if you need my response


View Profile
June 10, 2021, 05:28:00 AM
 #8

BTW, I never understood how chainstate is stored, but it seems every run touches practically all chainstate files, based on file modification times.
Looks alright to me. During startup, Core checks the last X blocks for inconsistencies. Specifically, the debug.log prints that they've checked the last X blocks for coin database inconsistencies.

I don't think it does a full check of the entire chainstate, as it'll take too much time. Do CMIIW.

jnano
Member
**
Offline Offline

Activity: 303
Merit: 62


View Profile
June 10, 2021, 08:03:07 PM
 #9

Looks alright to me.
I didn't mean to imply that's abnormal.

Maybe if the whole chainstate is rewritten there's opportunity (not that I know that it does that) to check for complete consistency, or at least no data corruption.

Anyway, I'm going to leave it be. The wallet state is as I expect it to be, and it seems to work. A pre-crash wallet backup should suffice. Worst case I'd have to do a fresh IBD from scratch, which would be a pain, but doable.

It would be more reassuring if, when restarting post-crash, Core would explicitly indicate that it's aware of the previous crash and that it checked or recovered successfully. I don't know, maybe it already does that in newer versions (considering I'm on 0.18).

DaveF
Legendary
*
Offline Offline

Activity: 2422
Merit: 1844


I DO NOT TRADE on Telegram or Skype or Discord.


View Profile WWW
June 10, 2021, 11:35:37 PM
 #10

It you are really out of space, as in 0 bytes free then there is no way to write the error in the log file.
So, all it knows that there was not a clean shutdown does not know why.
Either way get off of 0.18 and onto something newer.
Any reason why you are still running such an old version?

-Dave

███████████████████████████
█████████▀▄▄▄▄▄██▀▀████████
█████▀▄█▀▀▄▄▄▄▄▄▄▀▀▄▄▀█████
████ █▀▄███████████▄▀██████
███▄█ ███████▀ ██████ █ ███
██▀█ ███  ▀▀█  ▀██████ █ ██
██ █ ████▄▄      ▀▀▀██ █ ██
██ █ █████▌        ▄██ ████
███▄█ █████▄▄   ▄▄███ █▀███
████▀█▄▀█████▌  ▀██▀▄█ ████
█████▄▀▀▄▄▀▀▀▀   ▄▄█▀▄█████
████████▄██▀▀▀▀▀▀██████████
███████████████████████████
      ██▄▄█▄▄██ █▄  ▄▄
      █████████
      ▐███████████▌
     ▄█
██████████████
     ▄▄▄▄
█▀▄▄▄▄  ▄▄▄
    ▄
▀▀▀ ▄█████▀ ▄██▀
██
  ▄
███▄▄▀▀▀▀███▀▀▀▄▄███
  ▄
██████████████████
   ███▄▄          ▄▄███
  ▄
██████████████████████▄
▄█
███
██████████████████▀▀▀▀
 ▀▀▀ ▀▀▀
██████████▀▀▀▀▀
▄▄███████████████████████▄▄
SUPER ROO'S $100,000 RESCUE
        ►   JOIN THE RAFFLE NOW!                   

▄▄███████▄▄
▄█████▀█▀█████▄
████▀▀▀ ▀ ▀▀█████
███████  ██  ▐█████
███████      ▀█████
███████  ███  █████
████▄▄▄   ▄▄▄████
▀█████▄█▄█████▀
▀▀███████▀▀

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

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

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

▄▄███████▄▄
▄█████████████▄
███████▌ ▐███████
████████  █████████
█████▀▀   ▄▄███████
███████  ██████████
█████▌      ▄████
▀█████████████▀
▀▀███████▀▀

▄▄▄▄▄▄▄
▀▀███████▀▀
.
BITCOIN
ETHEREUM
LITECOIN
..PLAY NOW..
jnano
Member
**
Offline Offline

Activity: 303
Merit: 62


View Profile
June 11, 2021, 11:10:14 AM
 #11

The chainstate directory here is separate from where the log is.

I will update eventually, maybe when v22 is out. It's just that so far there weren't any improvements that are obviously useful to me, and I'm usually going for "leave it be if it's not broken".
HCP
Legendary
*
Offline Offline

Activity: 1722
Merit: 3609

<insert witty quote here>


View Profile
June 11, 2021, 11:13:41 PM
 #12

If you've corrected the space issue... then continuing to run afterwards should be perfectly fine. Unless you are continuing to get errors when you are starting/running your node, then I wouldn't worry about it.


I will update eventually, maybe when v22 is out. It's just that so far there weren't any improvements that are obviously useful to me, and I'm usually going for "leave it be if it's not broken".
You're not wrong. Sometimes not upgrading is the smart play... if there are not any critical vulnerabilities that have been identified and fixed, the "if it ain't broke, don't fix it" strategy can often be the best course of action Wink

DaveF
Legendary
*
Offline Offline

Activity: 2422
Merit: 1844


I DO NOT TRADE on Telegram or Skype or Discord.


View Profile WWW
June 11, 2021, 11:49:15 PM
 #13

Odd that there was nothing in the log then.
And this is just me saying it, 0.20 removed OpenSSL and it's issues. Probably not that important if you are just running a desktop wallet for your own stuff. But it's something to think about.

Enjoy the weekend.

-Dave

███████████████████████████
█████████▀▄▄▄▄▄██▀▀████████
█████▀▄█▀▀▄▄▄▄▄▄▄▀▀▄▄▀█████
████ █▀▄███████████▄▀██████
███▄█ ███████▀ ██████ █ ███
██▀█ ███  ▀▀█  ▀██████ █ ██
██ █ ████▄▄      ▀▀▀██ █ ██
██ █ █████▌        ▄██ ████
███▄█ █████▄▄   ▄▄███ █▀███
████▀█▄▀█████▌  ▀██▀▄█ ████
█████▄▀▀▄▄▀▀▀▀   ▄▄█▀▄█████
████████▄██▀▀▀▀▀▀██████████
███████████████████████████
      ██▄▄█▄▄██ █▄  ▄▄
      █████████
      ▐███████████▌
     ▄█
██████████████
     ▄▄▄▄
█▀▄▄▄▄  ▄▄▄
    ▄
▀▀▀ ▄█████▀ ▄██▀
██
  ▄
███▄▄▀▀▀▀███▀▀▀▄▄███
  ▄
██████████████████
   ███▄▄          ▄▄███
  ▄
██████████████████████▄
▄█
███
██████████████████▀▀▀▀
 ▀▀▀ ▀▀▀
██████████▀▀▀▀▀
▄▄███████████████████████▄▄
SUPER ROO'S $100,000 RESCUE
        ►   JOIN THE RAFFLE NOW!                   

▄▄███████▄▄
▄█████▀█▀█████▄
████▀▀▀ ▀ ▀▀█████
███████  ██  ▐█████
███████      ▀█████
███████  ███  █████
████▄▄▄   ▄▄▄████
▀█████▄█▄█████▀
▀▀███████▀▀

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

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

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

▄▄███████▄▄
▄█████████████▄
███████▌ ▐███████
████████  █████████
█████▀▀   ▄▄███████
███████  ██████████
█████▌      ▄████
▀█████████████▀
▀▀███████▀▀

▄▄▄▄▄▄▄
▀▀███████▀▀
.
BITCOIN
ETHEREUM
LITECOIN
..PLAY 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!