windmill-labs/windmill · error
Backend constraint violation: (${workspace.remote}, ${worksp
Error message
Backend constraint violation: (${workspace.remote}, ${workspace.workspaceId}) already exists as "${backendConflict.name}". Use --force to overwrite. What it means
The local wmill.yaml already maps this (remote, workspaceId) pair under a different name; adding the same pair under a new name would violate the one-entry-per-workspace invariant the config file maintains, so it throws unless --force removes the old entry first.
Source
Thrown at cli/src/commands/workspace/workspace.ts:392
return false;
}
}
}
}
// Check 2: Same (remote, workspaceId) already exists with a different name
const backendConflict = existingWorkspaces.find(
(w) =>
w.remote === workspace.remote &&
w.workspaceId === workspace.workspaceId &&
w.name !== workspace.name
);
if (backendConflict) {
if (opts.force) {
// Remove the conflicting workspace before adding the new one
await removeWorkspace(backendConflict.name, true, opts);
} else {
throw new Error(
`Backend constraint violation: (${workspace.remote}, ${workspace.workspaceId}) already exists as "${backendConflict.name}". Use --force to overwrite.`
);
}
}
// Remove existing workspace with same name (if updating)
await removeWorkspace(workspace.name, true, opts);
// Add the new workspace
const filePath = await getWorkspaceConfigFilePath(opts.configDir);
const fh = await fsOpen(filePath, "a");
await fh.write(JSON.stringify(workspace) + "\n");
await fh.close();
return true;
}
export async function removeWorkspace(
name: string,View on GitHub (pinned to e474e8803c)
Solutions
- Use the existing workspace name instead of adding a duplicate.
- Rerun with --force to replace the old entry with the new name.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cli/src/commands/workspace/workspace.ts:392 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/416fa87a905ee3c2.
Report an issue: GitHub.