Open j-tr opened 10 months ago
Hi @j-tr, thanks for this issue! We've added it to our backlog and will look into it soon :)
facing the same issue on 2.14.9 . added the env variable using prefect config command but still failed
Flow could not be retrieved from deployment.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/prefect/deployments/steps/core.py", line 124, in run_steps
step_func = _get_function_for_step(fqn, requires=keywords.get("requires"))
File "/usr/local/lib/python3.10/site-packages/prefect/deployments/steps/core.py", line 94, in run_step
File "/usr/local/lib/python3.10/site-packages/prefect/deployments/steps/core.py", line 61, in _get_function_for_step
File "/usr/local/lib/python3.10/site-packages/prefect/utilities/importtools.py", line 212, in import_object
module = load_module(module_name)
File "/usr/local/lib/python3.10/site-packages/prefect/utilities/importtools.py", line 183, in load_module
return importlib.import_module(module_name)
File "/usr/local/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/prefect/engine.py", line 394, in retrieve_flow_then_begin_flow_run client: PrefectClient, File "/usr/local/lib/python3.10/site-packages/prefect/client/utilities.py", line 51, in with_injected_client return await fn(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/prefect/deployments/deployments.py", line 217, in load_flow_from_flow_run storage_document = await client.read_block_document( File "/usr/local/lib/python3.10/site-packages/prefect/deployments/steps/core.py", line 152, in run_steps category=DeprecationWarning, prefect.deployments.steps.core.StepExecutionError: Encountered error while running prefect_aws.deployments.steps.pull_from_s3
First check
Bug summary
A pull_step might install its own requirements, which might contain conflicting versions of already installed dependencies (e.g. prefect itself). Version constraints of a pull_step requirement might change even for minor versions (e.g. https://github.com/PrefectHQ/prefect-aws/compare/v0.4.1...v0.4.2, prefect-aws 0.4.1 requires prefect>=2.10.11, prefect-aws 0.4.2 requires prefect>=2.13.5).
This can lead to the situation where:
While pinning the requirements versions of a pull step to a specific version solves the issue, I would expect that Prefect checks if the installation of pull_step requirements would overwrite already installed code and refuse to install, instead of running unexpected errors later on.
Reproduction
Error
Additional context
While the example uses an older Prefect version, I think this is still relevant as it shows the possibility of an unintended upgrade.