chroma-core/chroma · error · ValueError
Invalid token transport header
Error message
Invalid token transport header: {token_header}. Must be one of {allowed_token_headers} What it means
Validation helper _check_allowed_token_headers raises this when the configured token transport header is not one of the two supported values: 'Authorization' or 'X-Chroma-Token' (from the TokenTransportHeader enum). It fires at client/server init when an invalid token_transport_header setting is supplied.
Solutions
- Set the transport header to TokenTransportHeader.AUTHORIZATION or TokenTransportHeader.X_CHROMA_TOKEN
- Use the exact string 'Authorization' or 'X-Chroma-Token' (case-sensitive) in configuration
- Check for typos like 'x-chroma-token' or 'Bearer' in the config
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at chromadb/auth/token_authn/__init__.py:72 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16).
Data as JSON: /api/errors/b2f3ee24922d54ed.
Report an issue: GitHub.
Appendix: source
Thrown at chromadb/auth/token_authn/__init__.py:72
def _check_token(token: str) -> None:
token_str = str(token)
if not all(c in valid_token_chars for c in token_str):
raise ValueError(
"Invalid token. Must contain only ASCII letters, digits, and punctuation."
)
allowed_token_headers = [
TokenTransportHeader.AUTHORIZATION.value,
TokenTransportHeader.X_CHROMA_TOKEN.value,
]
def _check_allowed_token_headers(token_header: str) -> None:
if token_header not in allowed_token_headers:
raise ValueError(
f"Invalid token transport header: {token_header}. "
f"Must be one of {allowed_token_headers}"
)
class TokenAuthClientProvider(ClientAuthProvider):
"""
Client auth provider for token-based auth. Header key will be either
"Authorization" or "X-Chroma-Token" depending on
`chroma_auth_token_transport_header`. If the header is "Authorization",
the token is passed as a bearer token.
"""
def __init__(self, system: System) -> None:
super().__init__(system)
self._settings = system.settings
system.settings.require("chroma_client_auth_credentials")View on GitHub (pinned to aecdd12c8a)