Significant-Gravitas/AutoGPT · error · HTTPException
Media storage is not configured
Error message
Media storage is not configured
What it means
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.
Source
Thrown at autogpt_platform/backend/backend/api/features/oauth.py:700
- Allowed formats: JPEG, PNG, WebP
- Maximum file size: 3MB
The image is uploaded to cloud storage and the app's logoUrl is updated.
Returns the updated application info.
"""
# Verify ownership to reduce vulnerability to DoS(torage) or DoM(oney) attacks
if (
not (app := await get_oauth_application_by_id(app_id))
or app.owner_id != user_id
):
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail="OAuth App not found",
)
# Check GCS configuration
if not settings.config.media_gcs_bucket_name:
raise HTTPException(
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
detail="Media storage is not configured",
)
# Validate content type
content_type = file.content_type
if content_type not in LOGO_ALLOWED_TYPES:
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=f"Invalid file type. Allowed: JPEG, PNG, WebP. Got: {content_type}",
)
# Read file content
try:
file_bytes = await file.read()
except Exception as e:
logger.error(f"Error reading logo file: {e}")
raise HTTPException(View on GitHub (pinned to 9c8bb5550f)
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
Example fix
# .env / environment # before: MEDIA_GCS_BUCKET_NAME unset # after MEDIA_GCS_BUCKET_NAME=my-media-bucket MEDIA_GCS_KEY=en...
Defensive patterns
Strategy: validation
Validate before calling
if not settings.config.media_gcs_bucket_name:
raise RuntimeError("media storage unconfigured — logo upload unavailable") Type guard
def media_storage_configured(bucket: str | None) -> bool:
return bool(bucket) Try / catch
if resp.status_code == 503:
disable_logo_upload_ui() # instance capability, not user error Prevention
- 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
When it happens
Trigger: POSTing a logo upload on a self-hosted deployment where the MEDIA_GCS_BUCKET_NAME (media storage) settings are not set.
Common situations: Fresh self-hosted installs without GCS credentials; missing env vars in docker-compose/.env; production config not applied to a new environment.
Related errors
- chat_transport_not_configured
- Otto service is not configured
- Payment redirect URLs cannot be validated: frontend_base_url
- Webhook not configured
- Integration with provider '{provider_name}' is not configure
AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14).
Data as JSON: /api/errors/792494e93d613f7a.
Report an issue: GitHub.