Nas Denkov
01/09/2025, 7:09 AMprefect-server:
image: prefecthq/prefect:3.1.11-python3.12
command: ["prefect", "server", "start"]
container_name: prefect-server
depends_on:
prefect-database:
condition: service_healthy
ports:
- "4200:4200"
environment:
- PREFECT_SERVER_API_HOST=0.0.0.0
- PREFECT_SERVER_API_PORT=4200
- PREFECT_UI_ENABLED=true
- PREFECT_UI_STATIC_DIRECTORY=/ui_build
- PREFECT_LOGGING_SERVER_LEVEL=DEBUG
- PREFECT_API_DATABASE_DRIVER=postgresql+asyncpg
- PREFECT_API_DATABASE_HOST=prefect-database
- PREFECT_API_DATABASE_PORT=5432
- PREFECT_API_DATABASE_NAME=prefect
- PREFECT_API_DATABASE_USER=prefect
- PREFECT_API_DATABASE_PASSWORD=prefect
does not work anymore - settings cannot be converted to environment variables (which used to be the sane default) ๐ Anyone know how to fix this
prefect-server | Traceback (most recent call last):
prefect-server | File "/usr/local/bin/prefect", line 5, in <module>
prefect-server | from prefect.cli import app
prefect-server | File "/usr/local/lib/python3.12/site-packages/prefect/cli/__init__.py", line 12, in <module>
prefect-server | import prefect.cli.shell
prefect-server | File "/usr/local/lib/python3.12/site-packages/prefect/cli/shell.py", line 16, in <module>
prefect-server | from prefect import flow
prefect-server | File "<frozen importlib._bootstrap>", line 1412, in _handle_fromlist
prefect-server | File "/usr/local/lib/python3.12/site-packages/prefect/__init__.py", line 113, in __getattr__
prefect-server | module = importlib.import_module(mname, package=package)
prefect-server | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
prefect-server | File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
prefect-server | return _bootstrap._gcd_import(name[level:], package, level)
prefect-server | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
prefect-server | File "/usr/local/lib/python3.12/site-packages/prefect/main.py", line 44, in <module>
prefect-server | prefect.logging.configuration.setup_logging()
prefect-server | File "/usr/local/lib/python3.12/site-packages/prefect/logging/configuration.py", line 71, in setup_logging
prefect-server | config = load_logging_config(
prefect-server | ^^^^^^^^^^^^^^^^^^^^
prefect-server | File "/usr/local/lib/python3.12/site-packages/prefect/logging/configuration.py", line 41, in load_logging_config
prefect-server | template.substitute(current_settings.to_environment_variables())
prefect-server | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
prefect-server | File "/usr/local/lib/python3.12/site-packages/prefect/settings/base.py", line 92, in to_environment_variables
prefect-server | env: Dict[str, Any] = self.model_dump(
prefect-server | ^^^^^^^^^^^^^^^^
prefect-server | File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 426, in model_dump
prefect-server | return self.__pydantic_serializer__.to_python(
prefect-server | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
prefect-server | pydantic_core._pydantic_core.PydanticSerializationError: Error calling function `_serialize_secret_field`: AttributeError: 'str' object has no attribute 'get_secret_value'
Fernando Correia
01/09/2025, 6:36 PMBianca Hoch
01/09/2025, 7:22 PMFernando Correia
01/09/2025, 7:26 PMPREFECT_SERVER_DATABASE_CONNECTION_URL
works, although itโs less than ideal for a situation where we want to get the credentials (user, password) from a secret store and to keep other options (host, port, db name) in configuration.
This is not blocking me but it would be great to have it fixed over time.
Thanks!Nas Denkov
01/09/2025, 10:22 PMSecretStr
(to avoid displaying it in logging contexts, in the ui etc) but a str
is expected in certain situations - i've commented on the PR for Alex to take a look when and if he can. ๐