Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying a deployment to Prefect Cloud with 2.7.4-2.7.6 leads to a 422 Error #8102

Closed
4 tasks done
discdiver opened this issue Jan 8, 2023 · 4 comments
Closed
4 tasks done
Labels
bug Something isn't working cloud Related to Prefect Cloud

Comments

@discdiver
Copy link
Contributor

discdiver commented Jan 8, 2023

First check

  • I added a descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Prefect documentation for this issue.
  • I checked that this issue is related to Prefect and not one of its dependencies.

Bug summary

Applying a deployment to Prefect Cloud with 2.7.6 leads to a 422 Error.

This error appears to only affect 2.7.4-2.7.6.- edited.

If this error is affecting you, you can upgrade to 2.7.7 with pip install prefect -U

Reproduction

from prefect import flow


@flow
def hi():
    print("hi")



prefect deployment build flows.py:hi -n sev-six -a

Error

(sev-six) jeffhale prefect/demos $ prefect deployment build flows.py:hi -n sev-six -a
Found flow 'hi'
Default '.prefectignore' file written to /Users/jeffhale/Desktop/prefect/demos/.prefectignore
Deployment YAML created at '/Users/jeffhale/Desktop/prefect/demos/hi-deployment.yaml'.
Deployment storage None does not have upload capabilities; no files uploaded.  Pass --skip-upload to suppress this warning.
Traceback (most recent call last):
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/site-packages/prefect/cli/_utilities.py", line 41, in wrapper
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/site-packages/prefect/utilities/asyncutils.py", line 230, in coroutine_wrapper
    return run_async_in_new_loop(async_fn, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/site-packages/prefect/utilities/asyncutils.py", line 181, in run_async_in_new_loop
    return anyio.run(partial(__fn, *args, **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/site-packages/anyio/_core/_eventloop.py", line 70, in run
    return asynclib.run(func, *args, **backend_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 292, in run
    return native_run(wrapper(), debug=debug)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/asyncio/base_events.py", line 650, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 287, in wrapper
    return await func(*args)
           ^^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/site-packages/prefect/cli/deployment.py", line 966, in build
    deployment_id = await deployment.apply()
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/site-packages/prefect/deployments.py", line 631, in apply
    deployment_id = await client.create_deployment(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/site-packages/prefect/client/orion.py", line 1277, in create_deployment
    response = await self._client.post(
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/site-packages/httpx/_client.py", line 1848, in post
    return await self.request(
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/site-packages/httpx/_client.py", line 1533, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/site-packages/prefect/client/base.py", line 251, in send
    response.raise_for_status()
  File "/Users/jeffhale/miniforge3/envs/sev-six/lib/python3.11/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 'https://api.prefect.cloud/api/accounts/cbad165a-7057-416a-bb31-a0aab3f1d0cf/workspaces/a575bdc0-4dcc-4ad4-b286-3639c7077307/deployments/'
For more information check: https://httpstatuses.com/422


### Versions

```Text
Happens with 2.7.6 when try to apply to Prefect Cloud

Does not happen with 2.7.3, 2.7.0.


(sev-six) jeffhale prefect/demos $ prefect version
Version:             2.7.6
API version:         0.8.4
Python version:      3.11.0
Git commit:          528c8300
Built:               Wed, Jan 4, 2023 5:27 PM
OS/Arch:             darwin/arm64
Profile:             jeffmshale
Server type:         cloud

(sev-six) jeffhale prefect/



### Additional context

_No response_
@discdiver discdiver added bug Something isn't working status:triage labels Jan 8, 2023
@cwhatley
Copy link

cwhatley commented Jan 9, 2023

I had the same with a deployment using 2.7.4 today and upgraded to 2.7.7 to get it to work.

@discdiver discdiver changed the title Applying a deployment to Prefect Cloud with 2.7.6 leads to a 422 Error Applying a deployment to Prefect Cloud with 2.7.4-2.7.6 leads to a 422 Error Jan 9, 2023
@trahloff
Copy link

trahloff commented Jan 9, 2023

Can confirm, this also impacts our setup

@amitlissack
Copy link

Also affecting our setup using prefect==2.7.5

@peytonrunyan peytonrunyan added the cloud Related to Prefect Cloud label Jan 11, 2023
@peytonrunyan
Copy link
Contributor

Addressed by #8107 and a separate cloud release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cloud Related to Prefect Cloud
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants