{"record":{"id":"b0396b3f4a44e699","repo":"chroma-core/chroma","slug":"invalid-parameter-name-name-for-configuration","errorCode":null,"errorMessage":"Invalid parameter name: {name} for configuration {self.__class__.__name__}","messagePattern":"Invalid parameter name: (.+?) for configuration (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"chromadb/api/configuration.py","lineNumber":155,"sourceCode":"            return NotImplemented\n        return self.parameter_map == __value.parameter_map\n\n    @abstractmethod\n    def configuration_validator(self) -> None:\n        \"\"\"Perform custom validation when parameters are dependent on each other.\n\n        Raises an InvalidConfigurationError if the configuration is invalid.\n        \"\"\"\n        pass\n\n    def get_parameters(self) -> List[ConfigurationParameter]:\n        \"\"\"Returns the parameters of the configuration.\"\"\"\n        return list(self.parameter_map.values())\n\n    def get_parameter(self, name: str) -> ConfigurationParameter:\n        \"\"\"Returns the parameter with the given name, or except if it doesn't exist.\"\"\"\n        if name not in self.parameter_map:\n            raise ValueError(\n                f\"Invalid parameter name: {name} for configuration {self.__class__.__name__}\"\n            )\n        param_value = cast(ConfigurationParameter, self.parameter_map.get(name))\n        return param_value\n\n    def set_parameter(self, name: str, value: Union[str, int, float, bool]) -> None:\n        \"\"\"Sets the parameter with the given name to the given value.\"\"\"\n        if name not in self.definitions:\n            raise ValueError(f\"Invalid parameter name: {name}\")\n        definition = self.definitions[name]\n        parameter = self.parameter_map[name]\n        if definition.is_static:\n            raise StaticParameterError(f\"Cannot set static parameter: {name}\")\n        if not definition.validator(value):\n            raise ValueError(f\"Invalid value for parameter {name}: {value}\")\n        parameter.value = value\n\n    @override","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/configuration.py#L137-L173","documentation":"ConfigurationInternal.get_parameter (chromadb/api/configuration.py:155) raises this ValueError when asked for a parameter name not present in the configuration's parameter_map. Note that the map is always fully populated with defaults at construction, so a miss here means the name is not defined for this configuration class at all (the message includes the class name to make that obvious).","triggerScenarios":"cfg.get_parameter(\"ef\") on an HNSW configuration where the name is \"ef_search\"; calling get_parameter(\"hnsw:space\") with the legacy prefixed name; asking a non-HNSW configuration for an HNSW-only parameter.","commonSituations":"Using legacy parameter names from pre-configuration versions instead of the new names; assuming a parameter exists on every configuration class; autocomplete or IDE-driven guesses at parameter names.","solutions":["Enumerate what exists: [p.name for p in cfg.get_parameters()] or sorted(cfg.parameter_map)","Use the new-style name (e.g. ef_search, not hnsw:search_ef) after checking the mapping in from_legacy_params","Guard reads with `if name in cfg.parameter_map:` before calling get_parameter"],"exampleFix":"# before\nvalue = cfg.get_parameter(\"ef\")                 # unknown name\n# after\nprint([p.name for p in cfg.get_parameters()])   # discover valid names\nvalue = cfg.get_parameter(\"ef_search\")","handlingStrategy":"validation","validationCode":"def get_param_or_none(cfg, name):\n    return cfg.get_parameter(name).value if name in cfg.parameter_map else None","typeGuard":null,"tryCatchPattern":"try:\n    p = cfg.get_parameter(name)\nexcept ValueError as e:\n    if \"Invalid parameter name\" in str(e):\n        p = None  # or fall back to a documented default\n    else:\n        raise","preventionTips":["Enumerate names once: [p.name for p in cfg.get_parameters()]","Use new-style names (ef_search, not hnsw:search_ef)","Guard dynamic lookups with `name in cfg.parameter_map`"],"tags":["chromadb","configuration","parameter-names","lookup"],"backgroundTag":"configuration-validation-failed","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}