{"record":{"id":"e724397d48be17ce","repo":"windmill-labs/windmill","slug":"worker-group-config-with-the-name-c-name-alread","errorCode":null,"errorMessage":"Worker group config with the name ${c.name} already exists","messagePattern":"Worker group config with the name (.+?) already exists","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/routes/(root)/(logged)/workers/+page.svelte","lineNumber":358,"sourceCode":"\t\t\tselectedTab = configName\n\t\t\tshouldAutoOpenDrawer = configName\n\t\t\tsendUserToast(`Worker group ${configName} created`)\n\t\t} catch (err) {\n\t\t\tsendUserToast(`Could not create worker group: ${err}`, true)\n\t\t}\n\t}\n\n\tlet importConfigDrawer: Drawer | undefined = $state(undefined)\n\tlet importConfigCode = $state('')\n\tlet tag: string = $state('')\n\tasync function importSingleWorkerConfig(c: any) {\n\t\tif (typeof c === 'object' && c !== null) {\n\t\t\tif (!c.name || typeof c.name !== 'string') {\n\t\t\t\tthrow new Error('Invalid worker group config name')\n\t\t\t}\n\n\t\t\tif (workerGroups?.hasOwnProperty(c.name)) {\n\t\t\t\tthrow new Error(`Worker group config with the name ${c.name} already exists`)\n\t\t\t}\n\n\t\t\tawait ConfigService.updateConfig({\n\t\t\t\tname: 'worker__' + c.name,\n\t\t\t\trequestBody: { ...c, name: undefined }\n\t\t\t})\n\t\t} else {\n\t\t\tthrow new Error('Invalid worker group config')\n\t\t}\n\t}\n\n\tasync function importConfigFromYaml() {\n\t\tconst config = YAML.parse(importConfigCode)\n\n\t\ttry {\n\t\t\tif (Array.isArray(config)) {\n\t\t\t\tfor (const c of config) {\n\t\t\t\t\tawait importSingleWorkerConfig(c)","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/routes/(root)/(logged)/workers/+page.svelte#L340-L376","documentation":"During YAML worker-config import, after ensuring a config object has a valid name, importSingleWorkerConfig checks workerGroups (the existing groups) with hasOwnProperty. A duplicate name means the backend config key 'worker__<name>' already exists, so the import throws instead of silently overwriting.","triggerScenarios":"Importing a YAML whose worker group name collides with an existing worker group in the instance — e.g. re-importing the same export, or two entries/groups sharing a name.","commonSituations":"Re-running an import that already succeeded; merging exports from two instances that both define a 'default' group; copy-pasting an existing group and forgetting to rename it.","solutions":["Rename the duplicate group in the YAML (or in the workers page) before importing","Remove the already-existing group entry from the YAML if it should not be re-created","Delete/rename the existing worker group first if the import is meant to replace it","Use unique names per environment when merging configs from multiple instances"],"exampleFix":"// before\ngroups:\n  - name: default\n    concurrency: 5\n// after\ngroups:\n  - name: default-v2\n    concurrency: 5","handlingStrategy":"validation","validationCode":"const names = configs.map(c => c?.name).filter(Boolean)\nconst dupInFile = names.filter((n, i) => names.indexOf(n) !== i)\nconst dupExisting = names.filter(n => workerGroups?.hasOwnProperty(n))\nif (dupInFile.length || dupExisting.length) {\n  sendUserToast(`Duplicate worker group names: ${[...new Set([...dupInFile, ...dupExisting])].join(', ')}`, true)\n  return\n}","typeGuard":null,"tryCatchPattern":"try {\n  await importConfigFromYaml()\n} catch (e) {\n  if (e.message.startsWith('Worker group config with the name')) {\n    const name = e.message.match(/name (.*) already/)?.[1]\n    sendUserToast(`Rename group \"${name}\" in the YAML or delete the existing one first`, true)\n  } else throw e\n}","preventionTips":["Deduplicate names within the YAML before import","Prefix names per environment when merging exports from multiple instances","Offer an 'overwrite' mode explicitly rather than failing silently or hard","Diff imported names against existing workerGroups in the UI before submitting"],"tags":["validation","workers","duplicate","import"],"backgroundTag":"duplicate-resource-name","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"}