{"record":{"id":"01dd396b65da653c","repo":"reflex-dev/reflex","slug":"security-review-detail-ex-response","errorCode":null,"errorMessage":"_security_review_detail(ex.response)","messagePattern":"_security_review_detail\\(ex\\.response\\)","errorType":"exception","errorClass":"SecurityReviewError","httpStatus":null,"severity":"error","filePath":"packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py","lineNumber":2433,"sourceCode":"    if not isinstance(client, AuthenticatedClient):\n        raise NotAuthenticatedError(\"not authenticated\")\n\n    auth = authorization_header(client.token)\n\n    # 1. Ask the API for a presigned URL to upload the archive directly.\n    upload_url_response = httpx.post(\n        urljoin(\n            constants.Hosting.HOSTING_SERVICE,\n            f\"{_SECURITY_REVIEW_PREFIX}/jobs/upload-url\",\n        ),\n        json={\"content_length\": len(zip_bytes), \"content_type\": \"application/zip\"},\n        headers=auth,\n        timeout=constants.Hosting.TIMEOUT,\n    )\n    try:\n        upload_url_response.raise_for_status()\n    except httpx.HTTPStatusError as ex:\n        raise SecurityReviewError(_security_review_detail(ex.response)) from ex\n    upload = upload_url_response.json()\n\n    # 2. Upload the bytes to storage, under the length and type the URL pins.\n    try:\n        presigned_put(upload, zip_bytes, len(zip_bytes))\n    except httpx.HTTPStatusError as ex:\n        raise SecurityReviewError(\"failed to upload app source for review\") from ex\n\n    # 3. Submit the uploaded object for review.\n    response = httpx.post(\n        urljoin(constants.Hosting.HOSTING_SERVICE, f\"{_SECURITY_REVIEW_PREFIX}/jobs\"),\n        json={\"key\": upload[\"key\"]},\n        headers=auth,\n        timeout=constants.Hosting.TIMEOUT,\n    )\n    try:\n        response.raise_for_status()\n    except httpx.HTTPStatusError as ex:","sourceCodeStart":2415,"sourceCodeEnd":2451,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py#L2415-L2451","documentation":"Raised when the initial request for a presigned upload URL during security-review submission returns an HTTP error status. The server-provided detail (parsed by _security_review_detail) is surfaced inside SecurityReviewError.","triggerScenarios":"The POST requesting the presigned URL fails raise_for_status: e.g. 401/403 (bad token despite client type), 404 (app not found), 429 (rate limit), 5xx.","commonSituations":"Expired/revoked token; app_id not registered; rate-limited repeated scans; hosting service incident.","solutions":["Inspect the detail text in the message to identify the status code and act (re-login for 401/403)","Confirm the app exists via `reflex app list`","Wait and retry if rate-limited (429) or during a 5xx incident","Update reflex-hosting-cli"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    submit_security_review(...)\nexcept SecurityReviewError as ex:\n    detail = str(ex)\n    if '401' in detail or '403' in detail:\n        relogin_and_retry()\n    elif '429' in detail:\n        sleep_and_retry()","preventionTips":["Keep tokens fresh — client type alone doesn't guarantee the token is valid","Handle rate limits with backoff around scan submissions"],"tags":["security-review","http-status-error","hosting","upload"],"backgroundTag":"presigned-upload-failed","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}