# Git LFS "Object does not exist on the server" in CI

> Fix Git LFS "Object does not exist on the server or you don't have permissions" in CI - the batch API cannot locate the object, either because it is missing or the token is unauthorized.

Source: https://latchkey.dev/learn/command-reference/git-lfs-object-does-not-exist-on-server-in-ci  
Updated: 2026-06-30

The LFS server could not return the object: either it was never uploaded, or the token used cannot access it. The message deliberately covers both a missing object and an authorization gap.

## Using this in CI

CI checkouts are shallow and detached by default, which changes the answer this command gives you. Commands that read history, branch names, or tags need the checkout configured for it.

```.github/workflows/ci.yml
- uses: actions/checkout@v4
  with:
    fetch-depth: 0   # history, tags, and git describe all need this

- run: |
    git rev-parse --is-shallow-repository   # expect false
    git rev-parse --abbrev-ref HEAD          # prints HEAD when detached
```

> `git rev-parse --abbrev-ref HEAD` returns the literal string `HEAD` on a detached checkout rather than a branch name. On GitHub Actions read `github.ref_name` instead; the git command cannot know what it was checked out for.

## FAQ

### What causes Git LFS "Object does not exist on the server" in CI?

There are 2 common causes: the object was never pushed and the token is not authorized for the object. The pointer exists but the content was not uploaded, so the server truthfully has no such object to serve.

### How do I fix Git LFS "Object does not exist on the server" in CI?

There are 2 fixes depending on which cause you have: distinguish missing from unauthorized and authorize the token for cross-repo objects. Work through them in order, since the first is the most common.

### What does Git LFS "Object does not exist on the server" in CI actually mean?

A fetch prints "Object does not exist on the server or you don't have permissions to access it" for a specific oid and the checkout fails.

### How do I stop Git LFS "Object does not exist on the server" in CI happening again?

Verify objects are pushed with git lfs fsck before CI depends on them. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
