{"record":{"id":"22ef4146cbb913d2","repo":"windmill-labs/windmill","slug":"invalid-role-for-user-email-localuser-role","errorCode":null,"errorMessage":"Invalid role for user ${email}: ${localUser.role}","messagePattern":"Invalid role for user (.+?): (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/user/user.ts","lineNumber":146,"sourceCode":"\ninterface SimplifiedUser {\n  role: string;\n  username: string;\n  disabled: boolean;\n}\n\nexport async function pushWorkspaceUser(\n  workspace: string,\n  path: string,\n  user: SimplifiedUser | undefined,\n  localUser: SimplifiedUser\n): Promise<void> {\n  const email = removePathPrefix(removeType(path, \"user\"), \"users\");\n\n  log.debug(`Processing local user ${email}`);\n\n  if (![\"operator\", \"developer\", \"admin\"].includes(localUser.role)) {\n    throw new Error(`Invalid role for user ${email}: ${localUser.role}`);\n  }\n\n  try {\n    const remoteUser = await wmill.getUser({\n      workspace,\n      username: localUser.username,\n    });\n    user = {\n      role: remoteUser.is_admin\n        ? \"admin\"\n        : remoteUser.operator\n        ? \"operator\"\n        : \"developer\",\n      username: remoteUser.username,\n      disabled: remoteUser.disabled,\n    };\n    log.debug(`User ${email} exists on remote`);\n  } catch {","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/user/user.ts#L128-L164","documentation":"Thrown by pushWorkspaceUser during workspace user sync when the local user YAML declares a role outside the allowed set (operator, developer, admin). This is a local-input validation guard: the faulting input is the `role` field in the local user file being pushed, not any remote condition. Rejecting early prevents creating or updating the workspace member with an invalid role.","triggerScenarios":"Thrown at cli/src/commands/user/user.ts:146 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set role to operator, developer, or admin in the user's .user.yaml file.","Check for typos like 'operater' or capitalized roles."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}