Wrong artifacts size report
Summary
Gitlab runner terminates a job because of wrongly sized artifacts path.
Steps to reproduce
Gitlab runner reports a failure return for an output file named /dist created during the build stage with size 20~ mb which contains the 100mb Maximum artifacts size (MB) configuration.
.gitlab-ci.yml
cache:
paths:
- $PWD/node_modules
...
Compile:
stage: build
tags:
- frontend
- project-testing
artifacts:
paths:
- dist/
expire_in: 1 hour
untracked: true
only:
refs:
- branches
variables:
- $CI_COMMIT_MESSAGE =~ /^staging\s=>\s/
script:
- npm run build --prod
after_script:
- du -hcs dist/
...
Actual behavior
The build job fails with the logs in below.
Expected behavior
The path (/dist) was expected to be present for 1 hour
Relevant logs and/or screenshots
job log
Running with gitlab-runner 12.1.0 (de7731dd)
on <RUNNER-DESCRIPTION> <RUNNER-TOKEN>
Using Shell executor...
Running on gitlab...
Fetching changes...
Reinitialized existing Git repository in /home/gitlab-runner/builds/<RUNNER-TOKEN>/0/<PROJECT-PATH>/.git/
Checking out dcfbd78a as ci_cd...
Removing node_modules/
Skipping Git submodules setup
Checking cache for default...
Runtime platform
arch
=amd64 os
=linux pid
=32669 revision
=de7731dd version
=12.1.0
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted.
Successfully extracted cache
$ npm run build --prod
> project@0.0.0 build /home/gitlab-runner/builds/<RUNNER-TOKEN>/0/<PROJECT-PATH>
> ng build
chunk {main} main-es2015.js, main-es2015.js.map (main) 60.3 kB [initial] [rendered]
chunk {polyfills} polyfills-es2015.js, polyfills-es2015.js.map (polyfills) 251 kB [initial] [rendered]
chunk {runtime} runtime-es2015.js, runtime-es2015.js.map (runtime) 6.09 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 142 kB [entry] [rendered]
chunk {styles} styles-es2015.js, styles-es2015.js.map (styles) 965 kB [initial] [rendered]
chunk {vendor} vendor-es2015.js, vendor-es2015.js.map (vendor) 4.26 MB [initial] [rendered]
Date: 2019-09-03T14:02:07.421Z - Hash: 5d496719cff28db8020f - Time: 47064ms
chunk {main} main-es5.js, main-es5.js.map (main) 62.2 kB [initial] [rendered]
chunk {polyfills} polyfills-es5.js, polyfills-es5.js.map (polyfills) 558 kB [initial] [rendered]
chunk {runtime} runtime-es5.js, runtime-es5.js.map (runtime) 6.09 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 142 kB [entry] [rendered]
chunk {styles} styles-es5.js, styles-es5.js.map (styles) 965 kB [initial] [rendered]
chunk {vendor} vendor-es5.js, vendor-es5.js.map (vendor) 4.34 MB [initial] [rendered]
Date: 2019-09-03T14:02:41.998Z - Hash: 976bd4dbd977c9f9c912 - Time: 34389ms
Running after script...
$ du -hcs dist/
24M dist
24M total
Creating cache default...
Runtime platform
arch
=amd64 os
=linux pid
=489 revision
=de7731dd version
=12.1.0
/home/gitlab-runner/builds/<RUNNER-TOKEN>/0/<PROJECT-PATH>/node_modules: found 37879 matching files
No URL provided, cache will be not uploaded to shared cache server. Cache will be stored only locally.
Created cache
Uploading artifacts...
Runtime platform
arch
=amd64 os
=linux pid
=640 revision
=de7731dd version
=12.1.0
dist/: found 26 matching files
untracked: found 33589 files
ERROR: Uploading artifacts to coordinator... too large archive
id
=2752
responseStatus
=413 Request Entity Too Large
status
=413 Request Entity Too Large
token
=YViYBrvB
FATAL: too large
ERROR: Job failed: exit status 1
Environment description
Environment version contents
root@gitlab:/# gitlab-runner --version
Version: 12.1.0
Git revision: de7731dd
Git branch: 12-1-stable
GO version: go1.8.7
Built: 2019-07-19T13:53:04+0000
OS/Arch: linux/amd64
root@gitlab:/# npm -v
6.11.2
root@gitlab:/# node -v
v12.9.1
root@gitlab:/# gitlab-ctl status
run: alertmanager: (pid 1738) 1119653s; run: log: (pid 1641) 1119653s
run: crond: (pid 1790) 1119652s; run: log: (pid 1636) 1119653s
run: gitaly: (pid 1724) 1119653s; run: log: (pid 1634) 1119653s
run: gitlab-monitor: (pid 1954) 1119651s; run: log: (pid 1644) 1119653s
run: gitlab-workhorse: (pid 1678) 1119653s; run: log: (pid 1643) 1119653s
run: grafana: (pid 1791) 1119652s; run: log: (pid 1638) 1119653s
run: logrotate: (pid 29611) 3591s; run: log: (pid 1632) 1119653s
run: nginx: (pid 2047) 1119651s; run: log: (pid 1639) 1119653s
run: node-exporter: (pid 1681) 1119653s; run: log: (pid 1637) 1119653s
run: postgres-exporter: (pid 1739) 1119653s; run: log: (pid 1640) 1119653s
run: postgresql: (pid 1670) 1119653s; run: log: (pid 1669) 1119653s
run: prometheus: (pid 2039) 1119651s; run: log: (pid 1646) 1119653s
run: redis: (pid 1846) 1119652s; run: log: (pid 1645) 1119653s
run: redis-exporter: (pid 1982) 1119651s; run: log: (pid 1642) 1119653s
run: sidekiq: (pid 1679) 1119653s; run: log: (pid 1633) 1119653s
run: unicorn: (pid 1672) 1119653s; run: log: (pid 1635) 1119653s
root@gitlab:/# gitlab-rails -h
--------------------------------------------------------------------------------
GitLab: 12.1.6 (4016bcac51d)
GitLab Shell: 9.3.0
PostgreSQL: 10.7
--------------------------------------------------------------------------------
config.toml contents
concurrent = 1
check_interval = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "<RUNNER-DESCRIPTION>"
url = "https://<HOST>/"
token = "<RUNNER-TOKEN>"
executor = "shell"
[runners.custom_build_dir]
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.custom]
run_exec = ""
Used GitLab Runner version
root@gitlab: gitlab-runner --version
Version: 12.1.0
Git revision: de7731dd
Git branch: 12-1-stable
GO version: go1.8.7
Built: 2019-07-19T13:53:04+0000
OS/Arch: linux/amd64
