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.
Uploading artifacts...
WARNING: Uploading artifacts as "archive" to coordinator... too large archive
FATAL: too large id=1234 responseStatus=413 Request Entity Too LargeCommon 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.
build:
script: npm run build
artifacts:
paths:
- dist/
exclude:
- dist/**/*.map
expire_in: 1 dayRaise the limit or use cache instead
- For dependencies, use
cache:(notartifacts:) so large folders are not re-uploaded. - Compress outputs before declaring them as artifacts.
- 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_inso artifacts do not accumulate.