Olve Heitmann
11/26/2025, 11:06 PMMarvin
11/26/2025, 11:06 PMresearch_prefect_topic
📊 Tools used:
• research_prefect_topic (1x)Olve Heitmann
11/26/2025, 11:34 PMMarvin
11/26/2025, 11:34 PMMarvin
11/26/2025, 11:34 PMOlve Heitmann
11/26/2025, 11:35 PMMarvin
11/26/2025, 11:35 PMMarvin
11/26/2025, 11:42 PMnetworks setting wherever it’s defined.
Where to look/update (Prefect 3.x):
- Deployment job variables (per-deployment override)
- Work pool’s base job template (pool-wide default)
Quickly check where the old name is coming from:
- Inspect the deployment:
prefect deployment inspect "<flow-name>/<deployment-name>" --output json
Look under job_variables.networks (or network_mode if you use that).
- Inspect the work pool:
prefect work-pool inspect "<pool-name>" --output json
Look under base_job_template.job_configuration.networks.
How to fix it
Option A — Update the deployment’s job variables
- In UI: Deployments > your deployment > Configuration > Job Variables > set networks to the new network name(s), then Save.
- Via prefect.yaml (then redeploy):
deployments:
- name: your-deployment
entrypoint: path/to/flow.py:flow
work_pool:
name: <pool-name>
job_variables:
networks:
- qfin_<your_network_name>
- In code:
flow.deploy(
name="your-deployment",
work_pool_name="<pool-name>",
job_variables={"networks": ["qfin_<your_network_name>"]}
)
Option B — Update the work pool’s base job template (affects all deployments using this pool’s defaults)
prefect work-pool inspect "<pool-name>" --output json > template.json
# edit template.json: set base_job_template.job_configuration.networks to ["qfin_<your_network_name>"]
prefect work-pool update "<pool-name>" --base-job-template template.json
Notes
- networks and network_mode are mutually exclusive; set only one.
- Compose project prefixes network names (e.g., qfin_xyz). To avoid future renames, give your Compose network a stable name:
networks:
backend:
name: backend # stable name (no project prefix)
driver: bridge
Then set networks: ["backend"] in Prefect.
- On Linux, you can alternatively use network_mode: "host" if that fits your needs.
If you share:
- your work pool name,
- the output of prefect deployment inspect "<flow>/<deployment>" --output json (job_variables section),
- and the actual docker network ls | grep qfin network name,
I can point you to the exact field to update.Olve Heitmann
11/26/2025, 11:46 PMMarvin
11/26/2025, 11:46 PMMarvin
11/26/2025, 11:51 PMjob_configuration.networks (not in variables), so it won’t show up as a variable.
- It’s set as a default in the pool’s base job template under variables.properties.networks.default.
- You’re inspecting a different pool than the one the run actually used.
How to pinpoint exactly where it’s coming from
1) Inspect the failed run’s effective job config (most reliable)
- In the UI: open the failed flow run, go to the Worker/Job details panel and view the “Job configuration” JSON. Look for networks or network_mode.
2) Confirm which pool the run used, then inspect that pool thoroughly
- Get the pool name from the run or deployment.
- Inspect the pool and check both job_configuration and variables defaults:
prefect work-pool inspect "<pool-name>" --output json | jq '.base_job_template.job_configuration.networks // empty'
prefect work-pool inspect "<pool-name>" --output json | jq '.base_job_template.job_configuration.network_mode // empty'
prefect work-pool inspect "<pool-name>" --output json | jq '.base_job_template.variables.properties.networks.default // empty'
3) Inspect the deployment that scheduled the run
prefect deployment inspect "<flow-name>/<deployment-name>" --output json | jq '.job_variables.networks // empty'
prefect deployment inspect "<flow-name>/<deployment-name>" --output json | jq '.job_variables.network_mode // empty'
Fix it once you find it
- If set on the deployment, update its job variables to the new network:
# in code
flow.deploy(
name="<deployment>",
work_pool_name="<pool>",
job_variables={"networks": ["qfin_<new_network_name>"]}
)
- If set in the pool’s base job template, update it:
prefect work-pool inspect "<pool>" --output json > template.json
# edit template.json: set base_job_template.job_configuration.networks to ["qfin_<new_network_name>"]
prefect work-pool update "<pool>" --base-job-template template.json
Tips
- networks and network_mode are mutually exclusive; only set one.
- If you want a stable name across Compose changes, give your Compose network an explicit name: so it doesn’t get a project prefix, and reference that in Prefect.
If you share:
- the pool name your failed run used,
- the “Job configuration” JSON from that failed run, and/or
- the outputs of the inspect commands above,
I’ll point to the exact field to update.Olve Heitmann
11/27/2025, 12:00 AMMarvin
11/27/2025, 12:00 AMMarvin
11/27/2025, 12:01 AMwork_pool:
name: <pool>
job_variables:
networks: ["qfin_<your_network_name>"]
- Or set it pool-wide in the work pool’s base job template.
- If you don’t need the custom network, remove any `networks`/`network_mode` from the deployment and pool; Prefect will stop trying to attach to the old network and run on bridge.
Tips:
- Compose often prefixes network names. Give the network a stable name to avoid future renames:
networks:
backend:
name: backend
Then use networks: ["backend"] in Prefect.
- networks and network_mode are mutually exclusive. On Linux, network_mode: "host" is an alternative if you need host access.
If you tell me whether your flow needs to reach services on that compose network, I can suggest the minimal change (either set the network, or remove it everywhere).