crewAIInc/crewAI · warning · SystemExit
Error: Unknown or readonly configuration key '{key}'
Error message
Error: Unknown or readonly configuration key '{key}' What it means
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.
Source
Thrown at lib/cli/src/crewai_cli/settings/main.py:91
)
console.print(table)
def set(self, key: str, value: str) -> None:
"""Set a CLI configuration parameter."""
readonly_settings = READONLY_SETTINGS_KEYS + HIDDEN_SETTINGS_KEYS
if not hasattr(self.settings, key) or key in readonly_settings:
console.print(
f"Error: Unknown or readonly configuration key '{key}'",
style="bold red",
)
console.print("Available keys:", style="yellow")
for field_name in Settings.model_fields:
if field_name not in readonly_settings:
console.print(f" - {field_name}", style="yellow")
raise SystemExit(1)
setattr(self.settings, key, value)
self.settings.dump()
console.print(f"Successfully set '{key}' to '{value}'", style="bold green")
def reset_all_settings(self) -> None:
"""Reset all CLI configuration parameters to default values."""
self.settings.reset()
console.print(
"Successfully reset all configuration parameters to default values. It is recommended to run [bold yellow]'crewai login'[/bold yellow] to re-authenticate.",
style="bold green",
)
View on GitHub (pinned to 754d7323be)
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.
Example fix
# before $ crewai config set telemetry_enbaled false # typo # Error: Unknown or readonly configuration key 'telemetry_enbaled' # after $ crewai config set telemetry_enabled false # exact key from the printed list
Defensive patterns
Strategy: validation
Validate before calling
from crewai_cli.settings import Settings # adjust import to installed version
readonly = set(READONLY_SETTINGS_KEYS) | set(HIDDEN_SETTINGS_KEYS) # from settings module
valid = {k for k in Settings.model_fields if k not in readonly}
def assert_settable(key: str) -> None:
if key not in valid:
raise SystemExit(f"{key!r} is unknown/readonly; valid: {sorted(valid)}") Type guard
def is_settable_setting(key: str) -> bool:
return key in Settings.model_fields and key not in (
set(READONLY_SETTINGS_KEYS) | set(HIDDEN_SETTINGS_KEYS)
) Prevention
- 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.
When it happens
Trigger: 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).
Common situations: 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).
Related errors
- Template '{name}' not found.
- Missing required input '{name}'
- Invalid --definition path: {definition} is not a file.
- Project name cannot be empty
- Project name '{name}' produces invalid folder name '{folder_
AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15).
Data as JSON: /api/errors/34913c6d8eda16fe.
Report an issue: GitHub.