{"record":{"id":"b6f35bc83806603e","repo":"jdx/mise","slug":"local-task-cache-manifest-does-not-match-remote-ac","errorCode":null,"errorMessage":"local task cache manifest does not match remote action","messagePattern":"local task cache manifest does not match remote action","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_cache_store.rs","lineNumber":453,"sourceCode":"        })\n    }\n\n    async fn commit(\n        &self,\n        key: &str,\n        action: &[u8],\n        write: &TaskCacheStoreWrite,\n        manifest: &[u8],\n        has_artifact: bool,\n    ) -> Result<()> {\n        validate_remote_key(key)?;\n        let action_digest = CacheDigest::blake3(action);\n        if action_digest.hash != key {\n            bail!(\"remote cache action bytes do not match cache key\");\n        }\n        let manifest: CacheManifest = serde_json::from_slice(manifest)?;\n        if manifest.key != key {\n            bail!(\"local task cache manifest does not match remote action\");\n        }\n        let metadata = canonical_json(&serde_json::to_value(\n            RemoteClientMetadata::from_manifest(&manifest),\n        )?)?;\n        let mut uploads = vec![\n            BlobUpload {\n                digest: action_digest.clone(),\n                source: BlobSource::Bytes(action.to_vec()),\n            },\n            BlobUpload {\n                digest: CacheDigest::blake3(&metadata),\n                source: BlobSource::Bytes(metadata),\n            },\n        ];\n        let metadata = uploads[1].digest.clone();\n        let output_root = if has_artifact {\n            let (root, mut artifact_uploads) =\n                archive_to_cas(write.artifact_path(), &self.staging_dir)?;","sourceCodeStart":435,"sourceCodeEnd":471,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/task_cache_store.rs#L435-L471","documentation":"After parsing the uploaded manifest, commit() checks that manifest.key equals the cache key argument. A mismatch means the manifest being published describes a different action than the one being committed, so the store rejects it to keep the remote entry self-consistent.","triggerScenarios":"Calling HttpTaskCacheStore::commit where the serialized CacheManifest's key field differs from the key parameter (task_cache_store.rs:453), e.g. writing the manifest for one task and committing under another task's key.","commonSituations":"Concurrent task writes where manifest/key pairs got crossed; reusing a staged write (manifest file) after the key changed; hand-assembled manifests in custom tooling; stale staging files in the staging_dir picked up incorrectly.","solutions":["Regenerate the manifest from the current action so its key field matches the key passed to commit().","Ensure each TaskCacheStoreWrite/manifest pair is used with exactly the key it was created for; do not share writes across tasks.","Clear the staging directory of leftover part files and restart the write.","Add an assertion/logging comparing manifest.key and key before commit to catch the crossing earlier."],"exampleFix":"// before\nlet manifest = load_manifest(\"other-task.json\");\nstore.commit(&current_key, action, &write, &manifest, true).await?;\n// after\nlet mut manifest = CacheManifest { key: current_key.to_string(), ..load_manifest(\"other-task.json\") };\nlet manifest_bytes = serde_json::to_vec(&manifest)?;\nstore.commit(&current_key, action, &write, &manifest_bytes, true).await?;","handlingStrategy":"validation","validationCode":"let manifest: CacheManifest = serde_json::from_slice(&manifest_bytes)?;\nassert_eq!(manifest.key, key, \"manifest.key must equal commit key\");","typeGuard":"fn manifest_matches_key(manifest: &CacheManifest, key: &str) -> bool {\n    manifest.key == key\n}","tryCatchPattern":"if let Err(e) = store.commit(&key, action, &write, &manifest_bytes, true).await {\n    if e.to_string().contains(\"manifest does not match remote action\") {\n        // regenerate manifest for this key and retry once\n    } else { return Err(e); }\n}","preventionTips":["Pair each manifest with exactly one key/write; never share staged writes across tasks.","Regenerate the manifest whenever the key changes.","Clean the staging directory of stale part files before writes.","Log manifest.key alongside key at commit sites in custom integrations."],"tags":["cache","manifest","integrity","key-mismatch"],"backgroundTag":"checksum-mismatch","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}