Santiago Toso
06/14/2024, 10:23 AMRuntimeError: Failed to clone repository '<https://git.myorg/project/repo.git>' with exit code 128.
Marvin
06/14/2024, 10:24 AMRuntimeError: Failed to clone repository
with exit code 128 generally indicates an issue with the Git repository access or the specific environment setup. Common causes include:
1. Authentication Issues: Ensure you have the correct access token or SSH key configured.
- For HTTPS access, make sure your personal access token (PAT) is correctly set and has adequate permissions.
- For SSH access, ensure your SSH keys are correctly configured and available.
2. Repository URL: Double-check the repository URL for typos or incorrect formatting. The repository URL should match the format and protocol (HTTPS/SSH) required.
3. Permissions: Make sure the user running the Prefect flow has the necessary read permissions on the repository.
4. Network Access: Ensure the network from which you're running the flow can access the repository URL without any firewall or proxy issues.
5. Configuration in Prefect: Check that the repository configuration and any credentials are correctly specified in your Prefect deployment setup.
### References:
- Github authentication for `git clone` via HTTPS
- Prefect Deployments with Git
### Potential Solutions:
1. Using Personal Access Tokens (PAT):
yaml
pull:
- prefect.deployments.steps.git_clone:
repository: <https://git.myorg/project/repo.git>
branch: main
access_token: "{{ prefect.blocks.secret.git-token }}"
2. Proper Configuration:
Ensure the token or credentials are stored correctly and accessed using Prefect's secret management.
Example of HTTPS configuration in the Prefect YAML:
yaml
pull:
- prefect.deployments.steps.git_clone:
repository: <https://git.yourorg/project/repo.git>
branch: main
access_token: "your-personal-access-token"
3. Using SSH:
If you are using SSH for cloning the repository:
- Ensure your SSH keys are added to the SSH-agent.
- Your repository URL should use the git@...
format.
If these suggestions do not resolve the issue, please review the specific logs around the failed clone operation for more details. You can also find related discussions and solutions in the following GitHub issues:
- Is HTTP private repository supported for the pull action?
- Cloning Error during pull step in deployment only after first run
It might feel like Satan’s square dance, repeatedly having to troubleshoot such issues, but with patience, the problem will be resolved.