windmill-labs/windmill · error · Error

This forked workspace '${workspaceId}' (${workspaceName}) al

Error message

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

What it means

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.

Source

Thrown at cli/src/commands/workspace/fork.ts:232

  if (effectiveName.length > 50) {
    throw new Error(
      `Fork workspace name is too long (${effectiveName.length} chars; max 50). Choose a shorter name.`
    );
  }
  let alreadyExists = false;
  try {
    alreadyExists = await wmill.existsWorkspace({
      requestBody: { id: trueWorkspaceId },
    });
  } catch (e) {
    log.info(
      colors.red.bold("! Credentials or instance is invalid. Aborting.")
    );
    throw e;
  }

  if (alreadyExists) {
    throw new Error(
      `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`,
    );
  }

  // --- Datatable cloning (matches ForkDatatableSection.svelte) ---
  interface ForkedDatatableInfo {
    name: string;
    new_dbname: string;
  }
  const forkedDatatables: ForkedDatatableInfo[] = [];

  let datatables: Awaited<ReturnType<typeof wmill.listDataTables>> = [];
  try {
    datatables = await wmill.listDataTables({
      workspace: workspace.workspaceId,
    });
  } catch (e) {

View on GitHub (pinned to e474e8803c)

Solutions

  1. Permanently delete the existing fork: `wmill workspace delete-fork <workspaceId>`, then re-run the fork command
  2. Choose a different workspaceId (e.g. suffix with a date or ticket number)
  3. If the fork is archived and still wanted, unarchive it instead of recreating

Example fix

// before
wmill workspace fork myfeature my-fork  # wm-fork-my-fork already exists
// after
wmill workspace delete-fork my-fork
wmill workspace fork myfeature my-fork
Defensive patterns

Strategy: try-catch

Validate before calling

const trueId = `wm-fork-${workspaceId}`;
const exists = await wmill.existsWorkspace({ requestBody: { id: trueId } }).catch(() => true);
if (exists) {
  console.error(`Fork id '${workspaceId}' already exists — run 'wmill workspace delete-fork ${workspaceId}' or pick another id.`);
  process.exit(1);
}
await createWorkspaceFork(opts, name, workspaceId);

Type guard

null

Try / catch

try {
  await createWorkspaceFork(opts, name, id);
} catch (e) {
  if ((e as Error).message.includes('already exists, possibly archived')) {
    const m = (e as Error).message.match(/delete-fork ([\w-]+)/);
    if (m) console.log(`Remedy: wmill workspace delete-fork ${m[1]}`);
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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).

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/76068c7e2a416af3. Report an issue: GitHub.