chroma-core/chroma · error · ValueError
Invalid token. Must contain only ASCII letters, digits, and
Error message
Invalid token. Must contain only ASCII letters, digits, and punctuation.
What it means
Error "Invalid token. Must contain only ASCII letters, digits, and punctuation." thrown in chroma-core/chroma.
Source
Thrown at chromadb/auth/token_authn/__init__.py:59
"""
Accceptable token transport headers.
"""
# I don't love having this enum here -- it's weird to have an enum
# for just two values and it's weird to have users pass X_CHROMA_TOKEN
# to configure "x-chroma-token". But I also like having a single source
# of truth, so 🤷🏻♂️
AUTHORIZATION = "Authorization"
X_CHROMA_TOKEN = "X-Chroma-Token"
valid_token_chars = set(string.digits + string.ascii_letters + string.punctuation)
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}"
)
View on GitHub (pinned to aecdd12c8a)
When it happens
Trigger: Thrown at chromadb/auth/token_authn/__init__.py:59 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/bd12d9a9eaad135f.
Report an issue: GitHub.