Hello <@ULVA73B9P> I just upgraded my Prefect pac...
# ask-marvin
o
Hello @Marvin I just upgraded my Prefect package from 3.0.3 to 3.0.7, and I’m encountering a few issues: 1. UI Problems: Work Pools no longer display, and creating new ones isn’t possible—the types aren’t available (see attached image). 2. Library Errors: When using the Python library (which wraps the API), I get a
json.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?
m
It seems you're encountering several issues after upgrading Prefect to version 3.0.7. Here's a breakdown of the potential problems and some guidance on resolving them: 1. UI Work Pools Display Issue: Unfortunately, I encountered a problem attempting to access the Prefect UI repository for precise issues related to the Work Pools display problem. There might be a known issue or bug with the UI in the latest release, so checking the Prefect GitHub UI repository issues or Prefect documentation could be useful. 2. Library JSONDecodeError: This specific error when dealing with Prefect might be related to the server returning HTML content instead of JSON, which could stem from architectural changes or version mismatches between the client and server. It would help to verify that both client and server parts of your Prefect setup are correctly aligned version-wise. 3. Flow Deployment Issues with HTML 404 Page: This issue is documented in the Prefect GitHub issues, where there's a misalignment or handling problem with server responses that might return HTML instead of JSON. You can follow this issue thread on GitHub for updates and possible patches. 4. Client Issues and JSON Parsing Failures: This problem seems related to the handling of requests within Prefect's client library, possibly due to mismatched expectations of response types. As mentioned, Prefect sometimes returns HTML pages instead of JSON under certain faulty conditions like querying non-existent entities. Recommendations: - Check for updates or patches: It's often helpful to see if a subsequent release has patched these issues or if there are recommended workarounds from the Prefect team. - Consider Downgrading: If immediate resolution is needed, consider downgrading back to a version that was functional before these issues arose, provided there are no critical updates or dependencies requiring 3.0.7. - Custom API Client: While this is a viable approach, it can be quite involved and may lead to issues if Prefect's internal APIs change. It's usually a last resort unless you need highly customized interaction with the Prefect server. - Follow GitHub Discussions and Issues: Actively monitor the Prefect GitHub repository to catch any official guidance or solutions from the maintainers for version 3.x issues. You can participate in discussions or raise new issues directly with Prefect's development team on their GitHub page to gain additional insights or log new bugs.
a
These feel like table stakes things to get right. Can you try 3.0.4 / leave GitHub issues about this?
👍 1
o
Thanks for the fast reply@Alexander Azzam Any specific way you would like me to put in the Issue, specific lines to connect it to??
The following still fails in 3.0.4:
Copy code
worker = 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 well
@Alexander Azzam, found the problem for the jsons. The url for the server should be defined as follows:
PREFECT_API_URL=<http://localhost:4200/api>
I defined it as:
PREFECT_API_URL=<http://localhost:4200>
Sorry for that 🥴