{"record":{"id":"e636f01177bfc78d","repo":"tinyhumansai/openhuman","slug":"no-jail-id","errorCode":null,"errorMessage":"no jail {id}","messagePattern":"no jail (.+?)","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/sandbox/cwd_jail/registry.rs","lineNumber":199,"sourceCode":"            .filter(|r| r.label.to_lowercase().contains(&needle))\n            .cloned()\n            .collect()\n    }\n\n    /// Rename: changes the *label* only. The directory id stays put so\n    /// existing path references keep working. AppContainer profile names\n    /// are derived from `id` (stable), not `label`, for the same reason.\n    pub fn rename(&self, id: &str, new_label: impl Into<String>) -> io::Result<JailRecord> {\n        let new_label = new_label.into();\n        log::debug!(\n            \"[cwd_jail] registry.rename id={id} new_label_len={}\",\n            new_label.len()\n        );\n        let mut idx = self.index.lock().unwrap();\n        let record = idx\n            .records\n            .get_mut(id)\n            .ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, format!(\"no jail {id}\")))?;\n        // Snapshot the prior label/timestamp so we can revert on\n        // persist failure — without that the in-memory record would\n        // diverge from disk.\n        let prev_label = std::mem::replace(&mut record.label, new_label);\n        let prev_updated = std::mem::replace(&mut record.updated_at_unix, now_unix());\n        let cloned = record.clone();\n        if let Err(e) = self.persist(&idx) {\n            if let Some(r) = idx.records.get_mut(id) {\n                r.label = prev_label;\n                r.updated_at_unix = prev_updated;\n            }\n            log::warn!(\"[cwd_jail] registry.rename persist failed; rolled back: {e}\");\n            return Err(e);\n        }\n        Ok(cloned)\n    }\n\n    /// Update the free-form notes field.","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/sandbox/cwd_jail/registry.rs#L181-L217","documentation":"A cwd-jail registry operation (rename here) looked up a jail id that does not exist in the in-memory registry. It is a NotFound io::Error sentinel from the get() precondition — the faulting input is the caller-supplied jail id string, which is stale, typo'd, or refers to a jail deleted from another process/registry instance.","triggerScenarios":"Thrown at src/openhuman/sandbox/cwd_jail/registry.rs:199 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List jails from the registry to confirm which ids exist and re-issue with a valid id","If the jail was expected, check whether another session/process removed it or the registry index failed to load","Create the jail again if it was legitimately deleted but still needed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}