Code intelligence LSIF upload failed with "too large" even though < 200Mb in size
Summary
Attempting to upload an uncompressed 76Mb LSIF artifact for Gitlab code intelligence on gitlab.com fails with the error 413 Request Entity Too Large
Steps to reproduce
My CI job is defined as such & produces a 76Mb LSIF (see "relevant logs & screenshots" below)
webapp:code-intelligence(MR):
stage: build-artifacts
script:
- npm ci --prefer-offline
- npx @sourcegraph/scip-typescript index
- |
env \
TAG="v0.4.0" \
OS="$(uname -s | tr '[:upper:]' '[:lower:]')" \
ARCH="$(uname -m | sed -e 's/x86_64/amd64/')" \
bash -c 'curl --location "https://github.com/sourcegraph/scip/releases/download/$TAG/scip-$OS-$ARCH.tar.gz"' \
| tar xzf - scip
- chmod +x scip
- ./scip convert --from index.scip --to dump.lsif
- ls -alh
artifacts:
reports:
lsif: dump.lsif
This is taken from the Gitlab docs here:
https://docs.gitlab.com/user/project/code_intelligence/#add-cicd-jobs-for-code-intelligence
What is the current bug behavior?
The LSIF file fails to upload and responseStatus=413 Request Entity Too Large status=413
is returned.
What is the expected correct behavior?
The file should be uploaded successfully as the limit on gitlab.com was increased to 200Mb in v17.6 and is documented here:
https://docs.gitlab.com/administration/instance_limits/#maximum-file-size-per-type-of-artifact
Relevant logs and/or screenshots
$ npm ci --prefer-offline
> webapp@0.1.0 preinstall
> node ../scripts/checkNodeVersion
added 1040 packages, and audited 1041 packages in 25s
250 packages are looking for funding
run `npm fund` for details
11 vulnerabilities (1 low, 3 moderate, 2 high, 5 critical)
To address all issues, run:
npm audit fix
Run `npm audit` for details.
$ npx @sourcegraph/scip-typescript index
+ /builds/j7E5SA6Na/1/insights-ltd/webapp/tsconfig.node.json (117ms)
.........................
+ /builds/j7E5SA6Na/1/insights-ltd/webapp (51s 562ms)
done /builds/j7E5SA6Na/1/insights-ltd/webapp/index.scip
$ env \ # collapsed multi-line command
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 9577k 100 9577k 0 0 20.4M 0 --:--:-- --:--:-- --:--:-- 20.4M
$ chmod +x scip
$ ./scip convert --from index.scip --to dump.lsif
$ ls -alh
total 115M
drwxr-xr-x. 5 ci ci 16K Sep 2 09:05 .
drwxr-xr-x. 8 ci ci 134 Sep 2 09:03 ..
... snip ...
-rw-r--r--. 1 ci ci 76M Sep 2 09:05 dump.lsif
-rw-r--r--. 1 ci ci 17M Sep 2 09:05 index.scip
-rwxr-xr-x. 1 ci ci 22M Jun 11 2024 scip
... snip ...
Uploading artifacts for successful job
01:18
Uploading artifacts...
webapp/dump.lsif: found 1 matching artifact files and directories
ERROR: Uploading artifacts as "lsif" to coordinator... 413 Request Entity Too Large correlation_id=80214fa591b343459f0a7e30a9bb2219 id=11213435909 responseStatus=413 Request Entity Too Large status=413 token=6a_iRxLKQ
FATAL: too large
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
Output of checks
This bug happens on GitLab.com
Edited by 🤖 GitLab Bot 🤖