{"record":{"id":"b5bddbcacf83fa1f","repo":"astrid-runtime/astrid","slug":"wasm-catalog-entry-is-missing-bin-hash-wasm","errorCode":null,"errorMessage":"WASM catalog entry is missing: bin/{hash}.wasm","messagePattern":"WASM catalog entry is missing: bin/(.+?)\\.wasm","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-capsule-install/src/wasm.rs","lineNumber":117,"sourceCode":"        }\n    }\n\n    Ok(Some(WasmAddressed { hash, bytes }))\n}\n\n/// Read one verified executable from the system-owned content catalog.\npub(crate) fn read_catalog_wasm(\n    storage: &RuntimePrincipalStore,\n    hash: &str,\n) -> anyhow::Result<Vec<u8>> {\n    let name = ContentName::new(format!(\"bin/{hash}.wasm\"))\n        .context(\"construct system WASM catalog name\")?;\n    let descriptor = storage\n        .content()\n        .describe(&StateOwner::System, &name)\n        .map_err(|error| anyhow::anyhow!(error))\n        .context(\"describe WASM in system catalog\")?\n        .ok_or_else(|| anyhow::anyhow!(\"WASM catalog entry is missing: bin/{hash}.wasm\"))?;\n    storage\n        .content()\n        .read_range(&StateOwner::System, &name, 0, descriptor.logical_bytes())\n        .map_err(|error| anyhow::anyhow!(error))\n        .context(\"read WASM from system catalog\")?\n        .ok_or_else(|| anyhow::anyhow!(\"WASM catalog entry has no readable bytes: bin/{hash}.wasm\"))\n}\n\n/// Verify that the system catalog entry for `expected` exists and hashes to\n/// its content-addressed name.\npub fn catalog_wasm_hash(\n    storage: &RuntimePrincipalStore,\n    expected: &str,\n) -> anyhow::Result<String> {\n    let actual = blake3::hash(&read_catalog_wasm(storage, expected)?)\n        .to_hex()\n        .to_string();\n    anyhow::ensure!(","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-capsule-install/src/wasm.rs#L99-L135","documentation":"Raised when describe() succeeded but returned None: there is no catalog entry named bin/{hash}.wasm under StateOwner::System. read_catalog_wasm uses this to distinguish 'backend failed' from 'entry genuinely absent' during catalog_wasm_hash integrity verification.","triggerScenarios":"catalog_wasm_hash is called for an expected hash that was never published to the system catalog — e.g. the WASM was installed via the legacy bin-dir path (the else branch of content_address_wasm) instead of the catalog, or the catalog entry was deleted/compacted away.","commonSituations":"Install created before the content-catalog publish path existed (old layout on disk); another process ran garbage collection on the system content store; checking a hash from a different home/store than the one queried; typo'd or stale expected hash.","solutions":["Re-install/re-publish the WASM so it is written into the system content catalog via content_address_wasm","Confirm you are querying the same store/home the WASM was published to (StateOwner::System scope)","Check whether a GC/cleanup process removed the catalog entry and restore it by re-publishing","Verify the expected hash matches the artifact actually installed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// check entry presence before hashing\nlet name = ContentName::new(format!(\"bin/{expected}.wasm\"))?;\nlet present = storage.content().describe(&StateOwner::System, &name)\n    .map_err(|e| anyhow::anyhow!(e))?.is_some();\nif !present { anyhow::bail!(\"WASM {expected} not published; re-run install first\"); }","typeGuard":null,"tryCatchPattern":"match catalog_wasm_hash(&storage, &expected) {\n    Err(e) if e.to_string().contains(\"catalog entry is missing\") => {\n        // republish from the trusted source artifact, then verify\n        republish_wasm(&storage, &source_bytes)?;\n        catalog_wasm_hash(&storage, &expected)\n    }\n    other => other,\n}","preventionTips":["Always install through the content-catalog path, not the legacy bin-dir path","Exclude the content store from GC/cleanup jobs for entries still in use","Confirm the expected hash belongs to the same store/home being queried"],"tags":["rust","storage","wasm","content-catalog","missing-entry"],"backgroundTag":"record-not-found","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}