<@ULVA73B9P> I get the following error deploying t...
# ask-marvin
a
@Marvin I get the following error deploying to Prefect3 prefect.exceptions.PrefectHTTPStatusError: Client error ‘422 Unprocessable Entity’ for url ‘http://localhost:4200/api/deployments/
m
It seems like you're encountering a
422 Unprocessable Entity
error when deploying to Prefect 3. This error typically indicates an issue with the request payload being sent to the Prefect server. In the context of Prefect 3.x, one common cause could be related to field mismatches in the deployment payload. From my search on GitHub issues, there is a relevant issue here where using certain API calls results in 422 errors due to extra fields such as
infra_overrides
being sent which the server does not recognize. To address this issue, you can: 1. Ensure that your client and server versions of Prefect are compatible. Mismatches in client-server API expectations can lead to errors like this. 2. Double-check the deployment code and ensure that no deprecated or unsupported fields (like
infra_overrides
) are being included in your requests. Unfortunately, I couldn't perform the documentation search correctly due to a technical issue. However, I recommend reviewing the Prefect 3.x deployment documentation to ensure you're following the latest guidelines: Prefect 3.x Deployment Guide. If the problem persists, you might also consider opening or checking current GitHub issues for updates or patches from the Prefect development team.
n
hi @Avi - can you share the traceback? this sounds like a schema mismatch
a
I see that the server is 3.0.2 but the client is 3.0.4. Now I am aligning
n
can you share what the actual mismatch was? was it related to labels?
a
Here is the entire trace:
Copy code
Running deployment push steps...
 > Running push_to_s3 step...
Traceback (most recent call last):
  File "/Users/avisaidian/projects/data-utils/prefect3/.venv/lib/python3.10/site-packages/prefect/cli/_utilities.py", line 42, in wrapper
    return fn(*args, **kwargs)
  File "/Users/avisaidian/projects/data-utils/prefect3/.venv/lib/python3.10/site-packages/prefect/cli/_types.py", line 153, in sync_fn
    return asyncio.run(async_fn(*args, **kwargs))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/Users/avisaidian/projects/data-utils/prefect3/.venv/lib/python3.10/site-packages/prefect/cli/deploy.py", line 448, in deploy
    await _run_single_deploy(
  File "/Users/avisaidian/projects/data-utils/prefect3/.venv/lib/python3.10/site-packages/prefect/client/utilities.py", line 103, in with_injected_client
    return await fn(*args, **kwargs)
  File "/Users/avisaidian/projects/data-utils/prefect3/.venv/lib/python3.10/site-packages/prefect/cli/deploy.py", line 713, in _run_single_deploy
    deployment_id = await client.create_deployment(
  File "/Users/avisaidian/projects/data-utils/prefect3/.venv/lib/python3.10/site-packages/prefect/client/orchestration.py", line 1727, in create_deployment
    response = await <http://self._client.post|self._client.post>(
  File "/Users/avisaidian/projects/data-utils/prefect3/.venv/lib/python3.10/site-packages/httpx/_client.py", line 1905, in post
    return await self.request(
  File "/Users/avisaidian/projects/data-utils/prefect3/.venv/lib/python3.10/site-packages/httpx/_client.py", line 1585, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/Users/avisaidian/projects/data-utils/prefect3/.venv/lib/python3.10/site-packages/prefect/client/base.py", line 361, in send
    response.raise_for_status()
  File "/Users/avisaidian/projects/data-utils/prefect3/.venv/lib/python3.10/site-packages/prefect/client/base.py", line 174, in raise_for_status
    raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Client error '422 Unprocessable Entity' for url '<http://localhost:4200/api/deployments/>'
Response: {'exception_message': 'Invalid request received.', 'exception_detail': [{'type': 'extra_forbidden', 'loc': ['body', 'concurrency_options'], 'msg': 'Extra inputs are not permitted', 'input': None}], 'request_body': {'name': 'test1', 'flow_id': 'fcb32f4b-8d6c-4f28-aa21-320733ab4187', 'schedules': [], 'concurrency_limit': None, 'concurrency_options': None, 'enforce_parameter_schema': True, 'parameter_openapi_schema': {'title': 'Parameters', 'type': 'object', 'properties': {'repo_owner': {'default': 'PrefectHQ', 'position': 0, 'title': 'repo_owner', 'type': 'string'}, 'repo_name': {'default': 'prefect', 'position': 1, 'title': 'repo_name', 'type': 'string'}}, 'definitions': {}}, 'parameters': {}, 'tags': [], 'pull_steps': [{'prefect_aws.deployments.steps.pull_from_s3': {'id': 'pull_code', 'requires': 'prefect-aws>=0.3.4', 'bucket': 'aiola-dev-common-bucket', 'folder': 'prefect/deployments/prefect3'}}], 'work_queue_name': 'default', 'work_pool_name': 'local-k8s', 'storage_document_id': None, 'infrastructure_document_id': None, 'description': 'Given a GitHub repository, logs the number of stargazers\nand contributors for that repo.', 'path': None, 'version': None, 'entrypoint': 'flows/hello.py:my_flow', 'job_variables': {}}}
For more information check: <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422>
An exception occurred.
n
Copy code
{'type': 'extra_forbidden', 'loc': ['body', 'concurrency_options']
aha, thank you!
a
after aligning it worked