{"record":{"id":"4fcaa59ec56fa476","repo":"langgenius/dify","slug":"account-in-freeze-4fcaa5","errorCode":"account_in_freeze","errorMessage":"This email account has been deleted within the past 30 daysand is temporarily unavailable for new account registration.","messagePattern":"This email account has been deleted within the past 30 daysand is temporarily unavailable for new account registration\\.","errorType":"error_code","errorClass":"AccountInFreezeError","httpStatus":400,"severity":"warning","filePath":"api/controllers/console/auth/email_register.py","lineNumber":105,"sourceCode":"    @email_password_login_enabled\n    @email_register_enabled\n    @console_ns.expect(console_ns.models[EmailRegisterSendPayload.__name__])\n    @console_ns.response(200, \"Success\", console_ns.models[SimpleResultDataResponse.__name__])\n    @model_validate(EmailRegisterSendPayload)\n    def post(self, req_data: EmailRegisterSendPayload):\n        normalized_email = req_data.email.lower()\n\n        ip_address = extract_remote_ip(request)\n        if AccountService.is_email_send_ip_limit(ip_address):\n            raise EmailSendIpLimitError()\n        language = \"en-US\"\n        if req_data.language is not None and req_data.language in languages:\n            language = req_data.language\n\n        if dify_config.DEPLOYMENT_EDITION == DeploymentEdition.CLOUD and BillingService.is_email_in_freeze(\n            normalized_email\n        ):\n            raise AccountInFreezeError()\n\n        account = AccountService.get_account_by_email_with_case_fallback(req_data.email, session=db.session())\n        token = AccountService.send_email_register_email(email=normalized_email, account=account, language=language)\n        return {\"result\": \"success\", \"data\": token}\n\n\n@console_ns.route(\"/email-register/validity\")\nclass EmailRegisterCheckApi(Resource):\n    @setup_required\n    @email_password_login_enabled\n    @email_register_enabled\n    @console_ns.expect(console_ns.models[EmailRegisterValidityPayload.__name__])\n    @console_ns.response(200, \"Success\", console_ns.models[VerificationTokenResponse.__name__])\n    @model_validate(EmailRegisterValidityPayload)\n    def post(self, req_data: EmailRegisterValidityPayload):\n\n        user_email = req_data.email.lower()\n","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/auth/email_register.py#L87-L123","documentation":"Raised by AccountInFreezeError inside EmailRegisterSendApi.post on Dify CLOUD edition only. BillingService.is_email_in_freeze marks an email as unavailable for new registration for 30 days after the associated account was deleted. This is a deliberate anti-abuse / billing protection, not a transient failure — the same email cannot re-register until the freeze window elapses. Self-hosted (COMMUNITY/EE) deployments never trigger this path because the guard is gated on DEPLOYMENT_EDITION == CLOUD.","triggerScenarios":"POST /console/api/email-register/email-send with an email whose account was deleted within the last 30 days, against a CLOUD deployment. The check fires after the IP rate-limit check and before the verification email is sent.","commonSituations":"User deleted their account and immediately tries to sign up again with the same address; QA/staging on dify.ai cloud reusing an email after deletion; email alias recycling. Not reproducible on self-hosted unless DEPLOYMENT_EDITION is set to CLOUD.","solutions":["Register with a different email address, or wait until the 30-day freeze expires.","If this is a legitimate re-registration need on an internal CLOUD instance, have an admin release the email from billing freeze via BillingService.","Confirm DEPLOYMENT_EDITION is intentionally CLOUD; on self-hosted this should be COMMUNITY or EE.","Handle the 'account_in_freeze' code in the UI to show a user-friendly 'try again later' message instead of a generic error."],"exampleFix":"// before: client retries registration immediately on any 400\nif (res.status === 400) alert('Registration failed');\n// after: branch on the error code\nif (res.status === 400 && body.code === 'account_in_freeze') {\n  alert('This email is temporarily locked. Try again after 30 days or use another email.');\n}","handlingStrategy":"validation","validationCode":"// Client cannot query billing freeze directly; validate context instead.\nconst CLOUD = deploymentEdition === 'CLOUD';\nif (CLOUD && recentlyDeletedEmails.has(email.toLowerCase())) {\n  showFreezeMessage(email);\n  return; // skip the API call\n}","typeGuard":null,"tryCatchPattern":"// In the API caller\ntry {\n  await emailSend({ email });\n} catch (e) {\n  if (e.code === 'account_in_freeze') showFreezeMessage();\n  else throw e;\n}","preventionTips":["Track locally which emails were deleted within 30 days and block re-registration client-side.","Confirm DEPLOYMENT_EDITION matches your intent (CLOUD vs self-hosted) before relying on this guard.","Surface the freeze code distinctly so users do not retry pointlessly."],"tags":["auth","registration","cloud-only","billing","rate-limit"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}