{"record":{"id":"34913c6d8eda16fe","repo":"crewAIInc/crewAI","slug":"error-unknown-or-readonly-configuration-key-key","errorCode":null,"errorMessage":"Error: Unknown or readonly configuration key '{key}'","messagePattern":"Error: Unknown or readonly configuration key '(.+?)'","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"warning","filePath":"lib/cli/src/crewai_cli/settings/main.py","lineNumber":91,"sourceCode":"        )\n\n        console.print(table)\n\n    def set(self, key: str, value: str) -> None:\n        \"\"\"Set a CLI configuration parameter.\"\"\"\n\n        readonly_settings = READONLY_SETTINGS_KEYS + HIDDEN_SETTINGS_KEYS\n\n        if not hasattr(self.settings, key) or key in readonly_settings:\n            console.print(\n                f\"Error: Unknown or readonly configuration key '{key}'\",\n                style=\"bold red\",\n            )\n            console.print(\"Available keys:\", style=\"yellow\")\n            for field_name in Settings.model_fields:\n                if field_name not in readonly_settings:\n                    console.print(f\"  - {field_name}\", style=\"yellow\")\n            raise SystemExit(1)\n\n        setattr(self.settings, key, value)\n        self.settings.dump()\n\n        console.print(f\"Successfully set '{key}' to '{value}'\", style=\"bold green\")\n\n    def reset_all_settings(self) -> None:\n        \"\"\"Reset all CLI configuration parameters to default values.\"\"\"\n        self.settings.reset()\n        console.print(\n            \"Successfully reset all configuration parameters to default values. It is recommended to run [bold yellow]'crewai login'[/bold yellow] to re-authenticate.\",\n            style=\"bold green\",\n        )\n","sourceCodeStart":73,"sourceCodeEnd":105,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/settings/main.py#L73-L105","documentation":"Settings validation in the CLI's settings manager: `crewai config set <key> <value>` (set_value) rejects keys that either don't exist on the Settings pydantic model (hasattr check fails) or are in READONLY_SETTINGS_KEYS/HIDDEN_SETTINGS_KEYS. The CLI prints the error in bold red, lists the valid, non-readonly keys, and exits 1 — no setting is modified.","triggerScenarios":"Calling set with a misspelled key; using a key that exists but is readonly/hidden by policy (e.g. auth/session-related fields); keys from an older/newer crewai version than the docs you followed; wrong casing (keys are exact field names).","commonSituations":"Following outdated docs or blog posts naming settings that were renamed; scripts programmatically setting config keys after an upgrade; attempting to manually set keys the CLI manages internally (login tokens).","solutions":["Copy a key directly from the 'Available keys' list printed by the error itself.","Check spelling, casing, and hyphens vs underscores — keys must match Settings model field names exactly.","If the key is readonly on purpose (auth/session data), use the corresponding command (e.g. `crewai login`) instead of config set.","If you expected the key to exist, upgrade/downgrade to the crewai CLI version whose Settings model includes it."],"exampleFix":"# before\n$ crewai config set telemetry_enbaled false   # typo\n# Error: Unknown or readonly configuration key 'telemetry_enbaled'\n\n# after\n$ crewai config set telemetry_enabled false   # exact key from the printed list","handlingStrategy":"validation","validationCode":"from crewai_cli.settings import Settings  # adjust import to installed version\n\nreadonly = set(READONLY_SETTINGS_KEYS) | set(HIDDEN_SETTINGS_KEYS)  # from settings module\nvalid = {k for k in Settings.model_fields if k not in readonly}\n\ndef assert_settable(key: str) -> None:\n    if key not in valid:\n        raise SystemExit(f\"{key!r} is unknown/readonly; valid: {sorted(valid)}\")","typeGuard":"def is_settable_setting(key: str) -> bool:\n    return key in Settings.model_fields and key not in (\n        set(READONLY_SETTINGS_KEYS) | set(HIDDEN_SETTINGS_KEYS)\n    )","tryCatchPattern":null,"preventionTips":["Derive config keys from the CLI's own `config list`/error output instead of docs that may lag versions.","For auth-managed values use `crewai login`, never `config set` on readonly keys.","Smoke-test config-setting scripts after every crewai CLI upgrade."],"tags":["configuration","settings","validation","cli","user-input"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}