agent failed to download the repo: git lfs auth error mid-clone
Fixes an agent failing to download a repo with a git LFS auth error mid-clone: fix LFS authentication. Use when clones fail on LFS objects. Not for plain git auth errors.
TL;DR
Git authenticated fine but LFS did not; they use separate credential flows. Configure the LFS credential helper or token, then retry the clone or pull the LFS objects explicitly.
Error
agent failed to download the repo: git lfs auth error mid-cloneSteps
- Confirm plain git objects cloned fine and only LFS objects failed. Expected: LFS-specific failure.
- Check how LFS authenticates: it reuses git credentials but can need its own config. Expected: the auth path understood.
- Provide the credential the way the host expects (helper, token, or SSH). Expected: LFS authenticates.
- Retry with an explicit LFS pull to isolate it from the clone. Expected: objects download.
- Re-run the full clone. Expected: complete.
When to use
- Clones failing partway on LFS.
- Agent environments cloning LFS repos.
When not to use
- Plain git auth failures (fix git creds).
- LFS objects missing on the server (different error).
Tool compatibility
- Git LFS; hosting credential helpers.
Variant phrasings
git lfs authentication failed
Fix the LFS creds.
lfs objects failed to download
Same auth fix.
Why it happens
LFS makes separate HTTPS calls for objects; the git credential setup does not always carry over.
Edge cases
- Tokens need LFS scope, not just repo read.
- Partial clones leave a repo that looks complete but is not; verify LFS status.
- CI needs the LFS credential in the job, not just on the runner.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_Nd6IegPG2ZgfQsmtAXOULA