Oz Shaked
10/10/2024, 10:55 AMjson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
error.
3. Flow Deployment Issues: Deploying a flow to a non-existent Work Pool doesn’t trigger a 404 error; instead, I get a 200 response with a 404 HTML page.
- Example: WorkPool.model_validate(response.json())
fails as the server returns HTML instead of JSON.
4. Client Issues: Using prefect.client.orchestration.get_client
with create_work_pool
sends requests that result in HTML responses, causing JSON parsing failures.
- Example: <Request('GET', '<http://127.0.0.1:4200/csrf-token?client=6bd93e79-f5a8-46b2-b99f-b88891b2d3e0>')>
What version to use? Should I consider building a custom REST API client instead?Marvin
10/10/2024, 10:55 AMAlexander Azzam
10/10/2024, 11:45 AMOz Shaked
10/10/2024, 11:52 AMOz Shaked
10/10/2024, 11:59 AMworker = await client.create_work_pool(WorkPoolCreate(
name=pool_name,
description="Workers to run somthing",
type="process",
concurrency_limit=5))
client is the from prefect.client.orchestration import get_client
Again with the _add_csrf_headers
Creating the work_pool through the /docs
worked and the server's UI worked as wellOz Shaked
10/10/2024, 12:30 PMPREFECT_API_URL=<http://localhost:4200/api>
I defined it as:
PREFECT_API_URL=<http://localhost:4200>
Sorry for that 🥴