{"record":{"id":"487e6bdba91fa740","repo":"windmill-labs/windmill","slug":"could-not-create-job-token","errorCode":null,"errorMessage":"could not create job token","messagePattern":"could not create job token","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/src/monitor.rs","lineNumber":5592,"sourceCode":"        if let Err(e) = job {\n            tracing::error!(\"Error getting queued job: {:?}\", e);\n            continue;\n        }\n        if let Some(job) = job.unwrap() {\n            let label = ephemeral_script_token_label(&job.permissioned_as, &job.created_by);\n            let token = create_token_for_owner(\n                &db,\n                &job.workspace_id,\n                &job.permissioned_as,\n                &label,\n                job_token_expiry_secs(&db, &job.workspace_id).await,\n                &job.permissioned_as_email,\n                &job.id,\n                None,\n                Some(format!(\"handle_zombie_jobs\")),\n            )\n            .await\n            .expect(\"could not create job token\");\n\n            let client = AuthedClient::new(\n                base_internal_url.to_string(),\n                job.workspace_id.to_string(),\n                token,\n                None,\n            );\n\n            let error_message = format!(\n                \"Job timed out after no ping from job since {} (ZOMBIE_JOB_TIMEOUT: {}, reason: {:?}).\\nThis likely means that the job died on worker {}, OOM are a common reason for worker crashes.\\nCheck the workers around the time of the last ping and the exit code if any.\",\n                job.last_ping.unwrap_or_default(),\n                *ZOMBIE_JOB_TIMEOUT,\n                error_kind.to_string(),\n                job.worker.clone().unwrap_or_default(),\n            );\n            let memory_peak = job.memory_peak.unwrap_or(0);\n            let (_, killpill_rx_never_used) = KillpillSender::new(1);\n            let _ = handle_job_error(","sourceCodeStart":5574,"sourceCodeEnd":5610,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/src/monitor.rs#L5574-L5610","documentation":"Fires in the monitor's ephemeral-job path when create_token_for_owner fails to mint the short-lived job token (label from ephemeral_script_token_label, expiry from job_token_expiry_secs) for a queued job. The underlying cause is a database failure during token insertion/lookup — the queued job itself could not be turned into an executable job.","triggerScenarios":"Thrown at backend/src/monitor.rs:5592 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check database connectivity and health from the worker/monitor","Look for DB constraint or capacity errors around the tokens table at that timestamp","Restart the worker if the DB was restarted underneath it"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}