tinyhumansai/openhuman · error · io::Error

no jail {id}

Error message

no jail {id}

What it means

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.

Source

Thrown at src/openhuman/sandbox/cwd_jail/registry.rs:199

            .filter(|r| r.label.to_lowercase().contains(&needle))
            .cloned()
            .collect()
    }

    /// Rename: changes the *label* only. The directory id stays put so
    /// existing path references keep working. AppContainer profile names
    /// are derived from `id` (stable), not `label`, for the same reason.
    pub fn rename(&self, id: &str, new_label: impl Into<String>) -> io::Result<JailRecord> {
        let new_label = new_label.into();
        log::debug!(
            "[cwd_jail] registry.rename id={id} new_label_len={}",
            new_label.len()
        );
        let mut idx = self.index.lock().unwrap();
        let record = idx
            .records
            .get_mut(id)
            .ok_or_else(|| io::Error::new(io::ErrorKind::NotFound, format!("no jail {id}")))?;
        // Snapshot the prior label/timestamp so we can revert on
        // persist failure — without that the in-memory record would
        // diverge from disk.
        let prev_label = std::mem::replace(&mut record.label, new_label);
        let prev_updated = std::mem::replace(&mut record.updated_at_unix, now_unix());
        let cloned = record.clone();
        if let Err(e) = self.persist(&idx) {
            if let Some(r) = idx.records.get_mut(id) {
                r.label = prev_label;
                r.updated_at_unix = prev_updated;
            }
            log::warn!("[cwd_jail] registry.rename persist failed; rolled back: {e}");
            return Err(e);
        }
        Ok(cloned)
    }

    /// Update the free-form notes field.

View on GitHub (pinned to 7491200858)

Solutions

  1. List jails from the registry to confirm which ids exist and re-issue with a valid id
  2. If the jail was expected, check whether another session/process removed it or the registry index failed to load
  3. Create the jail again if it was legitimately deleted but still needed
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/sandbox/cwd_jail/registry.rs:199 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/e636f01177bfc78d. Report an issue: GitHub.