NebulousLabs / Sia

Blockchain-based marketplace for file storage. Project has moved to GitLab: https://gitlab.com/NebulousLabs/Sia
https://sia.tech
MIT License
2.71k stars 440 forks source link

Consensus change series appears to be inconsistent - we are applying the wrong block. #2867

Open chrsch opened 6 years ago

chrsch commented 6 years ago

BUG REPORT

Stack Trace or error message PS C:\Users\cscha> C:\Sia-v1.3.2-windows-amd64\siad.exe -d G:\Blockchains\SIA\ Sia Daemon v1.3.2 Git Revision 72938f5 Loading... (0/6) Loading siad... (1/6) Loading gateway... (2/6) Loading consensus... (3/6) Loading transaction pool... (4/6) Loading wallet... (5/6) Loading host... (6/6) Loading renter... Finished loading in 20.4331806 seconds panic: Consensus change series appears to be inconsistent - we are applying the wrong block.

goroutine 62407 [running]: github.com/NebulousLabs/Sia/modules/transactionpool.(TransactionPool).ProcessConsensusChange(0xc0421a62c0, 0x83d1b026941fa14, 0 x3159f5cd34fceb04, 0x2fc68a3e204f17be, 0xf1dc6d03b3a37b7b, 0x0, 0x0, 0x0, 0xc0c921cd20, 0x1, ...) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/transactionpool/update.go:223 +0x28d3 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).updateSubscribers(0xc0421ac500, 0x0, 0x0, 0x0, 0xc0cc33c8e0, 0x1, 0x1) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/subscribe.go:118 +0x184 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).managedAcceptBlocks(0xc0421ac500, 0xc0aeb0bd48, 0x1, 0x1, 0x1e8400 , 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/accept.go:311 +0x5e0 github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).managedReceiveBlock.func1(0xb3e840, 0xc0af06db40, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:529 +0x1fc github.com/NebulousLabs/Sia/modules/gateway.(Gateway).managedRPC(0xc0421a6000, 0xc042247ec0, 0x12, 0xa986bf, 0x7, 0xc0c8b61770, 0x0, 0x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/gateway/rpc.go:66 +0x2b2 github.com/NebulousLabs/Sia/modules/gateway.(Gateway).RPC(0xc0421a6000, 0xc042247ec0, 0x12, 0xa986bf, 0x7, 0xc0c8b61770, 0x0, 0 x0) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/gateway/rpc.go:76 +0xcb github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).threadedRPCRelayHeader.func5(0xc043c12fb0, 0xc0421ac500, 0xb3e840, 0xc0c5f8c020, 0xc04319fe00, 0xc0afea1030) /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:459 +0x147 created by github.com/NebulousLabs/Sia/modules/consensus.(ConsensusSet).threadedRPCRelayHeader /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:457 +0x40f PS C:\Users\cscha> C:\Sia-v1.3.2-windows-amd64\siad.exe -d G:\Blockchains\SIA\

Expected Behavior

How to reproduce it (as minimally and precisely as possible) No special action, three files were uploading at this point.

Environment

chargr commented 6 years ago

Same here on linux. v1.3.2

2018/03/15 02:17:17.594935 persist.go:86: STARTUP: Logging has started. Siad Version 1.3.2
2018/03/15 02:21:16.783446 update.go:175: CCID 48e3046a (height 29916): 1 applied blocks, 0 reverted blocks
2018/03/15 04:51:22.527201 persist.go:86: STARTUP: Logging has started. Siad Version 1.3.2
2018/03/15 04:51:23.552423 update.go:175: CCID 48e3046a (height 29916): 1 applied blocks, 0 reverted blocks
chargr commented 6 years ago

I renamed my 'transactionpool' folder and started siad to create a new one, it took about 40 minutes, but it is back up again.

tbenz9 commented 6 years ago

@DavidVorick just an FYI that this has been reported several times on Discord as well as here, always with 1.3.2. We may want to look at what introduced this bug.

ceo-nada commented 6 years ago

I've seen the same error 3x today.

Running SiaUI 1.3.2 on Windows 10 pro 64-bit.

I'll try @chargr route with the transactionpool folder and will report back if that resolved it.

ChrisSchinnerl commented 6 years ago

@tbenz9 iirc this sanity check was introduced by @DavidVorick after we noticed that our boltdb databases corrupted over time for some users. It should only be triggered after updating to 1.3.2 because 1.3.1 silently ignored this issue. I would recommend everyone to do a clean install of Sia 1.3.2 to avoid that potential issue.

ceo-nada commented 6 years ago

Update: I tried deleting the transactionpool folder and doing a clean install.

Both resulted in the same "things take a while to load after updating" display (Sorry I don't have the exact on-screen display message).

After deleting the transactionpool folder, the App was hung for over 4 hours.

Then I closed the app and did a clean install of 1.3.2

It's been hung on that same screen for about an hour.

Bojak4616 commented 6 years ago

Another report of this issue https://www.reddit.com/r/siacoin/comments/85p3hr/anyone_know_why_i_cant_run_the_siaui_ive_been/

ceo-nada commented 6 years ago

I've duplicated the issue on Mac OS 10.13.3.

Let me be clear that I'm unable to access my Sia coin on any platform. Good thing it's a bear market!

I've tried the following troubleshooting steps and it's the same error everytime: Fresh installs, deleting consensus, deleting transactionpool folder.

tbenz9 commented 6 years ago

We're actively troubleshooting this error in Discord right now. Can anyone try following these instructions to delete your transactionpool.db file and report back if it worked.

https://gist.github.com/tbenz9/8066d74853ab28c23bd7bc1d3c7cdeda#delete-the-transactionpooldb-file

chrsch commented 6 years ago

For me, it worked to remove the transactionpool folder completely (renamed it to .old), created an empty one and restarted Sia. This fixed it for me (see comment by @chargr above). Basically, this folder holds the .db and the .log file. So yes, helped! (@tbenz9 notice my improved punctuation ;-) )

hackneyb commented 6 years ago

I encountered this on 1.3.2 (not fresh install and load, it's an upgrade from 1.3.1). The issue happened after a system crash. Following a manual siad restart, the system is working normally with no symptoms of any problem. Stack below.

Sia Daemon v1.3.2
Git Revision 72938f5
Loading...
(0/6) Loading siad...
(1/6) Loading gateway...
(2/6) Loading consensus...
(3/6) Loading transaction pool...
(4/6) Loading wallet...
(5/6) Loading host...
(6/6) Loading renter...
Finished loading in 228.4287506 seconds
panic: Consensus change series appears to be inconsistent - we are applying the wrong block.

goroutine 10418 [running]:
github.com/NebulousLabs/Sia/modules/transactionpool.(*TransactionPool).ProcessConsensusChange(0xc04226c000, 0xeb5078dc0065d61d, 0x4764b5c5f215a736, 0x7710f9a5be90d379, 0xf165500076cdda93, 0x0, 0x0, 0x0, 0xc042aed560, 0x1, ...)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/transactionpool/update.go:223 +0x2b68
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).updateSubscribers(0xc0420d7b80, 0x0, 0x0, 0x0, 0xc042663ea0, 0x1, 0x1)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/subscribe.go:118 +0x17f
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).managedAcceptBlocks(0xc0420d7b80, 0xc044809d40, 0x1, 0x1, 0x1e8400, 0x0, 0x0)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/accept.go:311 +0x61e
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).managedReceiveBlock.func1(0xdf80e0, 0xc0426ac640, 0x0, 0x0)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:529 +0x1fc
github.com/NebulousLabs/Sia/modules/gateway.(*Gateway).managedRPC(0xc0420ca580, 0xc0421ba7e0, 0x14, 0xac0901, 0x7, 0xc042df5650, 0x0, 0x0)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/gateway/rpc.go:66 +0x2c9
github.com/NebulousLabs/Sia/modules/gateway.(*Gateway).RPC(0xc0420ca580, 0xc0421ba7e0, 0x14, 0xac0901, 0x7, 0xc042df5650, 0x0, 0x0)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/gateway/rpc.go:76 +0xd8
github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).threadedRPCRelayHeader.func5(0xc042439960, 0xc0421627e0, 0xc0420d7b80, 0xdf80e0, 0xc044539340, 0xc042d76780)
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:459 +0x147
created by github.com/NebulousLabs/Sia/modules/consensus.(*ConsensusSet).threadedRPCRelayHeader
    /home/luke/go/src/github.com/NebulousLabs/Sia/modules/consensus/synchronize.go:457 +0x447
DavidVorick commented 6 years ago

I believe that this bug will be fixed when #3030 is merged. To all the users who continue to see this every now and then, please let us know if you continue to run into the issue after upgrading to v1.3.3.