Significant-Gravitas/AutoGPT · error · HTTPException

Provider '{provider}' not found

Error message

Provider '{provider}' not found

What it means

Raised (HTTP 404) by the external OAuth initiate endpoint when the `provider` path parameter is neither a member of the `ProviderName` enum nor a dynamically registered provider key in `HANDLERS_BY_NAME`. The endpoint first tries `ProviderName(provider)`; on ValueError it falls back to the dynamic handler registry (populated after block loading), and 404s if the name is unknown in both.

Source

Thrown at autogpt_platform/backend/backend/api/external/v1/integrations.py:352

    for CSRF protection.
    """
    # Validate callback URL
    if not validate_callback_url(request.callback_url):
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail=(
                f"Callback URL origin is not allowed. "
                f"Allowed origins: {settings.config.external_oauth_callback_origins}",
            ),
        )

    # Validate provider
    try:
        provider_name = ProviderName(provider)
    except ValueError:
        # Check if it's a dynamically registered provider
        if provider not in HANDLERS_BY_NAME:
            raise HTTPException(
                status_code=status.HTTP_404_NOT_FOUND,
                detail=f"Provider '{provider}' not found",
            )
        provider_name = provider

    # Get OAuth handler with external callback URL
    handler = _get_oauth_handler_for_external(
        provider if isinstance(provider_name, str) else provider_name.value,
        request.callback_url,
    )

    # Store state token with external flow metadata
    # Note: initiated_by_api_key_id is only available for API key auth, not OAuth
    api_key_id = getattr(auth, "id", None) if auth.type == "api_key" else None
    state_token, code_challenge = await creds_manager.store.store_state_token(
        user_id=auth.user_id,
        provider=provider if isinstance(provider_name, str) else provider_name.value,
        scopes=request.scopes,

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. GET `/api/external-api/v1/integrations/providers` and use the exact provider id/slug it returns for the authorize call.
  2. Check provider name spelling and separator convention (usually snake_case).
  3. If the provider should come from an SDK block, inspect backend startup logs for block-load failures that would leave it out of `HANDLERS_BY_NAME`.
  4. Upgrade/downgrade client and platform to matching versions if the provider set changed between releases.

Example fix

# before
POST /integrations/github-oauth/oauth/authorize  # 404 Provider not found

# after
GET /integrations/providers  -> [{"id": "github", "oauth": true}, ...]
POST /integrations/github/oauth/authorize
Defensive patterns

Strategy: validation

Validate before calling

providers = client.get("/integrations/providers").json()
known = {p["id"] for p in providers}
if provider not in known:
    raise ValueError(f"unknown provider {provider!r}; choose from {sorted(known)}")

Try / catch

try:
    client.post(f"/integrations/{provider}/oauth/authorize", json=payload)
except HTTPError as e:
    if e.response.status_code == 404:
        # refresh provider list and surface actionable error
        raise UnknownProvider(provider) from e
    raise

Prevention

When it happens

Trigger: POST `/api/external-api/v1/integrations/{provider}/oauth/authorize` with an unknown or misspelled provider slug (e.g. `githb`, `google-drive` vs `google_drive`), or a provider whose block (which registers its OAuth handler) failed to load.

Common situations: Slug spelling/casing mistakes; provider exists for API-key auth but has no OAuth handler; SDK-contributed provider whose block import failed at runtime (the helper logs 'Failed to load blocks' and proceeds with a partial registry); provider removed in a newer platform version while an old client keeps calling it.

Related errors


AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14). Data as JSON: /api/errors/38f431b3eeb026f8. Report an issue: GitHub.