Symptoms:
- I see the error message: “Error during clone: Exceeded maximum retries for git” when trying to run my Unity Build Automation build.
- My Build Automation builds were working fine just a few days ago, but now they are consistently failing during the clone step.
- I suspect there’s an issue related to Git LFS or my repository configuration.
Cause:
This error is somewhat general and can arise from several factors, but the two most common causes are:
- Git LFS quota limitations — If you’re using GitHub or another Git hosting service with LFS (Large File Storage), you may have exceeded your storage or bandwidth quota. This can block further LFS downloads, which leads to clone failures.
- Missing LFS objects or insufficient permissions — Sometimes the LFS object no longer exists on the server, or your Personal Access Token (PAT) lacks the necessary permissions to access the LFS objects during the clone.
Resolution:
To resolve the issue, follow these steps:
Check your Git LFS quota
- If using GitHub, go to Settings → Billing and Plans → Plans and Usage to review your LFS storage and bandwidth usage.
- If you’ve hit the quota, consider increasing the LFS storage or bandwidth allocation for your repository.
Verify PAT permissions
- Ensure your Personal Access Token (PAT) has the following permissions: repo (Full control of private repositories) & admin:repo_hook (Full control of repository hooks), or create a new PAT.
Push missing LFS objects
- Run the following command to push any missing LFS objects to your remote repository:
git lfs push origin --all
- After pushing, trigger a new clean build to confirm the issue is resolved.
More information: