{"record":{"id":"76068c7e2a416af3","repo":"windmill-labs/windmill","slug":"this-forked-workspace-workspaceid-workspac","errorCode":null,"errorMessage":"This forked workspace '${workspaceId}' (${workspaceName}) already exists, possibly archived (archiving keeps the id reserved). Permanently delete it with \\`wmill workspace delete-fork ${workspaceId}\\` to reuse the id, or choose a different id","messagePattern":"This forked workspace '(.+?)' \\((.+?)\\) already exists, possibly archived \\(archiving keeps the id reserved\\)\\. Permanently delete it with \\\\`wmill workspace delete-fork (.+?)\\\\` to reuse the id, or choose a different id","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/workspace/fork.ts","lineNumber":232,"sourceCode":"  if (effectiveName.length > 50) {\n    throw new Error(\n      `Fork workspace name is too long (${effectiveName.length} chars; max 50). Choose a shorter name.`\n    );\n  }\n  let alreadyExists = false;\n  try {\n    alreadyExists = await wmill.existsWorkspace({\n      requestBody: { id: trueWorkspaceId },\n    });\n  } catch (e) {\n    log.info(\n      colors.red.bold(\"! Credentials or instance is invalid. Aborting.\")\n    );\n    throw e;\n  }\n\n  if (alreadyExists) {\n    throw new Error(\n      `This forked workspace '${workspaceId}' (${workspaceName}) already exists, possibly archived (archiving keeps the id reserved). ` +\n      `Permanently delete it with \\`wmill workspace delete-fork ${workspaceId}\\` to reuse the id, or choose a different id`,\n    );\n  }\n\n  // --- Datatable cloning (matches ForkDatatableSection.svelte) ---\n  interface ForkedDatatableInfo {\n    name: string;\n    new_dbname: string;\n  }\n  const forkedDatatables: ForkedDatatableInfo[] = [];\n\n  let datatables: Awaited<ReturnType<typeof wmill.listDataTables>> = [];\n  try {\n    datatables = await wmill.listDataTables({\n      workspace: workspace.workspaceId,\n    });\n  } catch (e) {","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/workspace/fork.ts#L214-L250","documentation":"Before creating the fork, the CLI checks `wmill.existsWorkspace` for the fork id (wm-fork-<id>). The id already exists on the instance — possibly as an archived workspace, since archiving reserves the id — so creating it again would collide. The error tells you to permanently delete the old fork or pick a different id.","triggerScenarios":"Re-running `wmill workspace fork` with the same workspaceId after a previous fork (or archived fork) exists; a leftover fork from an earlier experiment; fork branch recreated locally while the remote fork workspace was archived rather than deleted.","commonSituations":"Retrying a failed fork run that got far enough to create the workspace; team convention reusing ids across branches; restoring an old branch whose fork workspace still exists server-side (possibly archived).","solutions":["Permanently delete the existing fork: `wmill workspace delete-fork <workspaceId>`, then re-run the fork command","Choose a different workspaceId (e.g. suffix with a date or ticket number)","If the fork is archived and still wanted, unarchive it instead of recreating"],"exampleFix":"// before\nwmill workspace fork myfeature my-fork  # wm-fork-my-fork already exists\n// after\nwmill workspace delete-fork my-fork\nwmill workspace fork myfeature my-fork","handlingStrategy":"try-catch","validationCode":"const trueId = `wm-fork-${workspaceId}`;\nconst exists = await wmill.existsWorkspace({ requestBody: { id: trueId } }).catch(() => true);\nif (exists) {\n  console.error(`Fork id '${workspaceId}' already exists — run 'wmill workspace delete-fork ${workspaceId}' or pick another id.`);\n  process.exit(1);\n}\nawait createWorkspaceFork(opts, name, workspaceId);","typeGuard":"null","tryCatchPattern":"try {\n  await createWorkspaceFork(opts, name, id);\n} catch (e) {\n  if ((e as Error).message.includes('already exists, possibly archived')) {\n    const m = (e as Error).message.match(/delete-fork ([\\w-]+)/);\n    if (m) console.log(`Remedy: wmill workspace delete-fork ${m[1]}`);\n  } else throw e;\n}","preventionTips":["Use unique fork ids (ticket number, timestamp suffix) instead of reusing names","After archiving a fork, remember the id stays reserved — delete-fork to free it","Check `wmill workspace list` (including archived) before retrying a failed fork run"],"tags":["conflict","workspace-fork","cli","duplicate-id"],"backgroundTag":"workspace-id-already-exists","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"}