GitLab CI "Uploading artifacts ... 413 Request Entity Too Large" in CI
The runner uploaded the job's artifacts and the server rejected the request with 413: the archive is larger than the maximum artifact size configured for the instance or project. The job is marked failed at the upload step.
What this error means
After the script succeeds, the job fails with "Uploading artifacts ... responded with: 413 Request Entity Too Large" or "too large archive".
Uploading artifacts...
WARNING: Uploading artifacts as "archive" to coordinator... 413 Request Entity Too Large
ERROR: Job failed: ...Common causes
The archive exceeds the max artifact size
The collected paths produce an archive larger than the instance/project maximum artifacts size, so the upload is refused.
Over-broad artifact paths
Globbing in node_modules, build caches, or the whole workspace bloats the archive past the limit.
How to fix it
Narrow what you upload
- Restrict
artifacts:pathsto only the outputs you actually need downstream. - Exclude large directories like dependencies and caches.
- Re-run and confirm the upload succeeds.
build:
artifacts:
paths:
- dist/
exclude:
- dist/**/*.mapRaise the artifact size limit
If the artifacts are legitimately large, an admin can raise the maximum artifacts size at the instance or group level.
How to prevent it
- Upload only the specific build outputs needed downstream.
- Exclude dependency and cache directories from artifacts.
- Use cache, not artifacts, for restorable intermediate state.