Significant-Gravitas/AutoGPT · error · HTTPException
OAuth App not found
Error message
OAuth App not found
What it means
Returned (404) by the set-logo-URL endpoint when get_oauth_application_by_id(app_id) finds nothing or the found app's owner_id does not match the calling user. This is a pre-flight ownership check done before any storage or update work.
Source
Thrown at autogpt_platform/backend/backend/api/features/oauth.py:635
"""
Update the logo URL for an OAuth application.
Only the application owner can update the logo.
The logo should be uploaded first using the media upload endpoint,
then this endpoint is called with the resulting URL.
Logo requirements:
- Must be square (1:1 aspect ratio)
- Minimum 512x512 pixels
- Maximum 2048x2048 pixels
Returns the updated application info.
"""
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",
)
# Delete the current app logo file (if any and it's in our cloud storage)
await _delete_app_current_logo_file(app)
updated_app = await update_oauth_application(
app_id=app_id,
owner_id=user_id,
logo_url=request.logo_url,
)
if not updated_app:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail="Application not found or you don't have permission to update it",
)View on GitHub (pinned to 9c8bb5550f)
Solutions
- Verify the app exists and the current user owns it (re-fetch the app list) before submitting the logo URL
- Use the app id returned by the create/list API rather than a manually typed one
- Re-authenticate if the session user changed
Defensive patterns
Strategy: validation
Validate before calling
app = await get_oauth_application_by_id(app_id)
if app is None or app.owner_id != user_id:
raise PermissionError("not the app owner — abort before POST") Type guard
def is_app_owner(app: OAuthAppInfo | None, user_id: str) -> bool:
return app is not None and app.owner_id == user_id Try / catch
if resp.status_code == 404:
# either bad app_id or wrong user session — verify both before retry
pass Prevention
- Validate ownership client-side before any logo mutation
- Re-fetch the app right before the mutation to catch deletions
- Keep one authenticated session per browser profile
When it happens
Trigger: POST logo-url with a non-existent app_id, an app owned by someone else, or a user_id derived from an expired/mismatched auth session.
Common situations: Hard-coded app_id from another environment; app deleted between page load and submit; multiple accounts logged in in the same browser causing user id confusion.
Related errors
- Application not found or you don't have permission to update
- Graph #{graph_id} not found.
- Graph #{graph_id} not found.
- Session {session_id} not found.
- Webhook not found
AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14).
Data as JSON: /api/errors/759be2f85908b01e.
Report an issue: GitHub.