{"record":{"id":"8ba881148090ea1c","repo":"reflex-dev/reflex","slug":"deployment-failed-http-ex-response-status-code","errorCode":null,"errorMessage":"deployment failed: HTTP {ex.response.status_code} - {ex.response.text}","messagePattern":"deployment failed: HTTP (.+?) - (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py","lineNumber":1515,"sourceCode":"        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\n    \"\"\"\n    from urllib.parse import urlparse\n","sourceCodeStart":1497,"sourceCodeEnd":1533,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py#L1497-L1533","documentation":"Raised by get_hostname when a failed reserve response has no parseable JSON detail — the raw HTTP status code and body text are wrapped into the exception instead. This is the fallback error shape for unexpected server responses.","triggerScenarios":"The hosting service returns a non-2xx with an HTML/plain-text body (proxy error page, 502/503 from a gateway, or a malformed JSON body) during hostname reservation/deploy.","commonSituations":"Transient hosting-service outages; Cloudflare/proxy error pages masking the API; partial maintenance-window responses.","solutions":["Retry the deploy after a short wait — transient 5xx/gateway errors usually resolve","Check the Reflex hosting status page/dashboard for ongoing incidents","If persistent, capture the status code and body from the message and report to Reflex support"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for attempt in range(3):\n    try:\n        result = get_hostname(client, app_id, app_name)\n        break\n    except Exception as e:\n        if \"HTTP 5\" in str(e) and attempt < 2:\n            time.sleep(2 ** attempt)\n            continue\n        raise","preventionTips":["Retry deploys on transient gateway errors with backoff","Check hosting status during incidents","Treat non-JSON error bodies as transient unless repeated"],"tags":["reflex","hosting","deploy","http-error","gateway"],"backgroundTag":"http-error-response","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}