Jason Wiener
10/03/2023, 2:08 PMprefect.exceptions.PrefectHTTPStatusError: Client error '422 Unprocessable Entity' for url '<http://127.0.0.1:4242/api/deployments/>'
Response: {'exception_message': 'Invalid request received.', 'exception_detail': [{'loc': ['body', 'enforce_parameter_schema'], 'msg': 'extra fields not permitted', 'type': 'value
_error.extra'}], 'request_body': {'name': 'default', 'flow_id': '6f09086b-c4fd-486a-b503-92efffa9c827', 'enforce_parameter_schema': False, 'parameter_openapi_schema': {'title': 'P
arameters', 'type': 'object', 'properties': {'repo_name': {'title': 'repo_name', 'default': 'PrefectHQ/prefect', 'position': 0, 'type': 'string'}}}, 'parameters': {}, 'tags': [],
'pull_steps': [{'prefect.deployments.steps.git_clone': {'repository': '<https://xxx.org/elt/prefect-scripts.git>', 'branch': 'master', 'access_token': '{{ prefect.blocks
.secret.deployment-default-get-repo-info-repo-token }}'}}], 'manifest_path': None, 'work_queue_name': None, 'work_pool_name': 'default', 'storage_document_id': None, 'infrastr
ucture_document_id': None, 'schedule': None, 'description': None, 'path': None, 'version': None, 'entrypoint': 'tutorials/tutorial-xxx.py:get_repo_info_xxx', 'infra_overrides': {}}}
Marvin
10/03/2023, 2:08 PMenforce_parameter_schema
field. This field is not recognized by the Prefect API, hence the error.
You might want to check your request and remove any fields that are not required or recognized by the Prefect API. It's a tedious task, I know, but then again, so is most of human existence, isn't it?Jason Wiener
10/03/2023, 2:11 PMenforce_parameter_schema
is generated by the Prefect client. Is there a setting I can alter to omit this field?Marvin
10/03/2023, 2:12 PMenforce_parameter_schema
field is indeed part of the Prefect client. You can control its behavior via the prefect.yaml
file or through the prefect deploy
command.
If you want to disable this field, you can do so by setting enforce_parameter_schema
to False
in your prefect.yaml
file. Alternatively, you can use the --enforce-parameter-schema
flag with the prefect deploy
command to control this behavior.
Remember, the universe is full of wonderful things patiently waiting for our wits to grow sharper. Or, in this case, for our API payloads to become valid.Jason Wiener
10/03/2023, 2:15 PMMarvin
10/03/2023, 2:16 PMprefect.yaml
file to disable the enforce_parameter_schema
field:
yaml
context:
logging:
level: INFO
secrets:
GITHUB_TOKEN: ""
deployments:
default:
type: Local
enforce_parameter_schema: False
The enforce_parameter_schema
field is set to False
under the deployments
section. This should prevent the Prefect client from including this field in the API payload.
Remember, this is just an example. Your prefect.yaml
file might look different based on your specific needs and configurations. Life, like software configuration, is full of endless possibilities, each more tedious than the last.Jason Wiener
10/03/2023, 2:31 PMMarvin
10/03/2023, 2:32 PMJason Wiener
10/03/2023, 3:18 PMvalues.yaml
for the server chart to prefectTag: 2.13.4-python3.10
from prefectTag: 2-latest
and redeploying.Sai
10/03/2023, 8:42 PMJason Wiener
10/03/2023, 9:03 PMprefecthq/prefect:2.13.4-python3.9
on Docker Hub so I think yes but I haven't tried.