{"record":{"id":"792494e93d613f7a","repo":"Significant-Gravitas/AutoGPT","slug":"media-storage-is-not-configured","errorCode":null,"errorMessage":"Media storage is not configured","messagePattern":"Media storage is not configured","errorType":"http","errorClass":"HTTPException","httpStatus":503,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/oauth.py","lineNumber":700,"sourceCode":"    - Allowed formats: JPEG, PNG, WebP\n    - Maximum file size: 3MB\n\n    The image is uploaded to cloud storage and the app's logoUrl is updated.\n    Returns the updated application info.\n    \"\"\"\n    # Verify ownership to reduce vulnerability to DoS(torage) or DoM(oney) attacks\n    if (\n        not (app := await get_oauth_application_by_id(app_id))\n        or app.owner_id != user_id\n    ):\n        raise HTTPException(\n            status_code=status.HTTP_404_NOT_FOUND,\n            detail=\"OAuth App not found\",\n        )\n\n    # Check GCS configuration\n    if not settings.config.media_gcs_bucket_name:\n        raise HTTPException(\n            status_code=status.HTTP_503_SERVICE_UNAVAILABLE,\n            detail=\"Media storage is not configured\",\n        )\n\n    # Validate content type\n    content_type = file.content_type\n    if content_type not in LOGO_ALLOWED_TYPES:\n        raise HTTPException(\n            status_code=status.HTTP_400_BAD_REQUEST,\n            detail=f\"Invalid file type. Allowed: JPEG, PNG, WebP. Got: {content_type}\",\n        )\n\n    # Read file content\n    try:\n        file_bytes = await file.read()\n    except Exception as e:\n        logger.error(f\"Error reading logo file: {e}\")\n        raise HTTPException(","sourceCodeStart":682,"sourceCodeEnd":718,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/oauth.py#L682-L718","documentation":"Returned (503 Service Unavailable) when the logo upload endpoint checks settings.config.media_gcs_bucket_name and finds it empty. The instance has no Google Cloud Storage bucket configured, so media uploads cannot be served.","triggerScenarios":"POSTing a logo upload on a self-hosted deployment where the MEDIA_GCS_BUCKET_NAME (media storage) settings are not set.","commonSituations":"Fresh self-hosted installs without GCS credentials; missing env vars in docker-compose/.env; production config not applied to a new environment.","solutions":["Set the media GCS bucket configuration (bucket name and credentials) in the backend settings/environment","Restart the backend after applying the configuration","If you do not intend to support uploads, avoid exposing the logo upload UI on that instance"],"exampleFix":"# .env / environment\n# before: MEDIA_GCS_BUCKET_NAME unset\n# after\nMEDIA_GCS_BUCKET_NAME=my-media-bucket\nMEDIA_GCS_KEY=en...","handlingStrategy":"validation","validationCode":"if not settings.config.media_gcs_bucket_name:\n    raise RuntimeError(\"media storage unconfigured — logo upload unavailable\")","typeGuard":"def media_storage_configured(bucket: str | None) -> bool:\n    return bool(bucket)","tryCatchPattern":"if resp.status_code == 503:\n    disable_logo_upload_ui()  # instance capability, not user error","preventionTips":["Gate upload UI features on a capabilities/config endpoint","Include media storage settings in deployment checklists","Fail deployment checks when a feature needs GCS but it is unconfigured"],"tags":["configuration","http-503","gcs","file-upload"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}