{"record":{"id":"2d3764d970af5c4b","repo":"jdx/mise","slug":"remote-action-result-does-not-match-requested-acti","errorCode":null,"errorMessage":"remote action result does not match requested action","messagePattern":"remote action result does not match requested action","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/mise-cache-core/src/lib.rs","lineNumber":632,"sourceCode":"                .request(reqwest::Method::GET, url.clone(), ACTION_RESULT_MEDIA_TYPE)\n                .await?\n                .send()\n                .await?;\n            if response.status() == StatusCode::NOT_FOUND {\n                return Ok(None);\n            }\n            Ok(Some(\n                response\n                    .error_for_status()?\n                    .json::<RemoteActionResult>()\n                    .await?,\n            ))\n        })\n        .await?;\n        if let Some(result) = &result\n            && (result.version != 1 || result.action != *action)\n        {\n            bail!(\"remote action result does not match requested action\");\n        }\n        Ok(result)\n    }\n\n    pub async fn put_action_result(&self, result: &RemoteActionResult) -> Result<()> {\n        let url = self.action_result_endpoint(&result.action)?;\n        let body = serde_json::to_vec(result)?;\n        retry_async(\"PUT\", &url, self.retries, || async {\n            let response = self\n                .request(reqwest::Method::PUT, url.clone(), ACTION_RESULT_MEDIA_TYPE)\n                .await?\n                .header(CONTENT_TYPE, ACTION_RESULT_MEDIA_TYPE)\n                .header(IF_NONE_MATCH, \"*\")\n                .body(body.clone())\n                .send()\n                .await?;\n            if response.status() != StatusCode::PRECONDITION_FAILED {\n                response.error_for_status()?;","sourceCodeStart":614,"sourceCodeEnd":650,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/crates/mise-cache-core/src/lib.rs#L614-L650","documentation":"After fetching an action result, the client verifies the returned record: its version must be 1 and its embedded action digest must equal the requested digest. If the server returns a record for a different action (or an unsupported result version), the client bails instead of trusting mismatched data. This is an integrity check against wrong-keyed or corrupt server entries.","triggerScenarios":"Calling get_action_result and receiving a stored RemoteActionResult whose .action digest differs from the requested CacheDigest, or whose .version != 1.","commonSituations":"A broken or buggy cache server returning whatever record it has instead of 404; hash collisions or key-encoding bugs server-side; a server storing results in an older result format after a protocol change.","solutions":["Inspect the server's keying logic — it should 404 rather than return a non-matching record","Purge/clear the affected cache namespace entries","Confirm the server writes result version 1 records; upgrade the server if it emits another version","Retry the lookup; if a single entry is persistently wrong, delete that key"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if let Some(result) = client.get_action_result(&action).await? {\n    if result.version != 1 || result.action != *action {\n        bail!(\"server returned a mismatched action result; purge the entry\");\n    }\n}","typeGuard":"fn result_matches(r: &RemoteActionResult, action: &CacheDigest) -> bool {\n    r.version == 1 && r.action == *action\n}","tryCatchPattern":"match client.get_action_result(&action).await {\n    Err(e) if e.to_string().contains(\"does not match requested action\") => {\n        // treat as cache miss; purge the key and recompute\n    }\n    other => other?,\n}","preventionTips":["Monitor server logs for records returned under wrong keys","Purge the affected namespace when mismatches are detected","Keep server result-format version at 1 or upgrade both sides together"],"tags":["remote-cache","integrity","action-result"],"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"}