windmill-labs/windmill · error

Uuid parse error

Error message

Uuid parse error

What it means

queue_init_job POSTs to /api/agent_workers/queue_init_job expecting the server to return the new job id as a plain UUID string; parsing the response body with Uuid::parse_str failed. The generic 'Uuid parse error' (via anyhow!(e)) hides the actual body, which usually means the server returned an error page/message instead of a UUID.

Source

Thrown at backend/windmill-worker/src/agent_workers.rs:16

use reqwest::header::HeaderMap;
use uuid::Uuid;
use windmill_common::{
    agent_workers::QueueInitJob, worker::HttpClient, workspaces::DucklakeWithConnData,
};
use windmill_queue::{JobAndPerms, JobCompleted};

pub async fn queue_init_job(client: &HttpClient, content: &str) -> anyhow::Result<Uuid> {
    client
        .post(
            "/api/agent_workers/queue_init_job",
            None,
            &QueueInitJob { content: content.to_string() },
        )
        .await
        .and_then(|x: String| Uuid::parse_str(&x).map_err(|e| anyhow::anyhow!(e)))
}

pub async fn queue_periodic_job(client: &HttpClient, content: &str) -> anyhow::Result<Uuid> {
    client
        .post(
            "/api/agent_workers/queue_periodic_job",
            None,
            &QueueInitJob { content: content.to_string() },
        )
        .await
        .and_then(|x: String| Uuid::parse_str(&x).map_err(|e| anyhow::anyhow!(e)))
}

pub async fn pull_job(
    client: &HttpClient,
    headers: Option<HeaderMap>,
    body: Option<bool>,
) -> anyhow::Result<Option<JobAndPerms>> {

View on GitHub (pinned to e474e8803c)

Solutions

  1. Check the base URL the agent client points at — it must reach the windmill API directly, not a landing page/proxy
  2. Verify auth: unauthenticated requests may get redirect/error bodies
  3. Confirm the target windmill version has the agent_workers queue_init_job endpoint
  4. Log the raw response body on parse failure to see what was actually returned
Defensive patterns

Strategy: try-catch

Validate before calling

curl -sS -o /dev/null -w '%{http_code}' "$BASE_URL/api/agent_workers/queue_init_job"  # expect non-404/non-302
# ensure BASE_URL is the windmill API root, e.g. https://app.windmill.dev

Try / catch

let body = client
    .post("/api/agent_workers/queue_init_job", None, &payload)
    .await?;
let job_id = Uuid::parse_str(&body)
    .map_err(|e| anyhow!("unexpected response body {body:?}: {e}"))?;

Prevention

When it happens

Trigger: The HTTP call returns 2xx but with a non-UUID body (proxy/HTML response), or returns an error and the client still attempts UUID parsing on the error text.

Common situations: Agent pointed at a wrong URL behind a proxy that intercepts the request; server returning a JSON error body with a 200, or auth redirect HTML; version mismatch where the endpoint doesn't exist and a router fallback responds.

Understand the failure class

Related errors


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