{"record":{"id":"bf215e36e72dc772","repo":"chroma-core/chroma","slug":"invalid-configuration-type-parameter-value","errorCode":null,"errorMessage":"Invalid configuration type: {parameter.value}","messagePattern":"Invalid configuration type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/api/configuration.py","lineNumber":112,"sourceCode":"    # All expected parameters must be present with defaults or None values at initialization\n    parameter_map: Dict[str, ConfigurationParameter]\n    definitions: ClassVar[Dict[str, ConfigurationDefinition]]\n\n    def __init__(self, parameters: Optional[List[ConfigurationParameter]] = None):\n        \"\"\"Initializes a new instance of the Configuration class. Respecting defaults and\n        validators.\"\"\"\n        self.parameter_map = {}\n        if parameters is not None:\n            for parameter in parameters:\n                if parameter.name not in self.definitions:\n                    raise ValueError(f\"Invalid parameter name: {parameter.name}\")\n\n                definition = self.definitions[parameter.name]\n                # Handle the case where we have a recursive configuration definition\n                if isinstance(parameter.value, dict):\n                    child_type = globals().get(parameter.value.get(\"_type\", None))\n                    if child_type is None:\n                        raise ValueError(\n                            f\"Invalid configuration type: {parameter.value}\"\n                        )\n                    parameter.value = child_type.from_json(parameter.value)\n                if not isinstance(parameter.value, type(definition.default_value)):\n                    raise ValueError(f\"Invalid parameter value: {parameter.value}\")\n\n                parameter_validator = definition.validator\n                if not parameter_validator(parameter.value):\n                    raise ValueError(f\"Invalid parameter value: {parameter.value}\")\n                self.parameter_map[parameter.name] = parameter\n        # Apply the defaults for any missing parameters\n        for name, definition in self.definitions.items():\n            if name not in self.parameter_map:\n                self.parameter_map[name] = ConfigurationParameter(\n                    name=name, value=definition.default_value\n                )\n\n        self.configuration_validator()","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/configuration.py#L94-L130","documentation":"Raised in ConfigurationInternal.__init__ (chromadb/api/configuration.py:112) when a parameter value is a dict (i.e. a nested, recursive configuration) whose \"_type\" key does not resolve to a known ConfigurationInternal subclass in this module's globals. The _type discriminator is what from_json uses to pick the concrete class for the nested value; an unknown, misspelled, or renamed _type means the nested configuration cannot be reconstructed.","triggerScenarios":"Nested config JSON like {\"_type\": \"HNSWConfiguration\", ...} when the class is actually named HNSWConfigurationInternal; _type missing entirely (globals().get(None) returns None); loading nested config produced by another chromadb version where the class was renamed or did not yet exist.","commonSituations":"Persisted collection or system configuration replayed after a chromadb upgrade or downgrade; hand-authored JSON configs with a guessed _type value; cross-environment moves (dev config applied in prod with different chromadb versions).","solutions":["Set _type to the exact class name of a ConfigurationInternal subclass defined in chromadb.api.configuration (e.g. \"HNSWConfigurationInternal\")","If the JSON came from another version, regenerate it with the current chromadb or upgrade to the version that knows that class","Drop the nested dict and pass the value in its already-constructed form"],"exampleFix":"# before\nraw = {\"hnsw\": {\"_type\": \"HNSWConfiguration\", \"M\": 16}}   # wrong _type\n# after\nraw = {\"hnsw\": {\"_type\": \"HNSWConfigurationInternal\", \"M\": 16}}","handlingStrategy":"validation","validationCode":"import chromadb.api.configuration as cfgmod\nfrom chromadb.api.configuration import ConfigurationInternal\n\ndef known_config_types():\n    return {name for name in dir(cfgmod)\n            if isinstance(getattr(cfgmod, name, None), type)\n            and issubclass(getattr(cfgmod, name), ConfigurationInternal)}\n\ndef valid_nested(value: dict) -> bool:\n    return value.get(\"_type\") in known_config_types()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Stamp nested dicts with the exact class name from the current module (e.g. HNSWConfigurationInternal)","Re-serialize configs via to_json() rather than hand-writing them","On version upgrades, verify stored _type names still exist before loading"],"tags":["chromadb","configuration","nested-config","serialization","type-discriminator"],"backgroundTag":"configuration-validation-failed","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}