Skip to content
Latchkey

GitLab CI "artifacts ... too large" / 413

The artifact upload was rejected for exceeding the maximum artifact size. GitLab caps artifact size per instance and project; an oversized upload returns 413.

What this error means

After the script passes, the "Uploading artifacts" step fails with "too large" or an HTTP 413. The job is marked failed even though the work succeeded.

gitlab-ci
Uploading artifacts...
WARNING: Uploading artifacts as "archive" to coordinator... too large archive
FATAL: too large                                    id=1234 responseStatus=413 Request Entity Too Large

Common causes

Artifact exceeds the size cap

The combined artifacts:paths exceed the maximum artifact size configured for the instance or project, so the coordinator rejects the upload with 413.

Over-broad artifact paths

Capturing whole directories (build outputs plus node_modules, logs, caches) bloats the archive far beyond what later stages need.

How to fix it

Narrow the artifact paths

Upload only what downstream jobs actually consume, and exclude heavy directories.

.gitlab-ci.yml
build:
  script: npm run build
  artifacts:
    paths:
      - dist/
    exclude:
      - dist/**/*.map
    expire_in: 1 day

Raise the limit or use cache instead

  1. For dependencies, use cache: (not artifacts:) so large folders are not re-uploaded.
  2. Compress outputs before declaring them as artifacts.
  3. If genuinely needed, raise the maximum artifact size in instance/project CI/CD settings.

How to prevent it

  • Keep artifact paths scoped to downstream needs only.
  • Use cache for dependencies, artifacts for build outputs.
  • Set expire_in so artifacts do not accumulate.

Frequently asked questions

What causes ""too large" / 413"?
The combined artifacts:paths exceed the maximum artifact size configured for the instance or project, so the coordinator rejects the upload with 413.
How do I fix "too large" / 413?
Upload only what downstream jobs actually consume, 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