hirosystems / ordhook

Build indexers, standards and protocols on top of Ordinals and Inscriptions (BRC20, etc).
Apache License 2.0
180 stars 55 forks source link

Errors on missing blocks in db #258

Closed GuutBoy closed 7 months ago

GuutBoy commented 7 months ago

I am occasionally getting errors like this:

ERRO Unable to compute inscription's Satoshi: block #471462 not in database (traversing 0x1346d30ca577a07ba338c70727af6b2f1b8f3488ca38fb148c62dc0d00447339 / 826984 in progress)

The program seems to continue, so I am wondering how to interpret this. What does this mean? Is ordhook able to recover from this error?

And what may cause this block not to be in the database?

GuutBoy commented 7 months ago

In the release notes of 2.0.0 where is a mention of the flag --check-blocks-integrity that sounds like it might repair this sort of thing. But I can find any documentation on how to use it. I tried

ordhook scan blocks --check-blocks-integrity --interval 767430:767753 --config-path=Ordhook.toml

or

ordhook db repair --check-blocks-integrity --config-path=Ordhook.toml

and a number of other combinations. But it all fails.

smcclellan commented 7 months ago

@GuutBoy Check here, you may need to increase the ulimit value. Let me know if this does not fix and please reopen if that's the case.

GuutBoy commented 7 months ago

@smcclellan I increased ulimit and I dont think I have seen this since. However, it's not really clear to me why the ulimit setting should cause this error. I would suggest improving the error message to make this clear. Also, it is not really clear if ordhook recovers from this error or if this is causing ordhook to give incomplete data. If the latter, maybe the consider if the ordhook should abort on this error, rather than just keep running like nothing happened.

liushmh commented 5 months ago

hi @GuutBoy , could you share your experience of how do you address this issue, and what is your ulimit to make it work, I keep getting the same err as you do

thanks

GuutBoy commented 5 months ago

I think the docs somewhere says to set it at least at 4096.

liushmh commented 5 months ago

I think the docs somewhere says to set it at least at 4096.

I already increase ulimit to 4096, but still has same issue,

how do you make it work?

liushmh commented 5 months ago

Setting ulimit n with more than 4096 fix the issue