{"record":{"id":"0203c75fc2cafd37","repo":"wasmerio/wasmer","slug":"cron-job-cron-job-not-found","errorCode":null,"errorMessage":"cron job '{cron_job}' not found","messagePattern":"cron job '(.+?)' not found","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"lib/backend-api/src/query.rs","lineNumber":501,"sourceCode":"                .then(|| cron.invocations.page_info.end_cursor.clone())\n                .flatten();\n\n            return Ok((\n                cron,\n                Paginated {\n                    items: invocations,\n                    next_cursor,\n                },\n            ));\n        }\n\n        if !page_info.has_next_page {\n            break;\n        }\n        cron_after = Some(page_info.end_cursor.context(\"cron jobs cursor missing\")?);\n    }\n\n    bail!(\"cron job '{cron_job}' not found\")\n}\n\n/// Retrieve one page of invocations for a cron job referenced by id.\npub async fn get_cron_job_invocations_page_by_id(\n    client: &WasmerClient,\n    cron_job_id: impl Into<String>,\n    invocation_after: Option<String>,\n    invocation_first: Option<i32>,\n    start: Option<OffsetDateTime>,\n    end: Option<OffsetDateTime>,\n) -> Result<\n    (\n        types::CronJobWithInvocationsById,\n        Paginated<types::CronJobInvocation>,\n    ),\n    anyhow::Error,\n> {\n    let cron_job_id = cron_job_id.into();","sourceCodeStart":483,"sourceCodeEnd":519,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/backend-api/src/query.rs#L483-L519","documentation":"get_cron_job_invocations_page paginates the backend API looking for a cron job with the given name; if the loop finishes without matching, it bails with \"cron job '{cron_job}' not found\". It means the queried registry/backend has no cron job with that identifier visible to the current credentials.","triggerScenarios":"Calling get_cron_job_invocations_page(client, name, ...) with a cron job name that does not exist, is misspelled, or belongs to another app/namespace/owner the token cannot see.","commonSituations":"Typo in the cron job name; cron job deleted or renamed; using a token scoped to a different namespace; environment mismatch (staging vs production registry).","solutions":["Verify the cron job name (list cron jobs for the app first via the backend API).","Check the auth token's scope/namespace matches the owner of the cron job.","Use get_cron_job_invocations_page_by_id with the resolved cron job ID instead of the name.","Confirm you are pointed at the right registry/endpoint (production vs staging)."],"exampleFix":"// before\nlet page = get_cron_job_invocations_page(&client, \"deploy-nightly\", window).await?;\n// after: resolve and check first\nlet jobs = list_cron_jobs(&client, app_id).await?;\nlet job = jobs.iter().find(|j| j.name == \"deploy-nightly\")\n    .context(\"cron job 'deploy-nightly' does not exist for this app\")?;\nlet page = get_cron_job_invocations_page_by_id(&client, job.id.clone(), window).await?;","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match get_cron_job_invocations_page(&client, name, window).await {\n    Ok(page) => page,\n    Err(e) if e.to_string().contains(\"not found\") => {\n        eprintln!(\"cron job '{name}' missing — listing available jobs...\");\n        // fall back to listing cron jobs or return a typed NotFound error\n        Default::default()\n    }\n    Err(e) => return Err(e),\n};","preventionTips":["List cron jobs and verify the name before querying invocations","Prefer cron job IDs (get_cron_job_invocations_page_by_id) over names","Keep tokens and endpoints aligned with the target environment"],"tags":["backend-api","graphql","not-found","cron"],"backgroundTag":"resource-not-found","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}