<@ULVA73B9P> Explain why the following deployment ...
# ask-marvin
c
@Marvin Explain why the following deployment pull steps result in the error message "
Copy code
No such file or directory: '/opt/prefect/dataflow-orchestration-main'
Copy code
pull:
- prefect.deployments.steps.git_clone:
    access_token: '{{ prefect.blocks.secret.XXXXXX
      }}'
    branch: main
    id: git_clone
    repository: <https://github.com/AAAA/repo.git>
- prefect.deployments.steps.set_working_directory:
    directory: '/opt/prefect/{{ git_clone.directory }}'
m
thought for 295.5 seconds
Short answer: you’re building a path that doesn’t exist by prepending /opt/prefect to the git_clone output. Details: - In Prefect 3.x, the pull step prefect.deployments.steps.git_clone clones the repo and returns a dict with a directory key that points to the clone location (typically an absolute path). You should pass that value directly to later steps. - Your set_working_directory step is hardcoding a prefix: directory: '/opt/prefect/{{ git_clone.directory }}'. If git_clone.directory is already an absolute path, this produces an invalid path. Even if it’s relative, git clone doesn’t create a folder like repo-name-main; that -main suffix is from GitHub ZIP downloads, not git clone. So /opt/prefect/dataflow-orchestration-main likely doesn’t exist. Fix:
Copy code
pull:
- prefect.deployments.steps.git_clone:
    id: git_clone
    repository: <https://github.com/AAAA/repo.git>
    branch: main
    access_token: '{{ prefect.blocks.secret.XXXXXX }}'
- prefect.deployments.steps.set_working_directory:
    directory: '{{ git_clone.directory }}'
    # If your templating requires it, use: '{{ steps.git_clone.directory }}'
References: - Deployment pull steps API (git_clone, set_working_directory) - prefect.yaml structure and step templating