Parth Vyas
11/15/2025, 12:45 AMFile "/usr/local/lib/python3.12/site-packages/prefect/flows.py", line 1871, in load_flow_from_flow_run
deployment = await client.read_deployment(flow_run.deployment_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/prefect/client/orchestration.py", line 1793, in read_deployment
return DeploymentResponse.model_validate(response.json())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 596, in model_validate
return cls.__pydantic_validator__.validate_python(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for DeploymentResponse
UUID input should be a string, bytes or UUID object [type=uuid_type, input_value=None, input_type=NoneType]
Python version in use is python3.12Marvin
11/15/2025, 12:45 AMMarvin
11/15/2025, 12:58 AMclient.read_deployment(...) because a UUID field in the returned deployment payload is None. In Pydantic v2 (used by Prefect 3.x), UUIDs can’t be None, so you see:
ValidationError: DeploymentResponse
UUID input should be a string, bytes or UUID object [input=None]
Most common causes
- The flow run has no deployment_id (ad‑hoc run/subflow) and the engine still tries to load a deployment.
- Client ↔️ server version mismatch (especially if you’re self‑hosting). A server returning a schema where a field the client expects as a UUID is null will trigger exactly this error.
- A partially/mis‑migrated deployment record (e.g., after an upgrade) where a required UUID field is null.
Python 3.12 itself is supported and not the root cause.
Quick checks to pinpoint the issue
1) Confirm the flow run has a deployment_id
- Grab a failing run id and run:
prefect flow-run inspect <flow_run_id>
If deployment_id is null, that run was created without a deployment.
2) Inspect the deployment object
- If you know the deployment name:
prefect deployment inspect "<flow_name>/<deployment_name>"
Verify that UUID fields (e.g., id, flow_id, etc.) are present and not null.
3) Verify versions on your worker(s) and your server
- On the worker/where runs execute:
prefect version
- If you’re self‑hosting, confirm the server image/tag and that DB migrations have been applied:
prefect server database upgrade
Likely fixes based on what you find
- If deployment_id is None:
- Make sure runs are created from a deployment (UI “Run” on the deployment, prefect deployment run, or programmatically via flow.from_source(...).deploy(...)). Ad‑hoc runs/subflows don’t have a deployment to load.
- Avoid calling flows directly in production without deployments.
- If you’re self‑hosting and versions are out of sync:
- Align your client(s) and server to compatible 3.x versions and run DB migrations. In practice, upgrading to the latest 3.x on both sides usually resolves schema mismatches.
- After upgrading the server, run:
prefect server database upgrade
- If the deployment object looks “incomplete” (a UUID field is null):
- Recreate the deployment (either via prefect deploy or programmatically using flow.from_source(...).deploy(...)) to regenerate a clean record.
Helpful docs
- Prefect Server and version compatibility
- Flow loading (load_flow_from_flow_run)
Can you share:
- Are you using Prefect Cloud or self‑hosted Server?
- The output of prefect version from the worker environment
- One affected flow_run_id, and the output of:
- prefect flow-run inspect <flow_run_id>
- If applicable, prefect deployment inspect "<flow>/<deployment>"
With that, I can point you to the exact fix. If you prefer, we can also turn on more logging by setting PREFECT_LOGGING_LEVEL=DEBUG on the worker and capturing the startup logs for a failing run.Parth Vyas
11/15/2025, 1:01 AMParth Vyas
11/15/2025, 1:28 AMNate
11/15/2025, 1:47 AMParth Vyas
11/15/2025, 2:05 AM3.4.1 on the server. I am triggering flow runs via the HTTP API.
<base path>/deployments/<deploymen Id>/create_flow_runParth Vyas
11/15/2025, 2:05 AMParth Vyas
11/15/2025, 2:37 AMNate
11/15/2025, 3:04 AMprefect versions between your server and client
if your server is on 3.4.1 , is your client on a newer version?