Chu
03/26/2026, 2:26 PMPOST /task_runs/
PR #20822 upgraded FastAPI from 0.128 to 0.132 and changed the client's create_task_run to send json= instead of content=. But no server-side backward compatibility was added. Since the server's FastAPI pin is >=0.111.0,<1.0.0, any
server upgrade can pull in FastAPI 0.132+, which rejects the old client's content= (raw JSON string) body with:
Input should be a valid dictionary or object to extract fields from
This means you can't upgrade the server independently of the client — a server upgrade silently breaks all deployed clients still on <3.6.19. Is that right?Marvin
03/26/2026, 2:26 PMMarvin
03/26/2026, 2:26 PMChu
03/26/2026, 2:26 PMMarvin
03/26/2026, 2:26 PMMarvin
03/26/2026, 2:26 PMChu
03/26/2026, 2:28 PMMarvin
03/26/2026, 2:28 PMMarvin
03/26/2026, 2:31 PMcontent= (raw JSON string) instead of json=. FastAPI 0.132 won’t parse that as JSON, so the server receives a string where it expects a dict and returns 422 (“Input should be a valid dictionary or object…”).
- Change was introduced in PR #20822 (client switched to json=); there isn’t a server-side compatibility shim.
- Release notes: Prefect 3.6.19
Recommended paths:
- Preferred: upgrade clients/agents/workers to >= 3.6.19 at the same time as the server.
pip install --upgrade "prefect>=3.6.19"
prefect version
- Temporary mitigation if you must stagger: keep the server on < 3.6.19 or pin FastAPI < 0.132 in your server image/env until all clients are upgraded.
# option A: pin Prefect server
prefect<3.6.19
# option B: if you must run 3.6.19 server, constrain FastAPI
fastapi<0.132
- If you control custom client code on 3.5.0, switch your direct calls to use json=... (but Prefect’s built-in client change is only in 3.6.19+, so upgrading the library is the clean fix).
Are you on Prefect OSS or Cloud, and do you need guidance for a staggered rollout (e.g., Helm/Docker pinning)? I can suggest concrete steps for your deployment setup.