You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CLI validates all profile settings before executing any command, causing operations to fail entirely if any setting is invalid - even when that setting is unrelated to the requested operation.
Many CLI commands read from and validate profile settings during their execution. However, when settings are migrated between versions, it's easy for profile configs to become outdated, leading to validation errors like this:
raceback (most recent call last):
File "/Users/nicholas/projects/prefect/src/prefect/cli/_utilities.py", line 43, in wrapper
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/Users/nicholas/projects/prefect/src/prefect/cli/_types.py", line 155, in sync_fn
return asyncio.run(async_fn(*args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nicholas/.pyenv/versions/3.11.7/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/Users/nicholas/.pyenv/versions/3.11.7/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nicholas/.pyenv/versions/3.11.7/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/nicholas/projects/prefect/src/prefect/cli/cloud/__init__.py", line 567, in login
update_current_profile(
File "/Users/nicholas/projects/prefect/src/prefect/settings/profiles.py", line 400, in update_current_profile
new_profile.validate_settings()
File "/Users/nicholas/projects/prefect/src/prefect/settings/profiles.py", line 96, in validate_settings
raise ProfileSettingsValidationError(errors)
prefect.exceptions.ProfileSettingsValidationError: [(<PREFECT_LOGGING_LEVEL: typing.Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']>, 1 validation error for literal['DEBUG','INFO','WARNING','ERROR','CRITICAL']
Input should be 'DEBUG', 'INFO', 'WARNING', 'ERROR' or 'CRITICAL' [type=literal_error, input_value='debug', input_type=str]
For further information visit https://errors.pydantic.dev/2.10/v/literal_error)]
In this case, I had this setting: PREFECT_LOGGING_LEVEL='debug' instead of PREFECT_LOGGING_LEVEL='DEBUG'; despite being unrelated to the command I was running (prefect cloud login), I was unable to continue until I resolved the issue in my current config.
Describe the proposed behavior
When encountering invalid settings that don't affect the current command:
Display a human-readable warning about the invalid setting
Allow the command to proceed normally
Example: "Warning: PREFECT_LOGGING_LEVEL='debug' is invalid (should be uppercase 'DEBUG'). This won't affect the current command."
When encountering invalid settings that would affect the current command:
Display a clear error message identifying the specific invalid setting
Provide guidance on how to fix it
Example: "Error: Cannot execute 'prefect config get' - PREFECT_LOGGING_LEVEL='debug' is invalid. Please use uppercase 'DEBUG' instead."
Example Use
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the current behavior
The CLI validates all profile settings before executing any command, causing operations to fail entirely if any setting is invalid - even when that setting is unrelated to the requested operation.
Many CLI commands read from and validate profile settings during their execution. However, when settings are migrated between versions, it's easy for profile configs to become outdated, leading to validation errors like this:
In this case, I had this setting:
PREFECT_LOGGING_LEVEL='debug'
instead ofPREFECT_LOGGING_LEVEL='DEBUG'
; despite being unrelated to the command I was running (prefect cloud login
), I was unable to continue until I resolved the issue in my current config.Describe the proposed behavior
When encountering invalid settings that don't affect the current command:
Example: "Warning: PREFECT_LOGGING_LEVEL='debug' is invalid (should be uppercase 'DEBUG'). This won't affect the current command."
When encountering invalid settings that would affect the current command:
Example Use
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: