Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pruning: head doesn't match snapshot #2441

Closed
ThomasBlock opened this issue Jun 27, 2024 · 6 comments
Closed

pruning: head doesn't match snapshot #2441

ThomasBlock opened this issue Jun 27, 2024 · 6 comments

Comments

@ThomasBlock
Copy link

Hi. I dont't understand how pruning works. When i start with --init.prune full
i see the following

INFO [06-27|11:00:22.676] looking for old block with state to keep current=226,200,000 target=226,201,514
INFO [06-27|11:00:48.367] found pruning target blocks              heights="[22207817 226197474]" roots="[0x7f2bfc4481d02bfcfc606ebb949384ef78d03a0f30a2dc9cccd652eb80926ae1 0x333c6b613460df75888a409e445c34bba35d2099130c6a50a35c7bf9ff803551 0x0000000000000000000000000000000000000000000000000000000000000000]"
WARN [06-27|11:00:48.373] Loaded snapshot journal                  diskroot=77fe2d..d3bc22 diffs=unmatched
WARN [06-27|11:00:48.373] Failed to load snapshot                  err="head doesn't match snapshot: have 0x77fe2d0b7243073d9c7bfd5523cdbcdb3bca4e57af1021f6aaab5e8f68d3bc22, want 0x56e5d9c0681377904a57d9e695918c2b080d393308fdd27b5310b024c6b11077"
Usage of /root/nitro/target/bin/nitro:
ERROR[06-27|11:00:48.373] error initializing database              err="error pruning: head doesn't match snapshot: have 0x77fe2d0b7243073d9c7bfd5523cdbcdb3bca4e57af1021f6aaab5e8f68d3bc22, want 0x56e5d9c0681377904a57d9e695918c2b080d393308fdd27b5310b024c6b11077"
nitro.service: Main process exited, code=exited, status=1/FAILURE
nitro.service: Failed with result 'exit-code'.

what can i do?

Bonus question: my second node, a full archival node is 30 TB big. Other operators say that would be too much. what is correct?

@leihot
Copy link

leihot commented Jul 2, 2024

I hava a same qusetion
INFO [07-02|08:07:16.007] looking for old block with state to keep current=217,497,000 target=217,498,163
INFO [07-02|08:07:16.702] looking for old block with state to keep current=217,494,000 target=217,498,163
INFO [07-02|08:07:17.307] found pruning target blocks heights="[22207817 217491506]" roots="[0x7f2bfc4481d02bfcfc606ebb949384ef78d03a0f30a2dc9cccd652eb80926ae1 0xb3de7e6e379d103d370ed54b453c103959de1d815ccb0210467a887f53c76655 0x0000000000000000000000000000000000000000000000000000000000000000]"
WARN [07-02|08:07:17.314] Failed to load snapshot err="head doesn't match snapshot: have 0xa61be25b3cb50f53933319516bbb045683cfc11a9ced87ce15c03565b5f27e65, want 0xb3de7e6e379d103d370ed54b453c103959de1d815ccb0210467a887f53c76655"
ERROR[07-02|08:07:17.315] error initializing database err="error pruning: head doesn't match snapshot: have 0xa61be25b3cb50f53933319516bbb045683cfc11a9ced87ce15c03565b5f27e65, want 0xb3de7e6e379d103d370ed54b453c103959de1d815ccb0210467a887f53c76655"

@vdoflip
Copy link

vdoflip commented Aug 1, 2024

same issue here.

@apepenkov
Copy link

This may be related to a previous stop. When I stopped the node via sigterm (as it didn't "want" to stop properly - some goroutine panicked some time after CTRL+C and it just continued blockchain activity ignoring further CTRL+Cs), and tried to prune after non-graceful stop it failed. I've ran it for a bit and stopped properly (it did), after which prune was successful.

@joshuacolvin0
Copy link
Member

As noted above, this is most likely due to a corrupted database caused by an ungraceful shutdown.

@ThomasBlock
Copy link
Author

@joshuacolvin0 you mentioned that it's important to do graceful shutdown ( see also #2421 )

can you elaborate on how to do this? it's nice that you focus on docker, but we "native folks" are somewhat overlooked ( see my other issues )

is this okay, or is there a better way?

[Service]
...

# This signal is used to gracefully stop the service
KillSignal=SIGTERM

# Wait for the service to exit gracefully before forcibly terminating it
KillMode=process

# This setting controls the timeout before systemd sends SIGKILL to terminate the service forcibly
TimeoutStopSec=900

@vino-evan
Copy link

I also encountered a similar problem. At first I thought it was a problem with the snapshot file, but later I found that I just needed to remove the --init.prune="full" parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants