{"record":{"id":"25dda809b94a5157","repo":"langgenius/dify","slug":"account-in-freeze-25dda8","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":"error","filePath":"api/controllers/console/auth/login.py","lineNumber":129,"sourceCode":"class LoginApi(Resource):\n    \"\"\"Resource for user login.\"\"\"\n\n    @setup_required\n    @email_password_login_enabled\n    @console_ns.expect(console_ns.models[LoginPayload.__name__])\n    @console_ns.response(200, \"Success\", console_ns.models[SimpleResultOptionalDataResponse.__name__])\n    @decrypt_password_field\n    @model_validate(LoginPayload)\n    def post(self, req_data: LoginPayload):\n        \"\"\"Authenticate user and login.\"\"\"\n        request_email = req_data.email\n        normalized_email = request_email.lower()\n\n        if dify_config.DEPLOYMENT_EDITION == DeploymentEdition.CLOUD and BillingService.is_email_in_freeze(\n            normalized_email\n        ):\n            _log_console_login_failure(email=normalized_email, reason=LoginFailureReason.ACCOUNT_IN_FREEZE)\n            raise AccountInFreezeError()\n\n        is_login_error_rate_limit = AccountService.is_login_error_rate_limit(normalized_email)\n        if is_login_error_rate_limit:\n            _log_console_login_failure(email=normalized_email, reason=LoginFailureReason.LOGIN_RATE_LIMITED)\n            raise EmailPasswordLoginLimitError()\n\n        invite_token = req_data.invite_token\n        invitation_data: InvitationDetailDict | None = None\n        if invite_token:\n            invitation_data = RegisterService.get_invitation_with_case_fallback(\n                None, request_email, invite_token, session=db.session()\n            )\n            if invitation_data is None:\n                invite_token = None\n\n        try:\n            if invitation_data:\n                data = invitation_data.get(\"data\", {})","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/auth/login.py#L111-L147","documentation":"Raised at the very top of POST /console/api/login (HTTP 400, code account_in_freeze) when DEPLOYMENT_EDITION is CLOUD and BillingService.is_email_in_freeze(email) returns true. The billing service calls GET /account/in-freeze on the internal billing API; a true response means the email was used by an account deleted within the last 30 days and is blocked from re-registration/login.","triggerScenarios":"POST /console/api/login with an email whose corresponding account was deleted less than 30 days ago on Dify Cloud. Only fires when dify_config.DEPLOYMENT_EDITION == DeploymentEdition.CLOUD. The billing service /account/in-freeze endpoint returns data:true.","commonSituations":"User deleted their Dify Cloud account and immediately tried to log back in or re-register using the same email; test/staging environments pointed at a cloud billing backend where accounts were churned; billing API misconfiguration returning true for emails incorrectly flagged as frozen.","solutions":["Wait for the 30-day freeze window to elapse, then retry login or registration.","Contact Dify Cloud support to manually clear the freeze on the email if the deletion was accidental.","If self-hosted but seeing this, verify DEPLOYMENT_EDITION is not incorrectly set to CLOUD, and confirm the billing service endpoint is reachable and returning correct data.","Check BillingService.is_email_in_freeze connectivity (the _send_request base URL / auth token) if the freeze state looks wrong."],"exampleFix":"# before\nif dify_config.DEPLOYMENT_EDITION == DeploymentEdition.CLOUD and BillingService.is_email_in_freeze(email):\n    raise AccountInFreezeError()\n# after - guard and log the underlying billing lookup for diagnosis\nif dify_config.DEPLOYMENT_EDITION == DeploymentEdition.CLOUD:\n    try:\n        if BillingService.is_email_in_freeze(normalized_email):\n            raise AccountInFreezeError()\n    except Exception:\n        logger.exception('billing in-freeze check failed for %s', normalized_email)","handlingStrategy":"validation","validationCode":"# Client-side: if you know the account was recently deleted, skip login\n# and tell the user to wait. Server operators can pre-check:\nfrom services.billing_service import BillingService\nfrom configs import dify_config\nfrom enums import DeploymentEdition\n\ndef can_attempt_login(email: str) -> bool:\n    if dify_config.DEPLOYMENT_EDITION == DeploymentEdition.CLOUD:\n        return not BillingService.is_email_in_freeze(email.lower())\n    return True","typeGuard":"null","tryCatchPattern":"from controllers.console.error import AccountInFreezeError\ntry:\n    login(email, password)\nexcept AccountInFreezeError:\n    inform_user('Email is in a 30-day deletion cooldown; retry later or contact support.')","preventionTips":["Communicate the 30-day cooldown at account-deletion time so users expect it.","Keep DEPLOYMENT_EDITION accurate for your install to avoid false freeze checks.","Monitor BillingService /account/in-freeze error rates; the method swallows exceptions and defaults to not-frozen."],"tags":["auth","login","account","cloud-only","billing","freeze"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}