Skip to content
Latchkey

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.

git lfs output
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: 403

Common 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.

Terminal
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
git lfs pull

Use checkout with LFS and a scoped token

On GitHub Actions, fetch LFS via the action with a token that can read the repo.

.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    lfs: true
    token: ${{ secrets.LFS_PAT }}   # PAT with read access to the LFS repo

How 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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →