{"record":{"id":"a02d906b9adce268","repo":"FuelLabs/fuel-core","slug":"blob-should-not-exist","errorCode":null,"errorMessage":"Blob should not exist","messagePattern":"Blob should not exist","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/fuel-core/src/service/genesis/importer/on_chain.rs","lineNumber":286,"sourceCode":"    }\n\n    Ok(())\n}\n\nfn init_blob_payload(\n    transaction: &mut StorageTransaction<&mut GenesisDatabase>,\n    entry: &TableEntry<BlobData>,\n) -> anyhow::Result<()> {\n    let payload = entry.value.as_ref();\n    let blob_id = entry.key;\n\n    // insert blob payload\n    if transaction\n        .storage::<BlobData>()\n        .replace(&blob_id, payload)?\n        .is_some()\n    {\n        return Err(anyhow!(\"Blob should not exist\"));\n    }\n\n    Ok(())\n}\n\nfn init_contract_raw_code(\n    transaction: &mut StorageTransaction<&mut GenesisDatabase>,\n    entry: &TableEntry<ContractsRawCode>,\n) -> anyhow::Result<()> {\n    let contract = entry.value.as_ref();\n    let contract_id = entry.key;\n\n    // insert contract code\n    if transaction\n        .storage::<ContractsRawCode>()\n        .replace(&contract_id, contract)?\n        .is_some()\n    {","sourceCodeStart":268,"sourceCodeEnd":304,"githubUrl":"https://github.com/FuelLabs/fuel-core/blob/b9d4d170da3a31c9ace5f963d633b326348e0d42/crates/fuel-core/src/service/genesis/importer/on_chain.rs#L268-L304","documentation":"Duplicate guard for BlobData during on-chain genesis import: replace(&blob_id, payload) returned Some. The blob_id is derived from the blob content, so this fires when the same payload appears twice in the genesis state (identical content hashes to the same blob id) or when the blob id already exists in the database.","triggerScenarios":"Two identical blob payloads in the genesis blob list, or importing genesis into a database that already stored those blobs.","commonSituations":"Concatenating snapshot files that both include a shared blob; snapshot tooling that appends instead of deduplicating by content hash; re-running import without clearing the db directory.","solutions":["Dedupe blob payloads by content hash before import: identical payloads are by definition the same blob id and only need one entry.","Wipe the db directory and re-run the import.","Regenerate the snapshot with deduplicating tooling."],"exampleFix":"// before: the same payload twice\n\"blobs\": [ { \"id\": \"0xbbbb...\", \"payload\": \"0x1234\" }, { \"id\": \"0xbbbb...\", \"payload\": \"0x1234\" } ]\n\n// after: one entry per unique payload\n\"blobs\": [ { \"id\": \"0xbbbb...\", \"payload\": \"0x1234\" } ]","handlingStrategy":"validation","validationCode":"fn validate_blob_uniqueness(blobs: &[TableEntry<BlobData>]) -> Result<(), String> {\n    let mut seen = std::collections::HashSet::new();\n    for b in blobs {\n        if !seen.insert(b.key) {\n            return Err(format!(\"duplicate blob id {} (identical payload listed twice)\", b.key));\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match importer.run().await {\n    Err(e) if e.to_string().contains(\"Blob should not exist\") => {\n        // dedupe blobs by content hash and re-import\n    }\n    rest => rest,\n}","preventionTips":["Remember blob ids are content hashes: identical payloads are duplicates by definition.","Dedupe blob lists by id in snapshot generation tooling.","Verify db emptiness before genesis import."],"tags":["genesis","storage","duplicate-data","blobs","fuel-core","rust"],"backgroundTag":null,"analyzedSha":"b9d4d170da3a31c9ace5f963d633b326348e0d42","analyzedAt":"2026-08-16T08:56:42.692Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}