Git LFS "batch request ... 403" Downloading Objects in CI
Git LFS authenticated for the repo but was forbidden (403) when it called the LFS batch API to download objects. The credential can read the Git data but is not authorized for the LFS storage endpoint.
What this error means
A checkout or git lfs pull fails with Error downloading object ...: batch request: ... 403 (or "Forbidden"). Plain Git operations succeed; only the LFS object fetch is denied.
Downloading assets/model.bin (132 MB)
Error downloading object: assets/model.bin (4d7a214):
Smudge error: Error downloading assets/model.bin: batch request:
https://github.com/org/repo.git/info/lfs/objects/batch: 403Common causes
Token lacks access to LFS storage
A token that can read the repo may still be denied at the LFS endpoint - the read permission did not extend to LFS objects, so the batch call returns 403.
Cross-repo LFS without the right credential
Fetching LFS objects from another repo (or a fork) uses a credential never granted access to that repo’s LFS storage, so the batch request is forbidden.
How to fix it
Supply a credential with LFS access
Authenticate the LFS endpoint with a token that has read access to the repo’s objects.
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
git lfs pullUse checkout with LFS and a scoped token
On GitHub Actions, fetch LFS via the action with a token that can read the repo.
- uses: actions/checkout@v4
with:
lfs: true
token: ${{ secrets.LFS_PAT }} # PAT with read access to the LFS repoHow to prevent it
- Grant the CI credential read access to the repo’s LFS storage, not just Git data.
- Use a token scoped to every repo whose LFS objects the job fetches.
- Confirm the LFS batch endpoint is reachable from the runner network.