substrate-archive
substrate-archive copied to clipboard
Unexpected Error: RuntimeCode("`:code` hash not found")
When I want to run node-template-archive,and set the data_path like "/var/folders/wn/kxwzfpj11jvfyky_ppb9g_sh0000gn/T/substrate22wl8x/chains/dev/db/full",It happens an error,like below:
INFO Open RocksDB at /var/folders/wn/kxwzfpj11jvfyky_ppb9g_sh0000gn/T/substrate22wl8x/chains/dev/db/full, state column budget: 115 MiB, others(11) column cache: 1 MiB
Error: Backend error: Unexpected Error: RuntimeCode(":code
hash not found")
What should I do for this?
A bit of a guess, but it looks like this error is in the area of attempting to sync the RocksDB secondary database with the primary one. I don't have any particularly good suggestions other than, check the wiki, make sure that the path to the rocksDB database is correct, and make sure that the substrate node is using RocksDB (and not eg ParityDB). If you find a solution, I'd love to hear back on what it was :)
I suspect that the substrate node
and substrate archive
is using different versions, @kaisuki can you double check which versions you are using?
I'm also facing the same issue, I managed to make it work but once I stopped it and try to use again, the same error appears. After a few attempts, it worked again and on stop, again fails to run. I don't know what is going on tbh
Same issue here, for me, the first time I start substrate node then substrate archive report :code hash not found
, but when I restart substrate node and substrate archive everything goes fine.
Same issue here, for me, the first time I start substrate node then substrate archive report
:code hash not found
, but when I restart substrate node and substrate archive everything goes fine.
yeah,When the substrate node is started for the first time, it must be interrupted and restart then it can work normally.
I suspect that the
substrate node
andsubstrate archive
is using different versions, @kaisuki can you double check which versions you are using?
I will check,Thanks.
I suspect that the
substrate node
andsubstrate archive
is using different versions, @kaisuki can you double check which versions you are using?
Now I use polkadot-v0 9.17, and I found that the chainType of my node is Development, but I configured Local in the archive. Will this affect.
in substrate-archive-backend/database.rs
/// Read genesis hash from database.
pub fn read_genesis_hash<Hash: Decode, D: ReadOnlyDb>(db: &D) -> sp_blockchain::Result<Option<Hash>> {\n
match db.get(columns::META, meta_keys::GENESIS_HASH) {
Some(h) => match Decode::decode(&mut &h[..]) {
Ok(h) => Ok(Some(h)),
Err(err) => Err(sp_blockchain::Error::Backend(format!("Error decoding genesis hash: {}", err))),
},
None => {
Ok(None)
},
}
}
when db get return None,Error: Backend error: Unexpected Error: RuntimeCode(":code hash not found") will happen. It does not return none every time. If you run the code several times without making any changes, there will be success.
A bit of a guess, but it looks like this error is in the area of attempting to sync the RocksDB secondary database with the primary one. I don't have any particularly good suggestions other than, check the wiki, make sure that the path to the rocksDB database is correct, and make sure that the substrate node is using RocksDB (and not eg ParityDB). If you find a solution, I'd love to hear back on what it was :)
Yes, it seems that there should be a problem when getting the genesis hash, but it doesn't happen every time. Try several times and you will succeed once. Do you have any new clues.