{"record":{"id":"d5e03ef1205d2097","repo":"windmill-labs/windmill","slug":"worker-name-name-is-characters-more-than-t","errorCode":null,"errorMessage":"worker name '{name}' is {} characters, more than the {MAX_WORKER_NAME_LEN} a worker name may have: shorten WORKER_GROUP or WORKER_SUFFIX","messagePattern":"worker name '(.+?)' is (.+?) characters, more than the (.+?) a worker name may have: shorten WORKER_GROUP or WORKER_SUFFIX","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/windmill-common/src/utils.rs","lineNumber":455,"sourceCode":"    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\n/// The name is the `VARCHAR(255)` primary key of `worker_ping` and a component of the worker\n/// directory's path, and every part of it comes from the environment (`WORKER_GROUP`,\n/// hostname, `WORKER_SUFFIX`). A name that does not fit has to stop the process here rather\n/// than at the directory it creates or the initial ping it `expect`s.\npub fn checked_worker_name(\n    is_agent: bool,\n    worker_group: &str,\n    suffix: &str,\n) -> anyhow::Result<String> {\n    let name = worker_name_with_suffix(is_agent, worker_group, suffix);\n    if name.len() > MAX_WORKER_NAME_LEN {\n        return Err(anyhow::anyhow!(\n            \"worker name '{name}' is {} characters, more than the {MAX_WORKER_NAME_LEN} a worker \\\n            name may have: shorten WORKER_GROUP or WORKER_SUFFIX\",\n            name.len()\n        ));\n    }\n    Ok(name)\n}\n\npub fn retrieve_common_worker_prefix(worker_name: &str) -> String {\n    let (prefix, _) = worker_name.rsplit_once('-').unzip();\n\n    prefix\n        .expect(\"Invalid worker_name: expected at least one '-' in the name\")\n        .to_owned()\n}\n\npub fn paginate(pagination: Pagination) -> (usize, usize) {\n    let per_page = pagination","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-common/src/utils.rs#L437-L473","documentation":"`checked_worker_name` composes the final worker name (agent/worker group + suffix) and enforces MAX_WORKER_NAME_LEN. The name is stored in a VARCHAR(255) primary key, so a longer name would fail at DB insert time in a confusing way; Windmill refuses it upfront with a message telling the operator exactly which knobs to shorten. Called when constructing WorkerConn at worker startup.","triggerScenarios":"Starting a worker whose combined WORKER_GROUP + '_' + WORKER_SUFFIX (+ any agent prefix) exceeds MAX_WORKER_NAME_LEN (255) characters; the check fires in `checked_worker_name` before the worker pings the server.","commonSituations":"Long k8s StatefulSet/pod-derived group names combined with a long WORKER_SUFFIX; users attempting to encode region, environment, team and hardware details all into worker naming; suffix validation passing (952) but the group being very long.","solutions":["Shorten WORKER_GROUP and/or WORKER_SUFFIX until the composed name is ≤ MAX_WORKER_NAME_LEN (255) characters, as the error message advises.","Move descriptive metadata (region, team, hardware) out of the name into worker tags or labels used for routing instead.","Automate the guard: in your deployment manifest, assert `len(group) + len(suffix) + 1 <= 255` before rollout.","If the name is derived from a pod hostname, truncate or hash the variable part."],"exampleFix":"// before (helm values)\nworkerGroup: eu-west-1-production-heavy-duty-eds-processing\nworkerSuffix: workers_pool_a_2026\n// after\nworkerGroup: eu1_prod_hv\nworkerSuffix: pool_a","handlingStrategy":"validation","validationCode":"const MAX_WORKER_NAME_LEN = 255;\nconst name = `${agentPrefix ?? \"\"}${workerGroup}_${suffix}`;\nif (name.length > MAX_WORKER_NAME_LEN) {\n  throw new Error(`worker name '${name}' is ${name.length} chars; shorten WORKER_GROUP or WORKER_SUFFIX`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  connectWorker({ group: workerGroup, suffix });\n} catch (e) {\n  if (String(e).includes(\"more than the\")) {\n    console.error(\"Worker name exceeds VARCHAR(255); shorten WORKER_GROUP/WORKER_SUFFIX or move metadata to tags.\");\n  }\n  throw e;\n}","preventionTips":["Pre-check group+suffix length (+1 for the separator) in deployment scripts before rollout.","Keep WORKER_GROUP short; encode region/env/team as compact codes.","Use worker tags, not the name, for descriptive metadata.","Truncate or hash pod-hostname-derived name components."],"tags":["worker","configuration","limits","naming"],"backgroundTag":"name-too-long","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"}