Pradnyesh Choudhari
07/21/2025, 2:33 PMprefect deploy -n pr-release-migration-deployment-v2
? Would you like to configure schedules for this deployment? [y/n] (y): n
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prefect/cli/_utilities.py", line 42, in wrapper
return fn(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prefect/utilities/asyncutils.py", line 311, in coroutine_wrapper
return call()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prefect/_internal/concurrency/calls.py", line 432, in __call__
return self.result()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prefect/_internal/concurrency/calls.py", line 318, in result
return self.future.result(timeout=timeout)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prefect/_internal/concurrency/calls.py", line 179, in result
return self.__get_result()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
raise self._exception
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prefect/_internal/concurrency/calls.py", line 389, in _run_async
result = await coro
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prefect/cli/deploy.py", line 429, in deploy
await _run_single_deploy(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prefect/client/utilities.py", line 100, in with_injected_client
return await fn(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prefect/cli/deploy.py", line 691, in _run_single_deploy
deployment_id = await client.create_deployment(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prefect/client/orchestration.py", line 1718, in create_deployment
response = await <http://self._client.post|self._client.post>(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/httpx/_client.py", line 1859, in post
return await self.request(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/httpx/_client.py", line 1540, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prefect/client/base.py", line 358, in send
response.raise_for_status()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/prefect/client/base.py", line 171, in raise_for_status
raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Client error '422 Unprocessable Entity' for url '<http://35.209.158.116:8080/api/deployments/>'
Response: {'exception_message': 'Invalid request received.', 'exception_detail': [{'type': 'extra_forbidden', 'loc': ['body', 'infra_overrides'], 'msg': 'Extra inputs are not permitted', 'input': {}}, {'type': 'extra_forbidden', 'loc': ['body', 'manifest_path'], 'msg': 'Extra inputs are not permitted', 'input': None}, {'type': 'extra_forbidden', 'loc': ['body', 'schedule'], 'msg': 'Extra inputs are not permitted', 'input': None}], 'request_body': {'infra_overrides': {}, 'name': 'pr-release-migration-deployment-v2', 'flow_id': '50e5b0ef-4a3a-4d1d-9058-80d8bc5a969a', 'schedules': [], 'enforce_parameter_schema': False, 'parameter_openapi_schema': {'title': 'Parameters', 'type': 'object', 'properties': {'incoming_email_trigger_message': {'position': 0, 'title': 'incoming_email_trigger_message', 'type': 'object'}}, 'required': ['incoming_email_trigger_message']}, 'parameters': {}, 'tags': ['press-release', 'langchain'], 'pull_steps': [{'prefect.deployments.steps.git_clone': {'repository': '<https://gitlab.com/alexeyyoussef-group/pr-infrastructure.git>', 'branch': 'migrating-to-langchain', 'access_token': '{{ prefect.blocks.gitlab-credentials.pr-infrastructure-gitlab-credentials-block.token }}'}}], 'manifest_path': None, 'work_queue_name': 'default', 'work_pool_name': 'pr-worker-pool', 'storage_document_id': None, 'infrastructure_document_id': None, 'schedule': None, 'description': 'Flow for press releases scrapers', 'path': None, 'version': 'v2', 'entrypoint': 'pr_flows/flows/pr_release_flow.py:pr_release_flow'}}
For more information check: <https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422>
An exception occurred.
@Marvin I have been using a prefect.yaml file to deploy my flows and today I got this error, can you explain the error.
deployments:
- name: pr-release-migration-deployment-v2
version: v2
tags: ["press-release", "langchain"]
description: "Flow for press releases scrapers"
flow_name: pr-release-flow:pr-release-flow
entrypoint: pr_flows/flows/pr_release_flow.py:pr_release_flow
work_pool:
name: pr-worker-pool
parameters: {}
work_queue_name: default
Marvin
07/21/2025, 2:33 PMMarvin
07/21/2025, 2:35 PMpython
'exception_detail': [
{'type': 'extra_forbidden', 'loc': ['body', 'infra_overrides'], 'msg': 'Extra inputs are not permitted'},
{'type': 'extra_forbidden', 'loc': ['body', 'manifest_path'], 'msg': 'Extra inputs are not permitted'},
{'type': 'extra_forbidden', 'loc': ['body', 'schedule'], 'msg': 'Extra inputs are not permitted'}
]
The error suggests that your deployment configuration includes some fields that are no longer valid in the current version of Prefect. Let's check your prefect.yaml
file structure:
1. The flow_name
field in your YAML appears to be incorrectly formatted. Instead of:
yaml
flow_name: pr-release-flow:pr_release_flow
You should use the entrypoint
field (which you already have correctly specified):
yaml
entrypoint: pr_flows/flows/pr_release_flow.py:pr_release_flow
Here's a corrected version of your `prefect.yaml`:
yaml
deployments:
- name: pr-release-migration-deployment-v2
version: v2
tags: ["press-release", "langchain"]
description: "Flow for press releases scrapers"
entrypoint: pr_flows/flows/pr_release_flow.py:pr_release_flow
work_pool:
name: pr-worker-pool
work_queue_name: default
To fix this issue:
1. Remove the flow_name
field as it's redundant with entrypoint
2. Make sure you're using the latest version of Prefect
3. Try deploying again with the corrected YAML file
Also, I notice you're using a custom server (based on the URL in the error: `http://35.209.158.116:8080`). Make sure your server is running a compatible version with your client.
If you continue to experience issues, you might want to try:
1. Running prefect deploy --help
to verify the current command syntax
2. Checking that your Prefect client and server versions match
3. If possible, updating to the latest version of Prefect
Would you like me to check any specific aspects of the deployment command or would you like to share your Prefect version information so I can provide more targeted assistance?