chroma-core/chroma · error · ValueError
The region cannot be changed after the embedding function…
Error message
The region cannot be changed after the embedding function has been initialized.
What it means
Raised by GoogleVertexAIEmbeddingFunction.validate_config_update when an update payload includes a 'region' key. The GCP region is fixed at initialization because the Vertex endpoint is bound to it; changing it would require re-creating the embedding function.
Solutions
- Keep region unchanged across updates
- Instantiate a new embedding function for a different region
- Remove region from the update payload
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at chromadb/utils/embedding_functions/google_embedding_function.py:627 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/21f9110ef821d78d.
Report an issue: GitHub.
Appendix: source
Thrown at chromadb/utils/embedding_functions/google_embedding_function.py:627
"api_key_env_var": self.api_key_env_var,
"model_name": self.model_name,
"project_id": self.project_id,
"region": self.region,
}
def validate_config_update(
self, old_config: Dict[str, Any], new_config: Dict[str, Any]
) -> None:
if "model_name" in new_config:
raise ValueError(
"The model name cannot be changed after the embedding function has been initialized."
)
if "project_id" in new_config:
raise ValueError(
"The project ID cannot be changed after the embedding function has been initialized."
)
if "region" in new_config:
raise ValueError(
"The region cannot be changed after the embedding function has been initialized."
)
@staticmethod
def validate_config(config: Dict[str, Any]) -> None:
"""
Validate the configuration using the JSON schema.
Args:
config: Configuration to validate
Raises:
ValidationError: If the configuration does not match the schema
"""
validate_config_schema(config, "google_vertex")
View on GitHub (pinned to aecdd12c8a)