{"id":"9e2b0e2413bab8da","repo":"python-poetry/poetry","slug":"there-is-no-setting-key-setting","errorCode":null,"errorMessage":"There is no {setting_key} setting.","messagePattern":"There is no (.+?) setting\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/poetry/console/commands/config.py","lineNumber":207,"sourceCode":"                        )\n                return 0\n            elif m := re.match(repo_regex, self.argument(\"key\")):\n                if not m.group(1):\n                    value = {}\n                    if config.get(\"repositories\") is not None:\n                        value = config.get(\"repositories\")\n                else:\n                    repo_name = m.group(1)\n                    repo = config.get([\"repositories\", repo_name])\n                    if repo is None:\n                        raise ValueError(f\"There is no {repo_name} repository defined\")\n\n                    value = repo.get(sub_key, \"\") if (sub_key := m.group(2)) else repo\n\n                self.line(str(value))\n            else:\n                if setting_key not in self.unique_config_values:\n                    raise ValueError(f\"There is no {setting_key} setting.\")\n\n                value = config.get(setting_key)\n\n                if not isinstance(value, str):\n                    value = json.dumps(value)\n\n                self.line(value)\n\n            return 0\n\n        values: list[str] = self.argument(\"value\")\n\n        if setting_key in self.unique_config_values:\n            if self.option(\"unset\"):\n                config.config_source.remove_property(setting_key)\n                return 0\n\n            return self._handle_single_value(","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/python-poetry/poetry/blob/92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54/src/poetry/console/commands/config.py#L189-L225","documentation":"Raises ValueError in ConfigCommand.handle() when the user reads a setting key that does not match any known pattern (repositories, http-basic, pypi-token, certs, build-config-settings) and is not in unique_config_values. The check at line 206-207 fires in the read path's else branch, meaning the key is entirely unrecognized.","triggerScenarios":"Running `poetry config virtualenvs.something` or `poetry config foo.bar.baz` where 'foo.bar.baz' is neither a known setting nor a recognized config section.","commonSituations":"Typo in setting name, using a setting from a newer/older Poetry version, or guessing a setting name that doesn't exist.","solutions":["List all valid settings: `poetry config --list` and compare against unique_config_values keys.","Correct the setting key name (e.g. 'virtualenvs.in-project' not 'virtualenvs.inproject')."],"exampleFix":"# before (error)\npoetry config virtualenvs.create-venv\n# after\npoetry config virtualenvs.create","handlingStrategy":"validation","validationCode":"VALID_SETTINGS = {\n    \"cache-dir\", \"data-dir\", \"virtualenvs.create\", \"virtualenvs.in-project\",\n    \"virtualenvs.options.always-copy\", \"virtualenvs.options.system-site-packages\",\n    \"virtualenvs.options.no-pip\", \"virtualenvs.path\", \"virtualenvs.use-poetry-python\",\n    \"virtualenvs.prompt\", \"system-git-client\", \"requests.max-retries\",\n    \"installer.re-resolve\", \"installer.parallel\", \"installer.max-workers\",\n    \"installer.no-binary\", \"installer.only-binary\", \"solver.lazy-wheel\",\n    \"solver.min-release-age\", \"solver.min-release-age-exclude\",\n    \"solver.min-release-age-exclude-source\", \"keyring.enabled\", \"python.installation-dir\",\n}\n\ndef validate_setting_key(key: str) -> None:\n    if key not in VALID_SETTINGS:\n        raise ValueError(f\"Unknown setting '{key}'. Run 'poetry config --list' for valid keys.\")","typeGuard":"def is_known_setting(key: str, valid_keys: set[str]) -> bool:\n    return key in valid_keys","tryCatchPattern":null,"preventionTips":["Run 'poetry config --list' to see all valid setting keys.","Check for typos — settings use dots as separators (e.g. 'virtualenvs.in-project').","Verify the setting exists in your Poetry version; consult the documentation."],"tags":["config-command","valueerror","unknown-setting","not-found"],"analyzedSha":"92b74dcfe348d0e01e14d40d6c1fa47a4ee04a54","analyzedAt":"2026-08-04T20:33:34.072Z","schemaVersion":2}