zeroclaw-labs/zeroclaw · error · anyhow::Error
Cron job '{id}' not found
Error message
Cron job '{id}' not found What it means
Error "Cron job '{id}' not found" thrown in zeroclaw-labs/zeroclaw.
Source
Thrown at crates/zeroclaw-runtime/src/cron/store.rs:292
.collect();
match matches.len() {
0 => anyhow::bail!("No cron job found with id or name '{id_or_name}'"),
1 => Ok(matches[0].id.clone()),
n => anyhow::bail!(
"Ambiguous name '{id_or_name}': matched {n} jobs — use the job ID instead"
),
}
}
pub fn remove_job(config: &Config, id: &str) -> Result<()> {
let changed = with_initialized_connection(config, |conn| {
conn.execute("DELETE FROM cron_jobs WHERE id = ?1", params![id])
.context("Failed to delete cron job")
})?;
if changed == 0 {
anyhow::bail!("Cron job '{id}' not found");
}
::zeroclaw_log::record!(
INFO,
::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Delete)
.with_category(::zeroclaw_log::EventCategory::Cron)
.with_outcome(::zeroclaw_log::EventOutcome::Success)
.with_attrs(::serde_json::json!({"job_id": id})),
"Removed cron job"
);
Ok(())
}
/// Cron jobs owned by `agent_alias`, for the agent-deletion export-then-delete
/// archive
pub fn list_jobs_by_agent(config: &Config, agent_alias: &str) -> Result<Vec<CronJob>> {
let Some(jobs) = with_read_connection(config, |conn| {
let mut stmt = conn.prepare(View on GitHub (pinned to 88bb9c8533)
Solutions
- Verify the job ID exists (list cron jobs) before operating on it.
When it happens
Trigger: Thrown at crates/zeroclaw-runtime/src/cron/store.rs:292 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/2b74a68c3ac53356.
Report an issue: GitHub.