Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Jay_Pal on April 25, 2018, 09:33:39 PM



Title: Rewinding blocks every time I start bitcoin-qt
Post by: Jay_Pal on April 25, 2018, 09:33:39 PM
Bitcoin Client Software and Version Number: Bitcoin Core 0.16.0.0-g4b4d7eb255
Operating System: Ubuntu 17.10
System Hardware Specs: AMD Athlon 2, 8GB ram - 5gb pruned database.
Description of Problem: Every time I start bitcoin-qt I get a "Rewinding blocks" message that lasts for hours before start syncing again.
It used to be fine but some weeks ago it started behaving this way.
After letting it rewind, everything is fine until I shut it down.

Thank you all for your help.


Title: Re: Rewinding blocks every time I start bitcoin-qt
Post by: achow101 on April 25, 2018, 09:43:46 PM
Post your debug.log file.

Rewinding some blocks is always part of the startup sanity check, that is normal behavior. However it should not take very long.


Title: Re: Rewinding blocks every time I start bitcoin-qt
Post by: RGBKey on April 26, 2018, 04:58:17 AM
If I were you I would be paranoid and run a disk check for bad sectors. I'm not totally sure but if my block database started acting funky I'd be concerned.


Title: Re: Rewinding blocks every time I start bitcoin-qt
Post by: Jay_Pal on April 26, 2018, 10:07:55 PM
Post your debug.log file.

I will as soon as I'm able too. Tonight I am a little pressed for time.

Rewinding some blocks is always part of the startup sanity check, that is normal behavior. However it should not take very long.

I know it is but it never did this every single time I started the client...

Thanks!


Title: Re: Rewinding blocks every time I start bitcoin-qt
Post by: jackg on April 26, 2018, 10:16:37 PM
If I were you I would be paranoid and run a disk check for bad sectors. I'm not totally sure but if my block database started acting funky I'd be concerned.

I'd also question how old the hard drive is OP in your machine, can you also try defragmenting it as well as what RGB suggests?

Description of Problem: Every time I start bitcoin-qt I get a "Rewinding blocks" message that lasts for hours before start syncing again.
It used to be fine but some weeks ago it started behaving this way.
After letting it rewind, everything is fine until I shut it down.
When you shut it down, do you wait for the window to close before shutting down. E.G, do you do a forceful shutdown or do you allow it to shut down on it's own before turning off your computer.


The debug.log as achow says will be very helpful here, it'll be in the ~/.Bitcoin folder (if you use default settings).


Title: Re: Rewinding blocks every time I start bitcoin-qt
Post by: Jay_Pal on April 27, 2018, 10:34:28 PM
Sorry for the delay posting but I was pressed for time since I had to go to sleep as today I had to wake early for work.
I appreciate all your help.

When you shut it down, do you wait for the window to close before shutting down. E.G, do you do a forceful shutdown or do you allow it to shut down on it's own before turning off your computer.

I usually let it shutdown correctly except in this last one where I was once again pressed for time and fed up for the nth time it rewinded blocks... so I killed the thread... :/

As for the debug fie (10MB!!!), here it is: https://www.dropbox.com/s/p03omkvwt3oqjhi/debug.log?dl=0

Thank you once again!


Title: Re: Rewinding blocks every time I start bitcoin-qt
Post by: RGBKey on April 27, 2018, 11:27:48 PM
Sorry for the delay posting but I was pressed for time since I had to go to sleep as today I had to wake early for work.
I appreciate all your help.

When you shut it down, do you wait for the window to close before shutting down. E.G, do you do a forceful shutdown or do you allow it to shut down on it's own before turning off your computer.

I usually let it shutdown correctly except in this last one where I was once again pressed for time and fed up for the nth time it rewinded blocks... so I killed the thread... :/

As for the debug fie (10MB!!!), here it is: https://www.dropbox.com/s/p03omkvwt3oqjhi/debug.log?dl=0

Thank you once again!

Important lines at the very end of that log I'm looking at:
Code:
2018-04-25 21:40:36 ERROR: ReadBlockFromDisk: Deserialize or I/O error - CAutoFile::read: fread failed: iostream error at CBlockDiskPos(nFile=1229, nPos=77695671)
2018-04-25 21:40:36 *** Failed to read block

It looks like you need to run the program with the -reindex command line option.

To do that (for windows):
  • Right click on your shortcut for the program and select properties
  • In the field labeled "target", you should see something like "C:\Program Files\Bitcoin\bitcoin-qt.exe" (Don't worry if your path isn't exactly the same)
  • Outside of those quotes, add the -reindex option (should look like this:) "C:\Program Files\Bitcoin\bitcoin-qt.exe" -reindex
  • After fully exiting Bitcoin Core, double click on that shortcut. It should run and I believe it will prompt you asking if you want to reindex/rebuild, you want to select yes/the affirmative option.
  • Once it's done, edit your shortcut again to remove the extra bit that you added, so it should look like the second bullet point above again

That should rebuild the database and you should be doing fine after that. Let me know if you have any more problems.

See achow's answer below mine


Title: Re: Rewinding blocks every time I start bitcoin-qt
Post by: achow101 on April 27, 2018, 11:32:34 PM
Your node is rewinding hundreds of blocks, that seems like a huge problem.

What version of Bitcoin Core were you running before 0.16? This seems characteristic of upgrading from a non-segwit node to a segwit node. I'm guessing that's the problem (especially since the log is full of lines about non-standard transactions) and, with pruning, it gets into some weird feedback loop.

Your best option is to resync the blockchain entirely. You can do that by deleting everything in the datadir except for your wallet file.

It looks like you need to run the program with the -reindex command line option.
He's pruned so that won't work without resyncing.


Title: Re: Rewinding blocks every time I start bitcoin-qt
Post by: Jay_Pal on April 27, 2018, 11:39:20 PM
Your node is rewinding hundreds of blocks, that seems like a huge problem.

What version of Bitcoin Core were you running before 0.16? This seems characteristic of upgrading from a non-segwit node to a segwit node. I'm guessing that's the problem (especially since the log is full of lines about non-standard transactions) and, with pruning, it gets into some weird feedback loop.

Your best option is to resync the blockchain entirely. You can do that by deleting everything in the datadir except for your wallet file.

It looks like you need to run the program with the -reindex command line option.
He's pruned so that won't work without resyncing.

That's right, I have a pruned wallet and before I was running some 15 something, can't tell it exactly.
I'll resync and I'll get back to this topic after finishing (in about a week...)

Thank you all!


Title: Re: Rewinding blocks every time I start bitcoin-qt
Post by: jackg on April 28, 2018, 03:02:22 PM
Your node is rewinding hundreds of blocks, that seems like a huge problem.

What version of Bitcoin Core were you running before 0.16? This seems characteristic of upgrading from a non-segwit node to a segwit node. I'm guessing that's the problem (especially since the log is full of lines about non-standard transactions) and, with pruning, it gets into some weird feedback loop.

Your best option is to resync the blockchain entirely. You can do that by deleting everything in the datadir except for your wallet file.

It looks like you need to run the program with the -reindex command line option.
He's pruned so that won't work without resyncing.

That's right, I have a pruned wallet and before I was running some 15 something, can't tell it exactly.
I'll resync and I'll get back to this topic after finishing (in about a week...)

Thank you all!

Id suggest moving/deleting the blocks and chainstate folders. I remember a forced reindex where that happened to me and the client kept reindexing because it didn't work out that the last block file was corrupted so it got stuck in an infinite loop (until I deleted the block files).


Title: Re: Rewinding blocks every time I start bitcoin-qt
Post by: Jay_Pal on May 03, 2018, 08:32:38 PM
Gentlemen,

Thank you very much, re-syncing seems to have solved the problem and it is working as expected!

Thank you all!