Foobar
01/10/2024, 1:00 AMStepExecutionError(f"Encountered error while running {fqn}") from exc
prefect.deployments.steps.core.StepExecutionError: Encountered error while running prefect.deployments.steps.pip_install_requirements
Foobar
01/10/2024, 1:01 AMpull:
- prefect.deployments.steps.git_clone:
id: my-git
repository: git@github.com:mygit/mygit.git
branch: main
access_token: '{{ github-prefect-dev }}'
- prefect.deployments.steps.pip_install_requirements:
directory: '{{ my-git }}'
requirements_file: requirements.txt
Foobar
01/10/2024, 1:01 AMNate
01/10/2024, 1:03 AMFoobar
01/10/2024, 1:07 AM16:57:03.731 | ERROR | Flow run 'uppish-turkey' - Flow could not be retrieved from deployment.
Traceback (most recent call last):
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/deployments/steps/core.py", line 154, in run_steps
step_output = await run_step(step, upstream_outputs)
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/deployments/steps/core.py", line 125, in run_step
result = await from_async.call_soon_in_new_thread(
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/_internal/concurrency/calls.py", line 293, in aresult
return await asyncio.wrap_future(self.future)
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/_internal/concurrency/calls.py", line 355, in _run_async
result = await coro
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/deployments/steps/utility.py", line 234, in pip_install_requirements
async with open_process(
File "/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 181, in __aenter__
return await self.gen.__anext__()
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/utilities/processutils.py", line 202, in open_process
process = await anyio.open_process(command, **kwargs)
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/anyio/_core/_subprocesses.py", line 126, in open_process
return await get_asynclib().open_process(
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 1041, in open_process
process = await asyncio.create_subprocess_exec(
File "/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/subprocess.py", line 236, in create_subprocess_exec
transport, protocol = await loop.subprocess_exec(
File "/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 1676, in subprocess_exec
transport = await self._make_subprocess_transport(
File "/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/unix_events.py", line 197, in _make_subprocess_transport
transp = _UnixSubprocessTransport(self, protocol, args, shell,
File "/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_subprocess.py", line 36, in __init__
self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
File "/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/unix_events.py", line 789, in _start
self._proc = subprocess.Popen(
File "/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1770, in _execute_child
self.pid = _posixsubprocess.fork_exec(
TypeError: expected str, bytes or os.PathLike object, not dict
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/engine.py", line 414, in retrieve_flow_then_begin_flow_run
flow = await load_flow_from_flow_run(flow_run, client=client)
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/client/utilities.py", line 51, in with_injected_client
return await fn(*args, **kwargs)
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/deployments/deployments.py", line 239, in load_flow_from_flow_run
output = await run_steps(deployment.pull_steps)
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/deployments/steps/core.py", line 182, in run_steps
raise StepExecutionError(f"Encountered error while running {fqn}") from exc
prefect.deployments.steps.core.StepExecutionError: Encountered error while running prefect.deployments.steps.pip_install_requirements
> Running git_clone step...
> Running pip_install_requirements step...
Nate
01/10/2024, 1:18 AMdirectory: '{{ my-git }}'
should be
directory: '{{ my-git.directory }}'
Nate
01/10/2024, 1:18 AMFoobar
01/10/2024, 1:19 AM/opt/homebrew/Cellar/python@3.9/3.9.18_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py:127: RuntimeWarning: 'prefect.engine' found in sys.modules after import of package 'prefect', but prior to execution of 'prefect.engine'; this may result in unpredictable behaviour
warn(RuntimeWarning(msg))
17:14:15.740 | INFO | prefect.deployment - Cloned repository 'git@github.com:my-git/my-git.git' into 'my-git-main'
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
17:14:16.034 | ERROR | Flow run 'watchful-python' - Flow could not be retrieved from deployment.
Traceback (most recent call last):
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/deployments/steps/core.py", line 154, in run_steps
step_output = await run_step(step, upstream_outputs)
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/deployments/steps/core.py", line 125, in run_step
result = await from_async.call_soon_in_new_thread(
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/_internal/concurrency/calls.py", line 293, in aresult
return await asyncio.wrap_future(self.future)
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/_internal/concurrency/calls.py", line 355, in _run_async
result = await coro
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/deployments/steps/utility.py", line 249, in pip_install_requirements
raise RuntimeError(
RuntimeError: pip_install_requirements failed with error code 1: ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/engine.py", line 414, in retrieve_flow_then_begin_flow_run
flow = await load_flow_from_flow_run(flow_run, client=client)
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/client/utilities.py", line 51, in with_injected_client
return await fn(*args, **kwargs)
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/deployments/deployments.py", line 239, in load_flow_from_flow_run
output = await run_steps(deployment.pull_steps)
File "/Users/foobar/development/foobarlabs/fdata/venv/lib/python3.9/site-packages/prefect/deployments/steps/core.py", line 182, in run_steps
raise StepExecutionError(f"Encountered error while running {fqn}") from exc
prefect.deployments.steps.core.StepExecutionError: Encountered error while running prefect.deployments.steps.pip_install_requirements
> Running git_clone step...
> Running pip_install_requirements step...
Nate
01/10/2024, 1:19 AMtheCopy codeTypeError: expected str, bytes or os.PathLike object, not dict
'{{ my-git }}'
is the whole dictionary of outputs from that stepNate
01/10/2024, 1:20 AMFoobar
01/10/2024, 1:20 AMNate
01/10/2024, 1:21 AMls
for debugging -Foobar
01/10/2024, 1:22 AMNate
01/10/2024, 1:22 AMNate
01/10/2024, 1:22 AMFoobar
01/10/2024, 1:23 AMpull
section.. let me play around that.. thanks much!Nate
01/10/2024, 1:23 AMFoobar
01/10/2024, 1:27 AMfoobarlab-main
dir. Here is the ls drwx------ 3 foobar staff 96B Jan 9 17:26 .
drwx------@ 217 foobar staff 6.8K Jan 9 17:25 ..
drwxr-xr-x 6 foobar staff 192B Jan 9 17:26 foobarlabs-main
Foobar
01/10/2024, 1:28 AMNate
01/10/2024, 1:30 AMFoobar
01/10/2024, 1:32 AMFoobar
01/10/2024, 1:36 AMFoobar
01/10/2024, 2:00 AMdirectory: '{{ my-git }}/fdata'
but, now the prefect worker can't find the flow. I guess it assumes everything starts from root ? anyway to work around ? I tried the path
variable by setting to fdata/
, it allowed me to deploy but the worker can't resolve the locationNate
01/10/2024, 2:01 AMprefect.yaml
at repo root? i believe that's a hard requirement at this timeFoobar
01/10/2024, 2:02 AMNate
01/10/2024, 2:04 AMNate
01/10/2024, 2:04 AMFoobar
01/10/2024, 2:05 AMNate
01/10/2024, 2:05 AM