chroma-core/chroma · error · ValueError

Unknown CMEK provider

Error message

Unknown CMEK provider: {self.provider}

What it means

Raised by Cmek validation when the customer-managed encryption key provider is not one of the recognized CmekProvider variants (currently only GCP). This indicates an unsupported or misspelled provider value on the Cmek configuration object.

Solutions

  1. Construct CMEK via Cmek.gcp(resource) with a valid GCP key resource path.
  2. Use a supported provider value from CmekProvider.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at chromadb/api/types.py:1981 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/f7c7f063d7e01429. Report an issue: GitHub.

Appendix: source

Thrown at chromadb/api/types.py:1981

        if self.provider == CmekProvider.GCP:
            return _CMEK_GCP_PATTERN.match(self.resource) is not None
        return False

    def to_dict(self) -> Dict[str, Any]:
        """Serialize CMEK to dictionary format for API transport.

        Returns:
            Dict containing the provider variant and resource identifier.

        Example:
            >>> cmek = Cmek.gcp("projects/p/locations/l/keyRings/r/cryptoKeys/k")
            >>> cmek.to_dict()
            {'gcp': 'projects/p/locations/l/keyRings/r/cryptoKeys/k'}
        """
        if self.provider == CmekProvider.GCP:
            return {"gcp": self.resource}
        # Unreachable with current providers, but future-proof
        raise ValueError(f"Unknown CMEK provider: {self.provider}")

    @classmethod
    def from_dict(cls, data: Dict[str, Any]) -> "Cmek":
        """Deserialize CMEK from dictionary format.

        Args:
            data: Dictionary containing provider variant and resource.
                  Format matches Rust serde enum serialization with snake_case.

        Returns:
            Cmek: Deserialized CMEK instance

        Raises:
            ValueError: If the provider is unsupported or data is malformed

        Example:
            >>> data = {'gcp': 'projects/p/locations/l/keyRings/r/cryptoKeys/k'}
            >>> cmek = Cmek.from_dict(data)

View on GitHub (pinned to aecdd12c8a)