{"record":{"id":"2b74a68c3ac53356","repo":"zeroclaw-labs/zeroclaw","slug":"cron-job-id-not-found","errorCode":null,"errorMessage":"Cron job '{id}' not found","messagePattern":"Cron job '(.+?)' not found","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/cron/store.rs","lineNumber":292,"sourceCode":"        .collect();\n\n    match matches.len() {\n        0 => anyhow::bail!(\"No cron job found with id or name '{id_or_name}'\"),\n        1 => Ok(matches[0].id.clone()),\n        n => anyhow::bail!(\n            \"Ambiguous name '{id_or_name}': matched {n} jobs — use the job ID instead\"\n        ),\n    }\n}\n\npub fn remove_job(config: &Config, id: &str) -> Result<()> {\n    let changed = with_initialized_connection(config, |conn| {\n        conn.execute(\"DELETE FROM cron_jobs WHERE id = ?1\", params![id])\n            .context(\"Failed to delete cron job\")\n    })?;\n\n    if changed == 0 {\n        anyhow::bail!(\"Cron job '{id}' not found\");\n    }\n\n    ::zeroclaw_log::record!(\n        INFO,\n        ::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Delete)\n            .with_category(::zeroclaw_log::EventCategory::Cron)\n            .with_outcome(::zeroclaw_log::EventOutcome::Success)\n            .with_attrs(::serde_json::json!({\"job_id\": id})),\n        \"Removed cron job\"\n    );\n    Ok(())\n}\n\n/// Cron jobs owned by `agent_alias`, for the agent-deletion export-then-delete\n/// archive\npub fn list_jobs_by_agent(config: &Config, agent_alias: &str) -> Result<Vec<CronJob>> {\n    let Some(jobs) = with_read_connection(config, |conn| {\n        let mut stmt = conn.prepare(","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/cron/store.rs#L274-L310","documentation":"Error \"Cron job '{id}' not found\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-runtime/src/cron/store.rs:292 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the job ID exists (list cron jobs) before operating on it."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}