{"record":{"id":"531da74bad9f044d","repo":"windmill-labs/windmill","slug":"worker-suffix-must-be-at-most-max-worker-suffix-l","errorCode":null,"errorMessage":"WORKER_SUFFIX must be at most {MAX_WORKER_SUFFIX_LABEL_LEN} characters, got {}","messagePattern":"WORKER_SUFFIX must be at most (.+?) characters, got (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-common/src/utils.rs","lineNumber":425,"sourceCode":"/// identity, and it already folds in the worker index. A `-` in the label would add a segment\n/// to the worker name, which [`retrieve_common_worker_prefix`] reads as the part to strip;\n/// rejected rather than rewritten, since the point of the label is that two different ones\n/// give two different names.\nfn create_labelled_worker_suffix(\n    hostname: &str,\n    label: &str,\n    index: usize,\n) -> anyhow::Result<String> {\n    if !label.chars().all(|c| c.is_ascii_alphanumeric() || c == '_') {\n        return Err(anyhow::anyhow!(\n            \"WORKER_SUFFIX must only contain ASCII letters, digits and underscores, got '{label}'\"\n        ));\n    }\n    // The worker name is a `VARCHAR(255)` primary key and a component of the worker\n    // directory's path: a label long enough to blow either only surfaces at the initial ping,\n    // which the worker `expect`s.\n    if label.len() > MAX_WORKER_SUFFIX_LABEL_LEN {\n        return Err(anyhow::anyhow!(\n            \"WORKER_SUFFIX must be at most {MAX_WORKER_SUFFIX_LABEL_LEN} characters, got {}\",\n            label.len()\n        ));\n    }\n    Ok(format!(\n        \"{}_{label}\",\n        create_stable_worker_suffix(hostname, index)\n    ))\n}\n\npub fn worker_name_with_suffix(is_agent: bool, worker_group: &str, suffix: &str) -> String {\n    if is_agent {\n        format!(\"{}-{}-{}\", AGENT_WORKER_NAME_PREFIX, worker_group, suffix)\n    } else {\n        format!(\"{}-{}-{}\", WORKER_NAME_PREFIX, worker_group, suffix)\n    }\n}\n","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-common/src/utils.rs#L407-L443","documentation":"`create_labelled_worker_suffix` enforces a maximum length (MAX_WORKER_SUFFIX_LABEL_LEN) on the WORKER_SUFFIX label. Because the label is embedded into the worker name — a VARCHAR(255) primary key — and into the worker directory path, an over-long label would only surface as a DB or filesystem failure at the first ping. Windmill fails fast with this error instead.","triggerScenarios":"Starting a worker with WORKER_SUFFIX set to a string longer than MAX_WORKER_SUFFIX_LABEL_LEN characters; `resolve_worker_suffix` → `create_labelled_worker_suffix` rejects it before the worker registers.","commonSituations":"Long descriptive labels like `WORKER_SUFFIX=eu_west_1_heavy_duty_eds_processing_workers`; CI-generated suffixes built by concatenating branch names, run IDs and timestamps; accidentally pasting a whole config line into the variable.","solutions":["Shorten WORKER_SUFFIX to at most MAX_WORKER_SUFFIX_LABEL_LEN characters.","If the label encodes multiple dimensions, use short codes (e.g. `eu1_hv`) instead of full words.","If uniqueness requires length, shift the extra information into WORKER_GROUP and shorten WORKER_GROUP too so the total worker name fits (see also the worker-name-length error).","Check for accidental content: the value may contain an entire line pasted by mistake — trim it."],"exampleFix":"// before\nWORKER_SUFFIX=europe_west_1_heavy_duty_eds_processing_workers_pool\n// after\nWORKER_SUFFIX=eu1_hv","handlingStrategy":"validation","validationCode":"const label = process.env.WORKER_SUFFIX ?? \"\";\nconst MAX = 255; // MAX_WORKER_SUFFIX_LABEL_LEN\nif (label.length > MAX) {\n  throw new Error(`WORKER_SUFFIX is ${label.length} chars; must be at most ${MAX}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  startWorker({ suffix: process.env.WORKER_SUFFIX });\n} catch (e) {\n  if (String(e).includes(\"WORKER_SUFFIX must be at most\")) {\n    console.error(\"Shorten WORKER_SUFFIX or move detail into WORKER_GROUP/tags.\");\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Keep WORKER_SUFFIX to short codes (≤ ~20 chars) in deployment templates.","Don't concatenate branch names/run IDs/timestamps into WORKER_SUFFIX.","Assert label length in CI before deploying worker manifests.","Check for accidental pasted content when the value looks unusually long."],"tags":["configuration","worker","validation","env"],"backgroundTag":"invalid-config-value","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"}