Maarten
10/18/2024, 2:03 PMfrom prefect_demo_test import run_prefect_demo_flow
from prefect.runner.storage import LocalStorage
from pathlib import Path
if __name__ == '__main__':
# Deploy a flow
run_prefect_demo_flow.from_source(
source=str(Path(__file__).parent),
entrypoint="prefect_demo_test.py:run_prefect_demo_flow"
).deploy(
name='deployed-demo-image-halcon-processing-workflow',
work_pool_name='halcon-pool'
# tags=['halcon','demo'],
# parameters=dict({
# "storage_rootpath_variable_name":"prefect_storage_filepath",
# "project_variable_name":"current_project_name"}),
# description='Demo workflow processing images with halcon from a deployment',
)
But i get an error response what is wrong? Error: prefect.deployments.runner.DeploymentApplyError: Error while applying deployment: Client error '422 Unprocessable Entity' for url 'http://127.0.0.1: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': 'deployed-demo-image-halcon-processing-workflow', 'flow_id': '6cd656ec-23ab-4310-82c4-0f3b90bbfd94', 'paused': False, 'schedules': [], 'concurrency_limit': None, 'concurrency_options': None, 'enforce_parameter_schema': True, 'parameter_openapi_schema': {'title': 'Parameters', 'type': 'object', 'properties': {'storage_rootpath_variable_name': {'position': 0, 'title': 'storage_rootpath_variable_name', 'type': 'string'}, 'project_variable_name': {'position': 1, 'title': 'project_variable_name', 'type': 'string'}}, 'required': ['storage_rootpath_variable_name', 'project_variable_name']}, 'parameters': {}, 'tags': [], 'pull_steps': [{'prefect.deployments.steps.set_working_directory': {'directory': 'C:\\repos\\ai-data-pipeline'}}], 'work_queue_name': None, 'work_pool_name': 'halcon-pool', 'storage_document_id': None, 'infrastructure_document_id': None, 'description': 'Runs the prefect ai data pipeline flow\n- Gets variables to laod a metadat file\n- Read metadata file and process images\n- Update metadata and write updates to storage', 'path': None, 'version': 'c9393244be33c404894a5c4581a89651', 'entrypoint': 'prefect_demo_test.py:run_prefect_demo_flow', 'job_variables': {}}}Marvin
10/18/2024, 2:03 PMI'm trying to deploy a flow in python code with:
from prefect_demo_test import run_prefect_demo_flow
from prefect.runner.storage import LocalStorage
from pathlib import Path
if __name__ == '__main__':
# Deploy a flow
run_prefect_demo_flow.from_source(
source=str(Path(__file__).parent),
entrypoint="prefect_demo_test.py:run_prefect_demo_flow"
).deploy(
name='deployed-demo-image-halcon-processing-workflow',
work_pool_name='halcon-pool'
# tags=['halcon','demo'],
# parameters=dict({
# "storage_rootpath_variable_name":"prefect_storage_filepath",
# "project_variable_name":"current_project_name"}),
# description='Demo workflow processing images with halcon from a deployment',
)
But i get an error response what is wrong? Error: prefect.deployments.runner.DeploymentApplyError: Error while applying deployment: Client error '422 Unprocessable Entity' for url 'http://127.0.0.1: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': 'deployed-demo-image-halcon-processing-workflow', 'flow_id': '6Maarten
10/18/2024, 2:04 PMMarvin
10/18/2024, 2:05 PMMaarten
10/18/2024, 2:06 PMrun_prefect_demo_flow.from_source(
source=str(Path(__file__).parent),
entrypoint="prefect_demo_test.py:run_prefect_demo_flow"
).deploy(
name='deployed-demo-image-halcon-processing-workflow',
work_pool_name='halcon-pool'
)
But i get an error response what is wrong? Error: prefect.deployments.runner.DeploymentApplyError: Error while applying deployment: Client error '422 Unprocessable Entity' for url 'http://127.0.0.1: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': 'deployed-demo-image-halcon-processing-workflow', 'flow_id': '6cd656ec-23ab-4310-82c4-0f3b90bbfd94', 'paused': False, 'schedules': [], 'concurrency_limit': None, 'concurrency_options': None, 'enforce_parameter_schema': True, 'parameter_openapi_schema': {'title': 'Parameters', 'type': 'object', 'properties': {'storage_rootpath_variable_name': {'position': 0, 'title': 'storage_rootpath_variable_name', 'type': 'string'}, 'project_variable_name': {'position': 1, 'title': 'project_variable_name', 'type': 'string'}}, 'required': ['storage_rootpath_variable_name', 'project_variable_name']}, 'parameters': {}, 'tags': [], 'pull_steps': [{'prefect.deployments.steps.set_working_directory': {'directory': 'C:\\repos\\ai-data-pipeline'}}], 'work_queue_name': None, 'work_pool_name': 'halcon-pool', 'storage_document_id': None, 'infrastructure_document_id': None, 'description': 'Runs the prefect ai data pipeline flow\n- Gets variables to laod a metadat file\n- Read metadata file and process images\n- Update metadata and write updates to storage', 'path': None, 'version': 'c9393244be33c404894a5c4581a89651', 'entrypoint': 'prefect_demo_test.py:run_prefect_demo_flow', 'job_variables': {}}}Marvin
10/18/2024, 2:06 PMI'm trying to deploy a flow in python code with:
run_prefect_demo_flow.from_source(
source=str(Path(__file__).parent),
entrypoint="prefect_demo_test.py:run_prefect_demo_flow"
).deploy(
name='deployed-demo-image-halcon-processing-workflow',
work_pool_name='halcon-pool'
)
But i get an error response what is wrong? Error: prefect.deployments.runner.DeploymentApplyError: Error while applying deployment: Client error '422 Unprocessable Entity' for url 'http://127.0.0.1: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': 'deployed-demo-image-halcon-processing-workflow', 'flow_id': '6cd656ec-23ab-4310-82c4-0f3b90bbfd94', 'paused': False, 'schedules': [], 'concurrency_limit': None, 'concurrency_options': None, 'enforce_parameter_schema': True, 'parameter_openapi_schema': {'title': 'Parameters', 'type': 'object', 'properties': {'storage_rootpath_variable_name': {'position': 0, 'title': 'storageMaarten
10/18/2024, 2:06 PMrun_prefect_demo_flow.from_source(
source=str(Path(__file__).parent),
entrypoint="prefect_demo_test.py:run_prefect_demo_flow"
).deploy(
name='deployed-demo-image-halcon-processing-workflow',
work_pool_name='halcon-pool'
)
But i get an error response what is wrong? Error: prefect.deployments.runner.DeploymentApplyError: Error while applying deployment: Client error '422 Unprocessable Entity' for url 'http://127.0.0.1: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':Marvin
10/18/2024, 2:06 PMconcurrency_options
.
To help you resolve this, I will need to check the documentation and potential issues related to deployment in the version of Prefect you are using. Could you please confirm which version of Prefect you are using, or let me know if you need assistance finding that out? If you're not sure, I can run some checks to identify the version you have.Maarten
10/18/2024, 2:07 PMMarvin
10/18/2024, 2:07 PMconcurrency_options
) not permitted by the server. This is a known issue that can occur when there are mismatches between client and server versions, or if unexpected parameters are provided.
Here are a few steps you can take to resolve the issue:
1. Version Compatibility: Ensure that the client and server versions of Prefect are compatible. Prefect recommends that all clients should be the same version as the server or older. You can find more details about version compatibility here: Prefect Compatibility.
2. Examine Concurrency Options: The error suggests the presence of concurrency_options
which might not be necessary or supported. Review your code to make sure you are not including any unsupported concurrency settings.
3. Check for Known Issues and Updates: Review the GitHub issues and see if there's a bug related to your problem. Here's a relevant issue that describes a similar error scenario: Issue #15650.
4. Use Prefect CLI for Additional Debugging: You can use the Prefect CLI to list, create, delete, or inspect concurrency limits, as per the documentation: Global Concurrency Limits.
Make sure to adjust the deployment code according to these insights and try deploying again. If the problem persists, it might be helpful to see if updating Prefect to the latest version resolves the issue.