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.
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 LargeCommon 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.
artifacts:
paths:
- dist/
exclude:
- dist/**/*.map
expire_in: 1 weekUse cache for inputs, artifacts for outputs
- Keep
node_modules/build inputs incache, notartifacts. - Reserve
artifactsfor the final outputs needed by later stages or downloads. - If genuinely needed, ask an admin to raise the project artifact size limit.
How to prevent it
- Scope artifact
pathstightly to real outputs. - Use
cachefor dependencies and intermediates. - Set
expire_inso storage does not grow unbounded.