crewAIInc/crewAI · error · HTTPException

Token is not active

Error message

Token is not active

What it means

Error "Token is not active" thrown in crewAIInc/crewAI.

Source

Thrown at lib/crewai/src/crewai/a2a/auth/server_schemes.py:626

                status_code=HTTP_503_SERVICE_UNAVAILABLE,
                detail="Token introspection service unavailable",
            ) from None
        except Exception as e:
            logger.error(
                "OAuth2 introspection failed",
                extra={"reason": "unexpected_error", "error": str(e)},
            )
            raise HTTPException(
                status_code=HTTP_503_SERVICE_UNAVAILABLE,
                detail="Token introspection failed",
            ) from None

        if not introspection_result.get("active", False):
            logger.debug(
                "OAuth2 authentication failed",
                extra={"reason": "token_not_active", "scheme": "oauth2"},
            )
            raise HTTPException(
                status_code=HTTP_401_UNAUTHORIZED,
                detail="Token is not active",
            )

        return AuthenticatedUser(
            token=token,
            scheme="oauth2",
            claims=introspection_result,
        )

    def to_security_scheme(self) -> OAuth2SecurityScheme:
        """Generate OAuth2SecurityScheme for AgentCard declaration.

        Creates an OAuth2SecurityScheme with appropriate flows based on
        the configured URLs. Includes client_credentials flow if token_url
        is set, and authorization_code flow if authorization_url is set.

        Returns:

View on GitHub (pinned to 754d7323be)

Solutions

  1. Re-authenticate to obtain an active token.
  2. Check whether the token was revoked or has expired.

When it happens

Trigger: Thrown at lib/crewai/src/crewai/a2a/auth/server_schemes.py:626 when the library encounters an invalid state.

Common situations: Occurs when introspection reports the token as inactive (expired, revoked, or not yet valid). Obtain a fresh, active token before retrying.


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/b6b543fba5629350. Report an issue: GitHub.