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
I am new to Prefect and want to check how it works. I cloned the repository and started a local server with prefect server start in one console session. The bundled local profile points at http://127.0.0.1:4200/api, so in another session I ran prefect profile use local to connect my flow to that server.
prefect config view confirmed it: PREFECT_API_URL='http://127.0.0.1:4200/api' (from profile). But when I ran my flow script, it did not use that server - it silently started its own temporary ephemeral one. So the local profile is shown by config view but not applied at runtime. It might not be a bug, but it looks inconsistent!
Note: I did not run prefect profile populate-defaults, so prefect profile use local wrote only active = "local" with an empty [profiles] table - the local profile itself was never copied into ~/.prefect/profiles.toml.
) - when the active profile isn't in ~/.prefect/profiles.toml, falls back to _get_default_profile() (the template's ephemeral) instead of resolving the selected name against the bundled template.
As a summary: both read the bundled profiles.toml, but prefect config view resolves the selected profile (local) against it, while ProfileSettingsTomlLoader._load_profile_settings only falls back to the template's default (ephemeral) — it never resolves the selected name.
Not sure if this case is worth fixing. A similar case for the ephemeral profile was reported in #16118 / #16101 and fixed in #16119 - but that fix only covers the template's default profile; the same situation with local remains unhandled. It comes as a surprise for people who start using Prefect for development from a clean checkout. For production installations, environment variables (or .env/prefect.toml) take precedence over profiles, so the inconsistency is visible only in a clean dev environment.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hi!
I am new to Prefect and want to check how it works. I cloned the repository and started a local server with
prefect server startin one console session. The bundledlocalprofile points athttp://127.0.0.1:4200/api, so in another session I ranprefect profile use localto connect my flow to that server.prefect config viewconfirmed it:PREFECT_API_URL='http://127.0.0.1:4200/api' (from profile). But when I ran my flow script, it did not use that server - it silently started its own temporaryephemeralone. So thelocalprofile is shown byconfig viewbut not applied at runtime. It might not be a bug, but it looks inconsistent!Note: I did not run
prefect profile populate-defaults, soprefect profile use localwrote onlyactive = "local"with an empty[profiles]table - thelocalprofile itself was never copied into~/.prefect/profiles.toml.With further investigation I found that if bundled profile (https://github.com/PrefectHQ/prefect/blob/60025750fb7ea1d69fef8a1c8b1e013cdc8149ae/src/prefect/settings/profiles.toml) is not copied into ~/.prefect/profiles.toml using
populate-defaultsit still can be shown through config view, but script execution does not merge it into settings and silently starts a temporary ephemeral server.the script doesn't find local, and substitutes ephemeral - it never resolves the selected local by name.
The possible cause is in the
ProfileSettingsTomlLoader._load_profile_settings(prefect/src/prefect/settings/sources.py
Lines 163 to 164 in 6002575
~/.prefect/profiles.toml, falls back to_get_default_profile()(the template's ephemeral) instead of resolving the selected name against the bundled template.As a summary: both read the bundled
profiles.toml, butprefect config viewresolves the selected profile (local) against it, whileProfileSettingsTomlLoader._load_profile_settingsonly falls back to the template's default (ephemeral) — it never resolves the selected name.Not sure if this case is worth fixing. A similar case for the
ephemeralprofile was reported in #16118 / #16101 and fixed in #16119 - but that fix only covers the template's default profile; the same situation withlocalremains unhandled. It comes as a surprise for people who start using Prefect for development from a clean checkout. For production installations, environment variables (or.env/prefect.toml) take precedence over profiles, so the inconsistency is visible only in a clean dev environment.All reactions