PrefectHQ / prefect

Prefect is a workflow orchestration framework for building resilient data pipelines in Python.
https://prefect.io
Apache License 2.0
15.79k stars 1.54k forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'git' on git clone step #14504

Closed brizzbuzz closed 2 months ago

brizzbuzz commented 2 months ago

First check

Bug summary

When attempting to run the git clone step for a deployed flow, prefect throws an error about not being able to find git

Jul 08 09:20:41 prefect prefect-worker-start[7448]: FileNotFoundError: [Errno 2] No such file or directory: 'git'
Jul 08 09:20:41 prefect prefect-worker-start[7448]: The above exception was the direct cause of the following exception:
Jul 08 09:20:41 prefect prefect-worker-start[7448]: Traceback (most recent call last):
Jul 08 09:20:41 prefect prefect-worker-start[7448]:   File "/.venv/lib/python3.11/site-packages/prefect/engine.py", line 37, in <module>
Jul 08 09:20:41 prefect prefect-worker-start[7448]:     flow_run, flow = load_flow_and_flow_run(flow_run_id=flow_run_id)
Jul 08 09:20:41 prefect prefect-worker-start[7448]:                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul 08 09:20:41 prefect prefect-worker-start[7448]:   File "/.venv/lib/python3.11/site-packages/prefect/flow_engine.py", line 97, in load_flow_and_flow_run
Jul 08 09:20:41 prefect prefect-worker-start[7448]:     flow = run_coro_as_sync(load_flow_from_flow_run(flow_run))
Jul 08 09:20:41 prefect prefect-worker-start[7448]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul 08 09:20:41 prefect prefect-worker-start[7448]:   File "/.venv/lib/python3.11/site-packages/prefect/utilities/asyncutils.py", line 249, in run_coro_as_sync
Jul 08 09:20:41 prefect prefect-worker-start[7448]:     return call.result()

Reproduction

Flow definition 

name: galactus
prefect-version: 3.0.0rc10

# build section allows you to manage and build docker images
build:

# push section allows you to manage if and how this project is uploaded to remote locations
push:

# pull section allows you to provide instructions for cloning this project in remote locations
pull:
- prefect.deployments.steps.git_clone:
    repository: git@github.com:blah/blah.git
    branch: main
deployments:
- name: do_thing
  version: 0.1.0
  tags: []
  description: do thing
  entrypoint: src/flows/do_thing.py:do_thing
  parameters: {}
  enforce_parameter_schema: true
  work_pool:
    name: Testing
    job_variables: {}
    work_queue_name:
  schedules: []

### Error

```python3
see above

Versions (prefect version output)

Version:             3.0.0rc10
API version:         0.8.4
Python version:      3.11.9
Git commit:          200cf212
Built:               Wed, Jul 3, 2024 1:39 PM
OS/Arch:             darwin/arm64
Profile:             default
Server type:         server
Pydantic version:    2.8.0

Additional context

No response

brizzbuzz commented 2 months ago

perhaps also worth mentioning, I am trying to authenticate using SSH, rather than the auth token approach

taranlu-houzz commented 1 month ago

Hi @brizzbuzz, I was wondering if you ended up figuring out what caused this issue? I think I am running into the same thing. I ran through the quickstart tutorial locally and all worked as expected, but when I have try to set things up in Docker, it fails with that error.

Edit: My issue was that git was not installed in my Docker image.