<@ULVA73B9P> After upgrading prefect self-hosted worker &amp; server from 3.6.17 to 3.6.20 while kee...
p
@Marvin After upgrading prefect self-hosted worker & server from 3.6.17 to 3.6.20 while keeping v3.6.17 in the flow code, I get this error for the flows that launch tasks:
Copy code
Encountered exception during execution: PrefectHTTPStatusError('Client error \'422 Unprocessable Entity\' for url \'<http://my-prefect-oss-domain/api/task_runs/>\'\nResponse: {\'exception_message\': \'Invalid request received.\', \'exception_detail\': [{\'type\': \'model_attributes_type\', \'loc\': [\'body\'], \'msg\': \'Input should be a valid dictionary or object to extract fields from\'
It is likely due to PR 20822. Is it expected to have client/server incompatibility between minor versions like that ?
m
thought for 320.1 seconds
Short answer: yes, in this specific case it’s an expected incompatibility — and the fix is to align your flow runtime to the same Prefect version as your server/worker. What changed - In 3.6.20 we adjusted how the client sends JSON to the API (moving to httpx’s json= dict style to ensure proper Content-Type) to match newer FastAPI behavior. See PR #20822. - With a 3.6.20 server and a 3.6.17 client, POSTs to /api/task_runs/ can be parsed as a raw string instead of a JSON object, leading to 422 "Input should be a valid dictionary or object to extract fields from." That matches the error you’re seeing. Compatibility guidance - We recommend keeping server/worker and flow environments on the same Prefect version for best results. - Minor releases can include dependency bumps (e.g., FastAPI) that change request parsing. That can make newer servers stricter than older clients. - Prefect docs on version alignment: https://docs.prefect.io/v3/how-to-guides/cloud/troubleshoot-cloud How to resolve - Recommended: upgrade your flow environment to prefect==3.6.20 to match your server/worker. - If you’re using containers, switch your image to a 3.6.20 tag (e.g., prefecthq/prefect:3.6.20-<python>). - If you’re using a virtualenv, pip install --upgrade "prefect==3.6.20". - Temporary alternative: roll back server/worker to 3.6.17 until you can update the flow runtime. Release notes for reference: Prefect 3.6.20 If you share how your flows are packaged/executed (Docker, Kubernetes, or process worker) I can give you exact steps to align the versions.
👍 1
p
The client/server alignment is discussed here : https://docs.prefect.io/v3/concepts/server