Skip to content
LatchkeyLatchkey home

Git LFS "git lfs push ... 413 Request Entity Too Large" in CI

The LFS object upload was rejected with 413 Request Entity Too Large. Either the LFS server enforces a per-object cap or a proxy in front of it limits request body size below the object.

What this error means

git lfs push fails with "LFS: [413] Request Entity Too Large" for a large object while smaller objects upload fine.

git-lfs
Uploading LFS objects: 0% (0/1), 0 B | 0 B/s
LFS: [413] Request Entity Too Large: https://lfs.internal.example.com/objects/...
error: failed to push some refs

Common causes

A reverse proxy caps request body size

A self-hosted LFS server behind nginx or similar may set a low client_max_body_size, rejecting large object uploads with 413.

The LFS server enforces a per-object limit

Some LFS backends refuse objects above a configured size, returning 413 for the offending blob.

How to fix it

Raise the proxy body-size limit

  1. Identify the proxy in front of the LFS server.
  2. Increase its max body size above the largest object.
  3. Retry the push.
nginx.conf
# nginx in front of the LFS server
client_max_body_size 5g;

Split or shrink oversized objects

Where the server limit is fixed, reduce object size (compress, chunk) or move very large artifacts to dedicated storage.

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

How to prevent it

  • Set proxy body-size limits above your largest LFS object.
  • Keep LFS objects within the server per-object cap.
  • Store extreme artifacts outside LFS when they exceed limits.

Frequently asked questions

What causes Git LFS "git lfs push ... 413 request entity too Large" in CI?
There are 2 common causes: a reverse proxy caps request body size and the lfs server enforces a per-object limit. A self-hosted LFS server behind nginx or similar may set a low client_max_body_size, rejecting large object uploads with 413.
How do I fix Git LFS "git lfs push ... 413 request entity too Large" in CI?
There are 2 fixes depending on which cause you have: raise the proxy body-size limit and split or shrink oversized objects. Work through them in order, since the first is the most common.
What does Git LFS "git lfs push ... 413 request entity too Large" in CI actually mean?
git lfs push fails with "LFS: [413] Request Entity Too Large" for a large object while smaller objects upload fine.
How do I stop Git LFS "git lfs push ... 413 request entity too Large" in CI happening again?
Set proxy body-size limits above your largest LFS object. The prevention section lists 3 changes that keep it from recurring.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card