Hello, We're running on Prefect 2.7.8. Up until t...
# prefect-community
s
Hello, We're running on Prefect 2.7.8. Up until today our Prefect deployment CI/CD job was working just fine. We haven't performed any recent version upgrades to our environment or our Python dependencies. This error began to occur a earlier today:
Copy code
httpx.HTTPStatusError: Client error '422 Unprocessable Entity' for url '***/deployments/'
For more information check: <https://httpstatuses.com/422>
A version upgrade to Prefect 2.7.9 appears to have solved the issue. However, it's strange that our CI/CD for deployments started failing seemingly out of no where. Does anyone know the cause of this issue?
1
Full Traceback:
Copy code
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/runner/_work/nimbus/nimbus/orchestration/build_flow_deployments.py", line 162, in <module>
    main(args)
  File "/runner/_work/nimbus/nimbus/orchestration/build_flow_deployments.py", line 129, in main
    create_and_apply_flow_deployments(
  File "/runner/_work/nimbus/nimbus/orchestration/build_flow_deployments.py", line 92, in create_and_apply_flow_deployments
    create_flow_deployment(
  File "/runner/_work/nimbus/nimbus/orchestration/build_config.py", line 87, in create_flow_deployment
    deployment_id = deployment.apply(work_queue_concurrency=work_queue_concurrency)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 230, in coroutine_wrapper
    return run_async_in_new_loop(async_fn, *args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/prefect/utilities/asyncutils.py", line 181, in run_async_in_new_loop
    return anyio.run(partial(__fn, *args, **kwargs))
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/anyio/_core/_eventloop.py", line 70, in run
    return asynclib.run(func, *args, **backend_options)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 292, in run
    return native_run(wrapper(), debug=debug)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 287, in wrapper
    return await func(*args)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/prefect/deployments.py", line 652, in apply
    deployment_id = await client.create_deployment(
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/prefect/client/orion.py", line 1320, in create_deployment
    response = await <http://self._client.post|self._client.post>(
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/httpx/_client.py", line 1848, in post
    return await self.request(
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/httpx/_client.py", line 1533, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/prefect/client/base.py", line 253, in send
    response.raise_for_status()
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/httpx/_models.py", line 749, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '422 Unprocessable Entity' for url '***/deployments/'
For more information check: <https://httpstatuses.com/422>
b
I am getting the same issue, I really have to upgrade?
s
Upgrading seems to have resolved it for us.
b
facepalm
k
Hi all, Prefect has fixed this for 2.7.8 and you should not be experiencing the 422 error anymore.
f
I seem to be getting a similar or the same error on 2.7.9 and 2.7.10
Copy code
httpx.HTTPStatusError: Client error '404 Not Found' for url '<https://XXXXXXXX.eu-west-1.awsapprunner.com/api/block_schemas/checksum/sha256:6db1ab242e7b2b88a52dc137a7da3a373af63e0a103b9a91e060ed54a26f395a?version=2.7.9>'
For more information check: <https://httpstatuses.com/404>

...

During handling of the above exception, another exception occurred:

httpx.HTTPStatusError: Client error '422 Unprocessable Entity' for url '<https://XXXXXXXX.eu-west-1.awsapprunner.com/api/block_schemas/>'
For more information check: <https://httpstatuses.com/422>