Skip to content
Latchkey

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.

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.

Related guides

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