{"record":{"id":"b8a7cc8d741e8c13","repo":"reflex-dev/reflex","slug":"deployment-failed-ex-details","errorCode":null,"errorMessage":"deployment failed: {ex_details}","messagePattern":"deployment failed: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py","lineNumber":1512,"sourceCode":"        urljoin(constants.Hosting.HOSTING_SERVICE, \"/api/v1/apps/reserve\"),\n        headers=authorization_header(client.token),\n        json=data,\n        timeout=constants.Hosting.TIMEOUT,\n    )\n    try:\n        response.raise_for_status()\n    except httpx.HTTPStatusError as ex:\n        if ex.response.status_code == 413:\n            raise Exception(\n                \"deployment failed: the deployment payload is too large (over 100MB). \"\n                \"Please reduce the size of your project by removing large files or \"\n                \"adding them to your .gitignore file.\"\n            ) from ex\n        try:\n            ex_details = ex.response.json().get(\"detail\")\n            if ex_details == \"hostname taken\":\n                return {\"error\": \"hostname taken\"}\n            raise Exception(f\"deployment failed: {ex_details}\") from ex\n        except (ValueError, AttributeError):\n            # Response is not valid JSON or missing detail field\n            raise Exception(\n                f\"deployment failed: HTTP {ex.response.status_code} - {ex.response.text}\"\n            ) from ex\n    response_json = response.json()\n    return response_json\n\n\ndef extract_subdomain(url: str):\n    \"\"\"Extract the subdomain from a given URL.\n\n    Args:\n        url: The URL to extract the subdomain from.\n\n    Returns:\n        str | None: The extracted subdomain, or None if extraction fails.\n","sourceCodeStart":1494,"sourceCodeEnd":1530,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py#L1494-L1530","documentation":"Raised by get_hostname when the reserve request fails with a JSON `detail` message other than the special 'hostname taken' case. The server's detail string is embedded so the specific failure (auth, quota, project config, etc.) is visible.","triggerScenarios":"Any non-2xx reserve response with a JSON body containing `detail` — e.g. invalid app configuration, project limits reached, or server-side validation failures during `reflex deploy`.","commonSituations":"Deploying an app in a bad state; exceeding plan limits; server-side policy changes returning structured errors.","solutions":["Read the embedded `detail` message — it identifies the exact server-side reason","Fix the reported issue (app config, limits, project selection) and retry the deploy","If the detail is unclear, run `reflex deploy` with verbose/debug logging enabled and check the hosting dashboard for app state"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = get_hostname(client, app_id, app_name, hostname=hostname)\nexcept Exception as e:\n    detail = str(e).removeprefix(\"deployment failed: \")\n    # branch on the server-provided detail message\n    handle(detail)","preventionTips":["Keep app config valid before deploy","Watch the embedded detail text — it carries the server's reason","Log full exception messages in deploy automation"],"tags":["reflex","hosting","deploy","api-error"],"backgroundTag":"api-error-detail-response","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}