ASHIK
08/21/2025, 7:59 AMMarvin
08/21/2025, 8:00 AMMarvin
08/21/2025, 8:05 AMprefect flow-run inspect <FLOW_RUN_ID>
- See if the deployment still exists:
prefect deployment ls
- Ensure your worker’s PREFECT_API_URL
points to the same server as where the run was created (and that it’s reachable). Example: <http://prefect-server>
should resolve from the worker container/host.
2) TypeError: 'MockValSer' cannot be converted to 'SchemaSerializer'
- This occurs while Prefect is trying to mark the run as cancelled and serialize the state (Pydantic 2.x serializer interaction). It’s a known issue that shows up during cancellation and in a few concurrency patterns.
- Related issues you can follow:
- Serialization error on canceling a flow run (ProcessPoolExecutor)
- Intermittent errors with container flows; includes the same MockValSer trace
- Dask task-from-task; same MockValSer pattern
Recommended next steps
- Upgrade Prefect everywhere (server and all workers) to the latest 3.x. We’ve made a number of fixes around cancellation and client behavior recently:
- Latest release notes: Prefect 3.4.13 release
- If you’re using Docker, use the matching tag for both server and workers. If using pip:
pip install -U "prefect>=3.4.13"
- Ensure you’re not deleting deployments while runs from them are still active. If you need to decommission, let currently scheduled runs finish first.
- If a run is stuck “Canceling”, you can clean it up:
prefect flow-run delete <FLOW_RUN_ID>
- If the 404 persists:
- Confirm the worker and UI/CLI are connected to the same API (same base URL and database).
- Re-create the deployment and re-run (note: the old UUID won’t match, but this will prevent new runs from failing in the same way).
Could you share:
- Prefect version for server and worker
- Worker type (process/docker/kubernetes/etc.)
- Your PREFECT_API_URL
value (or how workers are discovering the API)
- Whether the deployment was recently deleted or renamed
With that info, I can give more precise guidance or help tie your case to one of the GitHub issues above.