Zachary Loertscher

05/12/2023, 1:51 PM
Hi all, we are running Prefect (2.8.7) with a github storage block, and I am running into the error
FileNotFoundError: [Errno 2] No such file or directory: 'git'
. It was working fine, until we re-deployed a fresh EC2, and now it's not working. Is there any kind of configuration I'm missing, other than having a git-hub block & having
installed on the EC2? Any help is so appreciated! (Full stack trace in thread)
Downloading flow code from storage at ''
09:48:40 AM
Flow could not be retrieved from deployment.
Traceback (most recent call last):
  File "/home/airbyte/.local/lib/python3.8/site-packages/prefect/", line 277, in retrieve_flow_then_begin_flow_run
    flow = await load_flow_from_flow_run(flow_run, client=client)
  File "/home/airbyte/.local/lib/python3.8/site-packages/prefect/client/", line 40, in with_injected_client
    return await fn(*args, **kwargs)
  File "/home/airbyte/.local/lib/python3.8/site-packages/prefect/", line 194, in load_flow_from_flow_run
    await storage_block.get_directory(from_path=deployment.path, local_path=".")
  File "/home/airbyte/.local/lib/python3.8/site-packages/prefect_github/", line 146, in get_directory
    process = await run_process(cmd, stream_output=(out_stream, err_stream))
  File "/home/airbyte/.local/lib/python3.8/site-packages/prefect/utilities/", line 258, in run_process
    async with open_process(
  File "/usr/lib64/python3.8/", line 171, in __aenter__
    return await self.gen.__anext__()
  File "/home/airbyte/.local/lib/python3.8/site-packages/prefect/utilities/", line 202, in open_process
    process = await anyio.open_process(command, **kwargs)
  File "/home/airbyte/.local/lib/python3.8/site-packages/anyio/_core/", line 127, in open_process
    return await get_asynclib().open_process(
  File "/home/airbyte/.local/lib/python3.8/site-packages/anyio/_backends/", line 1105, in open_process
    process = await asyncio.create_subprocess_exec(
  File "/usr/lib64/python3.8/asyncio/", line 236, in create_subprocess_exec
    transport, protocol = await loop.subprocess_exec(
  File "/usr/lib64/python3.8/asyncio/", line 1630, in subprocess_exec
    transport = await self._make_subprocess_transport(
  File "/usr/lib64/python3.8/asyncio/", line 197, in _make_subprocess_transport
    transp = _UnixSubprocessTransport(self, protocol, args, shell,
  File "/usr/lib64/python3.8/asyncio/", line 36, in __init__
    self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
  File "/usr/lib64/python3.8/asyncio/", line 789, in _start
    self._proc = subprocess.Popen(
  File "/usr/lib64/python3.8/", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib64/python3.8/", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'git'


05/12/2023, 2:00 PM
according to the traceback prefect invoke git which is not installed on your fresh VM
apt update && apt install git
for debian based distro as example

Zachary Loertscher

05/12/2023, 2:01 PM
Ahh I knew we were missing something - thank you so much, I will try this