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
- Check the base URL the agent client points at — it must reach the windmill API directly, not a landing page/proxy
- Verify auth: unauthenticated requests may get redirect/error bodies
- Confirm the target windmill version has the agent_workers queue_init_job endpoint
- 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
- Point the agent at the API root, not a proxied landing page
- Verify token validity before queuing
- Log raw response bodies on parse failures
- Confirm server version supports agent_workers endpoints
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
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Error requesting oidc token from {url}: {e:#?}
- HTTP agent request POST {} failed {}
- HTTP agent request GET {} failed {}
- HTTP agent request PUT {} failed {}
- ApiError with mapped HTTP status message (e.g. "Not Found",
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/abcb408c0c1935da.
Report an issue: GitHub.