Bitcoin Forum
May 03, 2024, 04:45:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Blockchain corruption during power loss?  (Read 2333 times)
mustyoshi (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile
July 02, 2013, 03:55:58 PM
 #1

I lost power the other day while my bitcoind was running, and I went to start it again and it was unable to read the blocks. I'm currently in the process of redownloading the blockchain.

Has anybody else had this issue?
1714754707
Hero Member
*
Offline Offline

Posts: 1714754707

View Profile Personal Message (Offline)

Ignore
1714754707
Reply with quote  #2

1714754707
Report to moderator
1714754707
Hero Member
*
Offline Offline

Posts: 1714754707

View Profile Personal Message (Offline)

Ignore
1714754707
Reply with quote  #2

1714754707
Report to moderator
Remember that Bitcoin is still beta software. Don't put all of your money into BTC!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714754707
Hero Member
*
Offline Offline

Posts: 1714754707

View Profile Personal Message (Offline)

Ignore
1714754707
Reply with quote  #2

1714754707
Report to moderator
Trader Steve
Hero Member
*****
Offline Offline

Activity: 836
Merit: 1007


"How do you eat an elephant? One bit at a time..."


View Profile
July 02, 2013, 04:03:53 PM
 #2

How ironic, I just had the same problem. I had to remove the program and the associated files and then reinstall the entire program. Fortunately, I keep several backups of the wallet.dat file. Now, my computer has been running non-stop for the last 7 hours updating the blockchain - only 16,000 blocks to go!

mustyoshi (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile
July 02, 2013, 04:06:47 PM
 #3

How ironic, I just had the same problem. I had to remove the program and the associated files and then reinstall the entire program. Fortunately, I keep several backups of the wallet.dat file. Now, my computer has been running non-stop for the last 7 hours updating the blockchain - only 16,000 blocks to go!


Oh good, I was afraid it was cause of the modifications I made to my bitcoind that scan transactions for specific addresses and keep metrics on them. But since you also had the same issue I have ruled that out, thanks.

I should probably start backing up my blockchain at regular intervals to prevent this from happening again.
elasticband
Legendary
*
Offline Offline

Activity: 1036
Merit: 1000


Nighty Night Don't Let The Trolls Bite Nom Nom Nom


View Profile
July 02, 2013, 04:08:24 PM
 #4

i had this also during a power outage... only took an hour or so to reindex the blocks htough
mustyoshi (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile
July 02, 2013, 04:09:30 PM
 #5

i had this also during a power outage... only took an hour or so to reindex the blocks htough
wait what

you mean I didn't have to delete everything?
elasticband
Legendary
*
Offline Offline

Activity: 1036
Merit: 1000


Nighty Night Don't Let The Trolls Bite Nom Nom Nom


View Profile
July 02, 2013, 04:12:16 PM
 #6

nope.... I just restarted the client, then is had an error and said it needed to reindex the blocks(i imagine the blockchain stored on my computer), then about an hour later it was done, probably not even an hour...... i set it to low priority
mustyoshi (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile
July 02, 2013, 04:25:00 PM
 #7

nope.... I just restarted the client, then is had an error and said it needed to reindex the blocks(i imagine the blockchain stored on my computer), then about an hour later it was done, probably not even an hour...... i set it to low priority
Hmm, well I'm almost certain it didn't say anything about indexing the blocks, it was more could not read the block. So at first I tried deleting all the lock files and it still didn't work.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1024



View Profile
July 03, 2013, 10:57:23 AM
 #8

Buy a UPS.

Clever programming simply cannot prevent corruption during a power loss.  The filesystem guys have been working on the problem for like 50 years, and they all agree that you need to buy a UPS.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1083


View Profile
July 03, 2013, 11:49:42 AM
 #9

Clever programming simply cannot prevent corruption during a power loss. 

Atomic file operations would ensure that the disk is always in a valid state.  However, it doesn't seem to be a high priority for OS designers.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
davout
Legendary
*
Offline Offline

Activity: 1372
Merit: 1007


1davout


View Profile WWW
July 03, 2013, 11:52:29 AM
 #10

Are you guys running OSX ?

Mysticsam_3579
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
July 06, 2013, 02:30:49 PM
 #11

Clever programming simply cannot prevent corruption during a power loss. 

Atomic file operations would ensure that the disk is always in a valid state.  However, it doesn't seem to be a high priority for OS designers.

It is solved. The answer is: ZFS
Here is a link: http://en.wikipedia.org/wiki/ZFS
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
July 07, 2013, 01:47:21 AM
 #12

just make a backup of your chain, once for awhile.
or download the chain from some torrents, if you hadn't.
otherwise it takes ages to recover from such a lose Smiley

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4158
Merit: 8382



View Profile WWW
July 07, 2013, 04:13:32 PM
 #13

Can you please disclose what OS, OS version, and Bitcoin version you're running?

I've tried to reproduce unclean shutdown corruption and in hundreds of shutdowns in Linux been unable to do so.

Contrary to what KJJ claims— it is actually not supposed to do this, and at least on some systems it does not appear to (or at least does so with only negligible probability).  I suspect that leveldb has some bugs on some systems/enviroments which degrades its durability, but with basically nothing to go on its hard to determine why.

We absolutely _must_ get this fixed— or at least reduced to negligible probability for all users— before we can support pruning.
malevolent
can into space
Legendary
*
Offline Offline

Activity: 3472
Merit: 1721



View Profile
July 07, 2013, 06:58:59 PM
 #14

Can you please disclose what OS, OS version, and Bitcoin version you're running?

This also happened to me once on Win7 64, but that was 2 years ago with 0.3-something.

Signature space available for rent.
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
July 07, 2013, 07:51:04 PM
 #15

I once gave you a snapshot of a naturally corrupt testnet3 DB, that the official client wasn't able to continue with... and you didn't even bother do download it, did you?
And now you suddenly care... Smiley

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
davout
Legendary
*
Offline Offline

Activity: 1372
Merit: 1007


1davout


View Profile WWW
July 07, 2013, 10:24:31 PM
 #16

Can you please disclose what OS, OS version, and Bitcoin version you're running?

Discussed this with you a few weeks ago.
Happens to me every single time OSX ML fails to come back up from suspend.
Pretty much the only reason why I stopped running a node.

kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1024



View Profile
July 08, 2013, 03:01:07 AM
 #17

Contrary to what KJJ claims— it is actually not supposed to do this

Heh.  I never said that it was supposed to happen.  I was just pointing out the workaround used all around the world by people with unreliable power.

Maybe we should make a sticky at the top for bug reporting best practices.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1091


View Profile
July 08, 2013, 05:57:48 AM
 #18

Can you please disclose what OS, OS version, and Bitcoin version you're running?

Discussed this with you a few weeks ago.
Happens to me every single time OSX ML fails to come back up from suspend.
Pretty much the only reason why I stopped running a node.

What is an OSX ML?


Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
davout
Legendary
*
Offline Offline

Activity: 1372
Merit: 1007


1davout


View Profile WWW
July 08, 2013, 07:05:48 AM
 #19

What is an OSX ML?

This.

Mike Hearn
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1129


View Profile
July 08, 2013, 10:32:57 AM
 #20

I also encountered a corrupt LevelDB and it also appeared to be a suspend related issue. My guess - power management on modern Macs is buggy and is likely to cause the file system to lose its integrity in some way. The fact that Mac's do sometimes just die and refuse to unsuspend strongly suggests the presence of fatal errors in their implementation. Recent OS X versions are sloppy in other ways - when the laptop lid is opened and the unsuspend process begins, the first thing it does is display a screenshot of the password entry screen! Of course it's not actually usable for many seconds so any keypresses you make get thrown away. This kind of duplicitous nonsense is classic Apple. Now think - if your power management engineering team is the kind that'd make such a decision, do you trust them to get the details 100% right? I wouldn't.

All that said running nodes on systems that come and go all the time is hardly helping the network and most users will get tired of it sucking up battery and other resources. I can't see running full nodes on laptops being popular in the long run. So fixing this doesn't seem to be very important to me, certainly it shouldn't be seen as blocking pruning. If it's robust on Linux servers, that's the most important thing.

Pages: [1] 2 »  All
  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!