cita_recover 后无法出块

用工具cita_recover回退块高后,可能是因为回退的块里有交易,是否有具体的办法去删除相关交易。错误信息如下

chain

cita_node1.1.gjlqqkk87hxo@maojin204    | 
cita_node1.1.gjlqqkk87hxo@maojin204    | ============================
cita_node1.1.gjlqqkk87hxo@maojin204    | 
cita_node1.1.gjlqqkk87hxo@maojin204    | 2021-09-08 - 09:36:28 | cita_chain           - 111   | INFO  - CITA:chain
cita_node1.1.gjlqqkk87hxo@maojin204    | 2021-09-08 - 09:36:28 | cita_chain           - 112   | INFO  - Version: v0.25.2-23-g79a3db3-dev
cita_node1.1.gjlqqkk87hxo@maojin204    | 2021-09-08 - 09:36:28 | amqp::session        - 196   | INFO  - Session initialized
cita_node1.1.gjlqqkk87hxo@maojin204    | 2021-09-08 - 09:36:28 | amqp::session        - 196   | INFO  - Session initialized
cita_node1.1.gjlqqkk87hxo@maojin204    | 2021-09-08 - 09:36:29 | core::libchain::chai - 355   | INFO  - chain config: Config { prooftype: 2, cache_size: Some(1048576) }
cita_node1.1.gjlqqkk87hxo@maojin204    | 2021-09-08 - 09:36:29 | panic_hook           - 62    | ERROR -
cita_node1.1.gjlqqkk87hxo@maojin204    | ============================
cita_node1.1.gjlqqkk87hxo@maojin204    | stack backtrace:
cita_node1.1.gjlqqkk87hxo@maojin204    |    0:     0x7fef476ec7cd - backtrace::backtrace::trace::hd4a48c19df1f8abe
cita_node1.1.gjlqqkk87hxo@maojin204    |    1:     0x7fef476ec452 - backtrace::capture::Backtrace::new::h89cc227630c6d865
cita_node1.1.gjlqqkk87hxo@maojin204    |    2:     0x7fef476eb76a - panic_hook::panic_hook::h90ea55bbb9530348
cita_node1.1.gjlqqkk87hxo@maojin204    |    3:     0x7fef476eb498 - core::ops::function::Fn::call::hde6c02d0799ac12a
cita_node1.1.gjlqqkk87hxo@maojin204    |    4:     0x7fef4779cb54 - std::panicking::rust_panic_with_hook::h1f2449d529a25f22
cita_node1.1.gjlqqkk87hxo@maojin204    |                         at src/libstd/panicking.rs:474
cita_node1.1.gjlqqkk87hxo@maojin204    |    5:     0x7fef4779c66a - rust_begin_unwind
cita_node1.1.gjlqqkk87hxo@maojin204    |                         at src/libstd/panicking.rs:378
cita_node1.1.gjlqqkk87hxo@maojin204    |    6:     0x7fef4779c5da - std::panicking::begin_panic_fmt::h7c14cf40a8be97ee
cita_node1.1.gjlqqkk87hxo@maojin204    |                         at src/libstd/panicking.rs:332
cita_node1.1.gjlqqkk87hxo@maojin204    |    7:     0x7fef47269daf - <KVDB as common_types::db::Readable>::read::h94dcb89fe0bc61e9
cita_node1.1.gjlqqkk87hxo@maojin204    |    8:     0x7fef4724a0f8 - core::libchain::chain::Chain::init_chain::h18c55b30fb90238d
cita_node1.1.gjlqqkk87hxo@maojin204    |    9:     0x7fef471d0bbd - cita_chain::main::hd03f14c5de5b6358
cita_node1.1.gjlqqkk87hxo@maojin204    |   10:     0x7fef4719b4d2 - std::rt::lang_start::{{closure}}::h1ce085d60320ee15
cita_node1.1.gjlqqkk87hxo@maojin204    |   11:     0x7fef4779c542 - std::rt::lang_start_internal::{{closure}}::h9a4aa16acf1cdc99
cita_node1.1.gjlqqkk87hxo@maojin204    |                         at src/libstd/rt.rs:52
cita_node1.1.gjlqqkk87hxo@maojin204    |                          - std::panicking::try::do_call::h0b6fc9f6090c1e2b
cita_node1.1.gjlqqkk87hxo@maojin204    |                         at src/libstd/panicking.rs:303
cita_node1.1.gjlqqkk87hxo@maojin204    |   12:     0x7fef477a12b6 - __rust_maybe_catch_panic
cita_node1.1.gjlqqkk87hxo@maojin204    |                         at src/libpanic_unwind/lib.rs:86
cita_node1.1.gjlqqkk87hxo@maojin204    |   13:     0x7fef4779cf9b - std::panicking::try::h9eaeeaa81242ec77
cita_node1.1.gjlqqkk87hxo@maojin204    |                         at src/libstd/panicking.rs:281
cita_node1.1.gjlqqkk87hxo@maojin204    |                          - std::panic::catch_unwind::h07d504c1b691e8fb
cita_node1.1.gjlqqkk87hxo@maojin204    |                         at src/libstd/panic.rs:394
cita_node1.1.gjlqqkk87hxo@maojin204    |                          - std::rt::lang_start_internal::hcea4e704875ab132
cita_node1.1.gjlqqkk87hxo@maojin204    |                         at src/libstd/rt.rs:51
cita_node1.1.gjlqqkk87hxo@maojin204    |   14:     0x7fef471d1311 - main
cita_node1.1.gjlqqkk87hxo@maojin204    |   15:     0x7fef452f9b96 - __libc_start_main
cita_node1.1.gjlqqkk87hxo@maojin204    |   16:     0x7fef4718e949 - _start
cita_node1.1.gjlqqkk87hxo@maojin204    |   17:
cita_node1.1.gjlqqkk87hxo@maojin204    |   17:                0x0 - <unknown>
cita_node1.1.gjlqqkk87hxo@maojin204    | 
cita_node1.1.gjlqqkk87hxo@maojin204    | position:
cita_node1.1.gjlqqkk87hxo@maojin204    | Thread main panicked at db get failed, key: [124, 171, 251, 119, 9, 178, 156, 22, 217, 232, 118, 232, 118, 201, 152, 141, 3, 249, 195, 65, 78, 29, 63, 247, 126, 193, 222, 45, 14, 229, 159, 104], err: "Corruption: Unknown Footer version. Maybe this file was created with newer version of RocksDB?", <::std::macros::panic macros>:5
cita_node1.1.gjlqqkk87hxo@maojin204    | 
cita_node1.1.gjlqqkk87hxo@maojin204    | This is a bug. Please report it at:
cita_node1.1.gjlqqkk87hxo@maojin204    | 
cita_node1.1.gjlqqkk87hxo@maojin204    |     https://github.com/cryptape/cita/issues/new?labels=bug&template=bug_report.md
cita_node1.1.gjlqqkk87hxo@maojin204    | 
cita_node1.1.gjlqqkk87hxo@maojin204    | ============================

excute log

============================

2021-09-08 - 09:36:28 | cita_executor        - 161   | INFO  - CITA:executor
2021-09-08 - 09:36:28 | cita_executor        - 165   | INFO  - Version: v0.25.2-25-g08b68f0-dev
2021-09-08 - 09:36:28 | cita_executor        - 166   | INFO  - Config: Options { prooftype: 2, grpc_port: 5000, journaldb_type: "archive", genesis_path: "./genesis.json", statedb_cache_size: 5242880, eth_compatibility: false }
2021-09-08 - 09:36:28 | amqp::session        - 196   | INFO  - Session initialized
2021-09-08 - 09:36:28 | amqp::session        - 196   | INFO  - Session initialized
2021-09-08 - 09:36:28 | panic_hook           - 62    | ERROR -
stack backtrace:
   0:     0x7f0f4b89f6bd - backtrace::backtrace::trace::hd4a48c19df1f8abe
   1:     0x7f0f4b89f342 - backtrace::capture::Backtrace::new::h89cc227630c6d865
   2:     0x7f0f4b89e65a - panic_hook::panic_hook::h90ea55bbb9530348
   3:     0x7f0f4b89e388 - core::ops::function::Fn::call::hde6c02d0799ac12a
   4:     0x7f0f4b96a764 - std::panicking::rust_panic_with_hook::h1f2449d529a25f22
                        at src/libstd/panicking.rs:474
   5:     0x7f0f4b96a27a - rust_begin_unwind
                        at src/libstd/panicking.rs:378
   6:     0x7f0f4b98a6c0 - core::panicking::panic_fmt::h2c05f81b567d1861
                        at src/libcore/panicking.rs:85
   7:     0x7f0f4b98a4c2 - core::option::expect_none_failed::ha9782a6ef355446f
                        at src/libcore/option.rs:1211
   8:     0x7f0f4b6195d1 - db::journaldb::archivedb::ArchiveDB::new::h0c4706f388bbdca5
   9:     0x7f0f4b5fc2dc - db::journaldb::new::h1398e23ee95e429a
  10:     0x7f0f4b238516 - core_executor::libexecutor::executor::Executor::init::h30c4ba2b69462bf1
  11:     0x7f0f4b0dc910 - cita_executor::main::h3a2a8929b5c67998
  12:     0x7f0f4b0b4422 - std::rt::lang_start::{{closure}}::hc512c3d32d094c65
  13:     0x7f0f4b96a152 - std::rt::lang_start_internal::{{closure}}::h9a4aa16acf1cdc99
                        at src/libstd/rt.rs:52
                         - std::panicking::try::do_call::h0b6fc9f6090c1e2b
                        at src/libstd/panicking.rs:303
  14:     0x7f0f4b970b16 - __rust_maybe_catch_panic
                        at src/libpanic_unwind/lib.rs:86
  15:     0x7f0f4b96abab - std::panicking::try::h9eaeeaa81242ec77
                        at src/libstd/panicking.rs:281
                         - std::panic::catch_unwind::h07d504c1b691e8fb
                        at src/libstd/panic.rs:394
                         - std::rt::lang_start_internal::hcea4e704875ab132
                        at src/libstd/rt.rs:51
  16:     0x7f0f4b0dd7d1 - main
  17:     0x7f0f48d03b96 - __libc_start_main
  18:     0x7f0f4b09
19:                0x0 - <unknown>

position:
Thread main panicked at Low-level database error.: "Corruption: Unknown Footer version. Maybe this file was created with newer version of RocksDB?", /opt/.cargo/git/checkouts/cita-common-1aad419f3e80ba17/b948764/db/src/journaldb/archivedb.rs:49

This is a bug. Please report it at:

    https://github.com/cryptape/cita/issues/new?labels=bug&template=bug_report.md

Thread main panicked at db get failed, key: [124, 171, 251, 119, 9, 178, 156, 22, 217, 232, 118, 232, 118, 201, 152, 141, 3, 249, 195, 65, 78, 29, 63, 247, 126, 193, 222, 45, 14, 229, 159, 104], err: “Corruption: Unknown Footer version. Maybe this file was created with newer version of RocksDB?”

Thread main panicked at Low-level database error.: “Corruption: Unknown Footer version. Maybe this file was created with newer version of RocksDB?”, /opt/.cargo/git/checkouts/cita-common-1aad419f3e80ba17/b948764/db/src/journaldb/archivedb.rs:49

这边 recover 前后 cita 的 bin 文件不是同一个,你是否先用了较新版本的 cita 产生数据,recover 后使用了较老版本的 cita。
推荐你 recover 前后的 cita 的 bin 保持一致。

另外请问一下,你是如何获取 bin 文件的?

bin 目录一直没有动,肯定是和以前一致的,通过 docker 目录映射获取的bin目录

如果确定从未变更过 bin 文件,可以再次使用 recover 工具回到到更早一个块高,回退操作请严格按照 https://github.com/citahub/cita_recover 给出 readme 操作