chroma-core/chroma · error · ValueError

User missing tokens

Error message

User missing tokens

What it means

Raised in TokenAuthenticationServerProvider.__init__ while parsing the auth credentials YAML: a user entry in the users config lacks the required 'tokens' key. It fires when the server auth file defines a user without an associated token list, making the user impossible to authenticate.

Solutions

  1. Add a 'tokens' key with a list of token strings to each user entry in the auth credentials YAML
  2. Validate the credentials file against the expected schema (id, tenant, databases, role, tokens)
  3. Check that the YAML structure was not flattened or corrupted (e.g., a missing indentation level)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at chromadb/auth/token_authn/__init__.py:172 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16). Data as JSON: /api/errors/6ed2c9217ba7b3e2. Report an issue: GitHub.

Appendix: source

Thrown at chromadb/auth/token_authn/__init__.py:172

        self._token_user_mapping: Dict[str, User] = {}
        creds = self.read_creds_or_creds_file()

        # If we only get one cred, assume it's just a valid token.
        if len(creds) == 1:
            self._token_user_mapping[creds[0]] = User(
                id="anonymous",
                tenant="*",
                databases=["*"],
                role="anonymous",
                tokens=[creds[0]],
            )
            return

        self._users = cast(List[User], yaml.safe_load("\n".join(creds))["users"])
        for user in self._users:
            if "tokens" not in user:
                raise ValueError("User missing tokens")
            if "tenant" not in user:
                user["tenant"] = "*"
            if "databases" not in user:
                user["databases"] = ["*"]
            for token in user["tokens"]:
                _check_token(token)
                if (
                    token in self._token_user_mapping
                    and self._token_user_mapping[token] != user
                ):
                    raise ValueError(
                        f"Token {token} already in use: wanted to use it for "
                        f"user {user['id']} but it's already in use by "
                        f"user {self._token_user_mapping[token]}"
                    )
                self._token_user_mapping[token] = user

    @trace_method(

View on GitHub (pinned to aecdd12c8a)