Skip to content
Latchkey

GitLab CI "Artifact is too large" / Upload Rejected

The artifact upload was rejected for exceeding the maximum allowed size. GitLab enforces a per-artifact limit at the instance and project level, and your archive went over it.

What this error means

After the script succeeds, the "Uploading artifacts" step fails with "too large archive" or a 413 Request Entity Too Large. The job is otherwise green; only the artifact upload fails.

Job log
Uploading artifacts...
build/: found 12043 matching files and directories
ERROR: Uploading artifacts as "archive" to coordinator... too large archive
id=4821 responseStatus=413 Request Entity Too Large

Common causes

Archive exceeds the max artifact size

Instance/project settings cap artifact size. A build that bundles node_modules, caches, or large binaries blows past the limit.

Over-broad artifact paths

A broad paths (e.g. the whole workspace) sweeps in files you never need downstream, inflating the archive.

How to fix it

Upload only what downstream needs

Narrow paths to the real outputs and exclude heavy directories.

.gitlab-ci.yml
artifacts:
  paths:
    - dist/
  exclude:
    - dist/**/*.map
  expire_in: 1 week

Use cache for inputs, artifacts for outputs

  1. Keep node_modules/build inputs in cache, not artifacts.
  2. Reserve artifacts for the final outputs needed by later stages or downloads.
  3. If genuinely needed, ask an admin to raise the project artifact size limit.

How to prevent it

  • Scope artifact paths tightly to real outputs.
  • Use cache for dependencies and intermediates.
  • Set expire_in so storage does not grow unbounded.

Frequently asked questions

What causes ""artifact too large""?
Instance/project settings cap artifact size. A build that bundles node_modules, caches, or large binaries blows past the limit.
How do I fix "artifact too large"?
Narrow paths to the real outputs and exclude heavy directories.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card