{"record":{"id":"7ced880e3b897db8","repo":"makeplane/plane","slug":"error-user-with-email-does-not-exist","errorCode":null,"errorMessage":"Error: User with {email} does not exist","messagePattern":"Error: User with (.+?) does not exist","errorType":"exception","errorClass":"CommandError","httpStatus":null,"severity":"error","filePath":"apps/api/plane/db/management/commands/reactivate_workspace_member.py","lineNumber":42,"sourceCode":"\n        # normalize before validating; emails are stored lowercased and stripped (User.save)\n        slug = slug.strip()\n        email = email.strip().lower()\n\n        # raise error if slug is not present\n        if not slug:\n            raise CommandError(\"Error: Workspace slug is required\")\n\n        # raise error if email is not present\n        if not email:\n            raise CommandError(\"Error: Email is required\")\n\n        # filter the user\n        user = User.objects.filter(email=email).first()\n\n        # Raise error if the user is not present\n        if not user:\n            raise CommandError(f\"Error: User with {email} does not exist\")\n\n        # filter the workspace\n        workspace = Workspace.objects.filter(slug=slug).first()\n\n        # Raise error if the workspace is not present\n        if not workspace:\n            raise CommandError(f\"Error: Workspace with slug {slug} does not exist\")\n\n        # Find the workspace membership (includes inactive members; soft-deleted are excluded by default manager)\n        workspace_member = WorkspaceMember.objects.filter(workspace=workspace, member=user).first()\n\n        # Raise error if the membership is not present\n        if not workspace_member:\n            raise CommandError(f\"Error: User {email} is not a member of workspace {slug}\")\n\n        # If already active, report without erroring\n        if workspace_member.is_active:\n            self.stdout.write(self.style.SUCCESS(f\"User {email} is already an active member of workspace {slug}\"))","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/api/plane/db/management/commands/reactivate_workspace_member.py#L24-L60","documentation":"Raised by `reactivate_workspace_member` when `User.objects.filter(email=email).first()` returns None (lines 38-42). The email (already lowercased and stripped) matches no `User` row. This command normalizes the email to lower case before lookup, so casing is handled correctly here — a miss means the user genuinely does not exist. Clean non-zero CommandError.","triggerScenarios":"Running `reactivate_workspace_member <slug> nobody@example.com` where no user has that email.","commonSituations":"User never signed up; deactivated-and-deleted user; wrong domain; typo.","solutions":["Verify the user: `python manage.py shell -c \"from plane.db.models import User; print(User.objects.filter(email='user@example.com').exists())\"`","Use the exact email (the command lowercases it, so case is not the issue here).","Have the user register/sign in first if no record exists."],"exampleFix":"# before\npython manage.py reactivate_workspace_member my-ws nonexistent@example.com\n# after\npython manage.py reactivate_workspace_member my-ws user@example.com","handlingStrategy":"validation","validationCode":"python manage.py shell -c \"from plane.db.models import User; import sys; sys.exit(0 if User.objects.filter(email='user@example.com').exists() else 1)\"","typeGuard":"def user_exists(email: str) -> bool:\n    from plane.db.models import User\n    return User.objects.filter(email=email.strip().lower()).exists()","tryCatchPattern":"try:\n    call_command('reactivate_workspace_member', slug, email)\nexcept CommandError as e:\n    if 'does not exist' in str(e):\n        # user not found — register/sign-in first\n        ...","preventionTips":["Confirm the user has signed in once.","The command lowercases the email; ensure the user truly exists.","Pre-check existence before invoking."],"tags":["django","management-command","validation","user-not-found","plane"],"backgroundTag":null,"analyzedSha":"1c8a60f858d8472aa56e29994ec1c7926da2c6ce","analyzedAt":"2026-08-12T14:44:31.636Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}