{"record":{"id":"b43d66f63e6cda94","repo":"FuelLabs/fuel-core","slug":"failed-to-get-registry-root","errorCode":null,"errorMessage":"Failed to get registry root: {}","messagePattern":"Failed to get registry root: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/compression/src/compress.rs","lineNumber":99,"sourceCode":"{\n    let target = block.transactions_vec();\n\n    let mut prepare_ctx = PrepareCtx {\n        config,\n        timestamp: block.header().time(),\n        db: &mut db,\n        accessed_keys: Default::default(),\n    };\n    let _ = target.compress_with(&mut prepare_ctx).await?;\n\n    let mut ctx = prepare_ctx.into_compression_context()?;\n    let transactions = target.compress_with(&mut ctx).await?;\n    let registrations: RegistrationsPerTable = ctx.finalize()?;\n\n    #[cfg(feature = \"fault-proving\")]\n    let registry_root = db\n        .registry_root()\n        .map_err(|e| anyhow::anyhow!(\"Failed to get registry root: {}\", e))?;\n\n    Ok(VersionedCompressedBlock::new(\n        block.header(),\n        registrations,\n        transactions,\n        #[cfg(feature = \"fault-proving\")]\n        registry_root,\n    ))\n}\n\n/// Preparation pass through the block to collect all keys accessed during compression.\n/// Returns dummy values. The resulting \"compressed block\" should be discarded.\nstruct PrepareCtx<'a, D> {\n    config: &'a Config,\n    /// Current timestamp\n    timestamp: Tai64,\n    /// Database handle\n    db: D,","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/compression/src/compress.rs#L81-L117","documentation":"With the fault-proving feature enabled, compressing a block finalizes by reading the registry root from the registry storage; any storage failure there is wrapped as 'Failed to get registry root: {e}' (crates/compression/src/compress.rs:99). The wrapped {e} is the real cause — a registry/database read error. Compression of the block itself already succeeded; only the integrity-root fetch failed.","triggerScenarios":"Compressing a block into a VersionedCompressedBlock with fault-proving enabled, when registry_root() on the registry DB errors (IO error, corrupted storage, closed DB handle).","commonSituations":"RocksDB/registry storage corruption or a DB handle shared across processes; fault-proving enabled in one component but not another; registry state snapshot inconsistent with the live DB.","solutions":["Inspect the wrapped {e} (error chain / source) — it names the actual storage failure.","Ensure the registry DB is opened and owned by a single process and not concurrently mutated.","Align the fault-proving feature flag across every binary in the compression/decompression pipeline.","If the storage is corrupted, rebuild/re-sync the registry state instead of retrying compression."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match block.compress(&mut db).await {\n    Err(e) if e.to_string().contains(\"Failed to get registry root\") => {\n        // inspect the error chain for the underlying storage failure; do not blind-retry\n        return Err(e.context(\"registry storage failure after compression\"));\n    }\n    r => r?,\n}","preventionTips":["Open the registry DB with a single owner process; avoid concurrent handles.","Keep fault-proving feature flags identical across compression and decompression binaries.","Log the full error chain (e.source()) — the wrapped error carries the real cause."],"tags":["rust","fuel-core","compression","fault-proving","registry","storage"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}