{"record":{"id":"b6b543fba5629350","repo":"crewAIInc/crewAI","slug":"token-is-not-active","errorCode":null,"errorMessage":"Token is not active","messagePattern":"Token is not active","errorType":"http","errorClass":"HTTPException","httpStatus":401,"severity":"error","filePath":"lib/crewai/src/crewai/a2a/auth/server_schemes.py","lineNumber":626,"sourceCode":"                status_code=HTTP_503_SERVICE_UNAVAILABLE,\n                detail=\"Token introspection service unavailable\",\n            ) from None\n        except Exception as e:\n            logger.error(\n                \"OAuth2 introspection failed\",\n                extra={\"reason\": \"unexpected_error\", \"error\": str(e)},\n            )\n            raise HTTPException(\n                status_code=HTTP_503_SERVICE_UNAVAILABLE,\n                detail=\"Token introspection failed\",\n            ) from None\n\n        if not introspection_result.get(\"active\", False):\n            logger.debug(\n                \"OAuth2 authentication failed\",\n                extra={\"reason\": \"token_not_active\", \"scheme\": \"oauth2\"},\n            )\n            raise HTTPException(\n                status_code=HTTP_401_UNAUTHORIZED,\n                detail=\"Token is not active\",\n            )\n\n        return AuthenticatedUser(\n            token=token,\n            scheme=\"oauth2\",\n            claims=introspection_result,\n        )\n\n    def to_security_scheme(self) -> OAuth2SecurityScheme:\n        \"\"\"Generate OAuth2SecurityScheme for AgentCard declaration.\n\n        Creates an OAuth2SecurityScheme with appropriate flows based on\n        the configured URLs. Includes client_credentials flow if token_url\n        is set, and authorization_code flow if authorization_url is set.\n\n        Returns:","sourceCodeStart":608,"sourceCodeEnd":644,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai/src/crewai/a2a/auth/server_schemes.py#L608-L644","documentation":"Error \"Token is not active\" thrown in crewAIInc/crewAI.","triggerScenarios":"Thrown at lib/crewai/src/crewai/a2a/auth/server_schemes.py:626 when the library encounters an invalid state.","commonSituations":"Occurs when introspection reports the token as inactive (expired, revoked, or not yet valid). Obtain a fresh, active token before retrying.","solutions":["Re-authenticate to obtain an active token.","Check whether the token was revoked or has expired."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}