windmill-labs/windmill · error

could not create job token

Error message

could not create job token

What it means

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.

Source

Thrown at backend/src/monitor.rs:5592

        if let Err(e) = job {
            tracing::error!("Error getting queued job: {:?}", e);
            continue;
        }
        if let Some(job) = job.unwrap() {
            let label = ephemeral_script_token_label(&job.permissioned_as, &job.created_by);
            let token = create_token_for_owner(
                &db,
                &job.workspace_id,
                &job.permissioned_as,
                &label,
                job_token_expiry_secs(&db, &job.workspace_id).await,
                &job.permissioned_as_email,
                &job.id,
                None,
                Some(format!("handle_zombie_jobs")),
            )
            .await
            .expect("could not create job token");

            let client = AuthedClient::new(
                base_internal_url.to_string(),
                job.workspace_id.to_string(),
                token,
                None,
            );

            let error_message = format!(
                "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.",
                job.last_ping.unwrap_or_default(),
                *ZOMBIE_JOB_TIMEOUT,
                error_kind.to_string(),
                job.worker.clone().unwrap_or_default(),
            );
            let memory_peak = job.memory_peak.unwrap_or(0);
            let (_, killpill_rx_never_used) = KillpillSender::new(1);
            let _ = handle_job_error(

View on GitHub (pinned to e474e8803c)

Solutions

  1. Check database connectivity and health from the worker/monitor
  2. Look for DB constraint or capacity errors around the tokens table at that timestamp
  3. Restart the worker if the DB was restarted underneath it
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at backend/src/monitor.rs:5592 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/487e6bdba91fa740. Report an issue: GitHub.