{"record":{"id":"8a1f371f56448940","repo":"reflex-dev/reflex","slug":"failed-to-upload-app-source-for-review","errorCode":null,"errorMessage":"failed to upload app source for review","messagePattern":"failed to upload app source for review","errorType":"exception","errorClass":"SecurityReviewError","httpStatus":null,"severity":"error","filePath":"packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py","lineNumber":2440,"sourceCode":"        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:\n        raise SecurityReviewError(_security_review_detail(ex.response)) from ex\n    return response.json()[\"job_id\"]\n\n\ndef get_security_review(job_id: str, client: AuthenticatedClient) -> dict[str, Any]:\n    \"\"\"Poll a previously submitted security review job.\n","sourceCodeStart":2422,"sourceCodeEnd":2458,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-hosting-cli/src/reflex_cli/utils/hosting.py#L2422-L2458","documentation":"Raised when uploading the zipped app source to the presigned storage URL fails with an HTTP status error during security-review submission. The presigned PUT pinned a content length and type; any status failure aborts with this generic message.","triggerScenarios":"presigned_put(upload, zip_bytes, len(zip_bytes)) returns 4xx/5xx — e.g. URL expired, length/content-type mismatch, signature error.","commonSituations":"Delay between fetching the presigned URL and uploading until expiry; zip bytes mutated; storage service error.","solutions":["Retry the scan — expired presigned URLs are transient","Update reflex-hosting-cli in case of upload contract changes","If persistent, check hosting service status"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    submit_security_review(...)\nexcept SecurityReviewError as ex:\n    if 'failed to upload app source for review' in str(ex):\n        retry_scan_once()  # presigned URLs expire transiently","preventionTips":["Submit promptly after building the zip to avoid presigned URL expiry","Retry once on upload failure before investigating"],"tags":["security-review","upload","presigned-url","storage"],"backgroundTag":"presigned-upload-failed","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}