{"record":{"id":"2ee330a984c5d170","repo":"makeplane/plane","slug":"5030","errorCode":"5030","errorMessage":"USER_ALREADY_EXIST","messagePattern":"USER_ALREADY_EXIST","errorType":"exception","errorClass":"AuthenticationException","httpStatus":null,"severity":"error","filePath":"apps/api/plane/authentication/provider/credentials/email.py","lineNumber":45,"sourceCode":"        (ENABLE_EMAIL_PASSWORD,) = get_configuration_value([\n            {\n                \"key\": \"ENABLE_EMAIL_PASSWORD\",\n                \"default\": os.environ.get(\"ENABLE_EMAIL_PASSWORD\"),\n            }\n        ])\n\n        if ENABLE_EMAIL_PASSWORD == \"0\":\n            raise AuthenticationException(\n                error_code=AUTHENTICATION_ERROR_CODES[\"EMAIL_PASSWORD_AUTHENTICATION_DISABLED\"],\n                error_message=\"EMAIL_PASSWORD_AUTHENTICATION_DISABLED\",\n            )\n\n    def set_user_data(self):\n        if self.is_signup:\n            # Check if the user already exists\n            if User.objects.filter(email=self.key).exists():\n                self.logger.warning(\"User already exists\")\n                raise AuthenticationException(\n                    error_message=\"USER_ALREADY_EXIST\",\n                    error_code=AUTHENTICATION_ERROR_CODES[\"USER_ALREADY_EXIST\"],\n                )\n\n            super().set_user_data({\n                \"email\": self.key,\n                \"user\": {\n                    \"avatar\": \"\",\n                    \"first_name\": \"\",\n                    \"last_name\": \"\",\n                    \"provider_id\": \"\",\n                    \"is_password_autoset\": False,\n                },\n            })\n            return\n        else:\n            user = User.objects.filter(email=self.key).first()\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/api/plane/authentication/provider/credentials/email.py#L27-L63","documentation":"Raised in EmailProvider.set_user_data (email.py:45) during signup when User.objects.filter(email=self.key).exists() is True. It prevents creating a duplicate account for an email that is already registered, with code 5030. Note: this path only runs when is_signup is True.","triggerScenarios":"Calling the sign-up flow (is_signup=True) with an email that already has a User row triggers the warning log 'User already exists' and AuthenticationException code 5030. The duplicate check is a direct existence query before any user creation.","commonSituations":"User who already registered tries to sign up again instead of signing in; a script reposts the signup form; case-sensitivity quirks where the stored email differs only in case (depends on DB collation).","solutions":["Redirect the user to the sign-in flow — they already have an account.","If the intent is password reset, use the reset-password flow rather than re-signing up.","Check for case-variant duplicates in the User table if the email 'looks' new to the user."],"exampleFix":"// before: POST /api/users/me/  (signup) with existing email -> 5030\n// after: POST to the sign-in endpoint instead, or trigger password reset","handlingStrategy":"validation","validationCode":"from plane.db.models import User\n\ndef can_signup(email: str) -> bool:\n    return not User.objects.filter(email=email).exists()","typeGuard":null,"tryCatchPattern":"try:\n    provider.set_user_data()\nexcept AuthenticationException as e:\n    if e.error_code == 5030:\n        redirect_to_signin(email)\n    else:\n        raise","preventionTips":["Check existence before offering signup.","Normalize emails to a canonical case before lookup to avoid case-variant duplicates."],"tags":["authentication","signup","duplicate","email-password"],"backgroundTag":null,"analyzedSha":"1c8a60f858d8472aa56e29994ec1c7926da2c6ce","analyzedAt":"2026-08-12T14:44:31.636Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}