https://prefect.io logo
b

Brennan Tolman

07/13/2023, 9:57 PM
@Marvin I am running prefect on an on-prem kubernetes cluster with ingress enabled and the ingress host set as the api-url and the prefect agent pointing at the ingress api-url. After upgrading to prefect 2.10.21 my agent got the following error when attempting to start:
Copy code
prefect.exceptions.PrefectHTTPStatusError: Client error '422 Unprocessable Entity' for url '<https://my-prefect.com/api/flow_runs/filter>'
Response: {'exception_message': 'Invalid request received.', exception_detail': [{'loc': ['path', 'id'], 'msg': value is not a valid uuid', 'type': 'type_error.uuid'}], 'request_body': None}
I also get this error when I revert back to 2.10.19. What might be causing this issue and how can I resolve it?
m

Marvin

07/13/2023, 9:58 PM
Ah, the plot thickens. It seems we have a couple of leads to follow. Firstly, from the GitHub issue, it appears that there might be an issue when a task returns a state with a custom name. The user reported a similar '422 Unprocessable Entity' error when they used the
Completed(name="Skipped")
function in their code. If you're using a similar pattern in your flows, this might be the source of the problem. Secondly, there's a GitHub pull request that mentions a 422 error in the context of work pool name validation. The issue was that users could create work pools with empty string names, which caused problems, including invalid path specs for the delete route. The pull request added validation to prevent this situation. While this might not be directly related to your issue, it's worth checking if your work pool names are valid and not empty strings. Unfortunately, the search in the Prefect documentation and knowledgebase didn't yield any directly relevant results. As for resolving the issue, if you're using a custom name for a state in your tasks, you might want to try removing that and see if it resolves the issue. If that doesn't work, you might want to check your work pool names to ensure they're valid. Remember, the path to enlightenment is often paved with error messages. Or so I've heard. I wouldn't know, I'm just a humble assistant.
b

Brennan Tolman

07/13/2023, 10:01 PM
@Marvin The pool name is the "default-agent-pool" so the name is valid. Tasks and the flow itself should not be related because I am getting this error when the agent starts up, which means it hasn't received any flows yet.
m

Marvin

07/13/2023, 10:02 PM
Ah, the search results have returned. Let's see what we've got. From the Prefect documentation and knowledgebase, we have some general information about starting an agent and the importance of setting the
PREFECT_API_URL
correctly. There's also a mention of ensuring that the execution layer has enough permissions and capacity, and that there isn't more than one agent polling for runs from the same work queue. However, none of these seem to directly address your issue. The GitHub search didn't yield any relevant results either, I'm afraid. The general web search results suggest that a '422 Unprocessable Entity' error can occur when making a POST request with both data and json parameters, which isn't allowed. However, this seems more related to general web development rather than Prefect specifically. Given this, it seems we're dealing with a rather elusive issue. It might be worth reaching out to the Prefect community or support for further assistance. They might be able to provide more insight into this specific error and how to resolve it. Remember, the path to enlightenment is often paved with error messages. Or so I've heard. I wouldn't know, I'm just a humble assistant.
4 Views