Gitlab 15.0.0 secret-detection and sast-report job fail at Uploading artifacts
Summary
I was upgrading gitlab-ce 14.10.2 to 15.0.0 and secret-detection and sast-report Uploading artifacts suddenly hit HTTP 500 error while uploading artifacts.
Steps to reproduce
- Upgrading from 14.10.2 to 15.0.0
- Run https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/SAST.gitlab-ci.yml
- Run https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Secret-Detection.latest.gitlab-ci.yml
What is the current bug behavior?
Scanner running fine, however the job fail while trying to upload the artifacts.
$ /analyzer run
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ GitLab Gosec analyzer v3.5.2
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ Detecting project
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ Found relevant files in project, analyzing entire repository
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ Running analyzer
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ using /go/src/app for the go pkg path
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ go modules detected
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ Fetching dependencies...
[INFO] [Gosec] [2022-05-25T03:12:18Z] ▶ Running gosec...
[INFO] [Gosec] [2022-05-25T03:13:04Z] ▶ Creating report
Uploading artifacts for successful job
Uploading artifacts...
gl-sast-report.json: found 1 matching files and directories
WARNING: Uploading artifacts as "sast" to coordinator... POST https://[redact]/api/v4/jobs/161256/artifacts: 500 Internal Server Error (Missing file) id=161256 responseStatus=500 Internal Server Error status=500 token=EuwSDrgj
WARNING: Retrying... context=artifacts-uploader error=invalid argument
WARNING: Uploading artifacts as "sast" to coordinator... POST https://[redact]/api/v4/jobs/161256/artifacts: 500 Internal Server Error (Missing file) id=161256 responseStatus=500 Internal Server Error status=500 token=EuwSDrgj
WARNING: Retrying... context=artifacts-uploader error=invalid argument
WARNING: Uploading artifacts as "sast" to coordinator... POST https://[redact]/api/v4/jobs/161256/artifacts: 500 Internal Server Error (Missing file) id=161256 responseStatus=500 Internal Server Error status=500 token=EuwSDrgj
What is the expected correct behavior?
upload without 500 error
Relevant logs and/or screenshots
sast
$ /analyzer run
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ GitLab Gosec analyzer v3.5.2
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ Detecting project
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ Found relevant files in project, analyzing entire repository
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ Running analyzer
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ using /go/src/app for the go pkg path
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ go modules detected
[INFO] [Gosec] [2022-05-25T03:11:55Z] ▶ Fetching dependencies...
[INFO] [Gosec] [2022-05-25T03:12:18Z] ▶ Running gosec...
[INFO] [Gosec] [2022-05-25T03:13:04Z] ▶ Creating report
Uploading artifacts for successful job
Uploading artifacts...
gl-sast-report.json: found 1 matching files and directories
WARNING: Uploading artifacts as "sast" to coordinator... POST https://[redact]/api/v4/jobs/161256/artifacts: 500 Internal Server Error (Missing file) id=161256 responseStatus=500 Internal Server Error status=500 token=EuwSDrgj
WARNING: Retrying... context=artifacts-uploader error=invalid argument
WARNING: Uploading artifacts as "sast" to coordinator... POST https://[redact]/api/v4/jobs/161256/artifacts: 500 Internal Server Error (Missing file) id=161256 responseStatus=500 Internal Server Error status=500 token=EuwSDrgj
WARNING: Retrying... context=artifacts-uploader error=invalid argument
WARNING: Uploading artifacts as "sast" to coordinator... POST https://[redact]/api/v4/jobs/161256/artifacts: 500 Internal Server Error (Missing file) id=161256 responseStatus=500 Internal Server Error status=500 token=EuwSDrgj
FATAL: invalid argument
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
secret detection
/analyzer run; exit 0; fi
Running Secret Detection on default branch.
[INFO] [secrets] [2022-05-25T03:16:37Z] ▶ GitLab secrets analyzer v3.27.1
[INFO] [secrets] [2022-05-25T03:16:37Z] ▶ Detecting project
[INFO] [secrets] [2022-05-25T03:16:37Z] ▶ Found relevant files in project, analyzing entire repository
[INFO] [secrets] [2022-05-25T03:16:37Z] ▶ Running analyzer
[INFO] [secrets] [2022-05-25T03:16:37Z] ▶
[INFO] [secrets] [2022-05-25T03:16:37Z] ▶ ○
[INFO] [secrets] [2022-05-25T03:16:37Z] ▶ │╲
[INFO] [secrets] [2022-05-25T03:16:37Z] ▶ │ ○
[INFO] [secrets] [2022-05-25T03:16:37Z] ▶ ○ ░
[INFO] [secrets] [2022-05-25T03:16:37Z] ▶ ░ gitleaks
[INFO] [secrets] [2022-05-25T03:16:37Z] ▶
[INFO] [secrets] [2022-05-25T03:16:43Z] ▶ 3:16AM INF scan completed in 6.15808314s
[INFO] [secrets] [2022-05-25T03:16:43Z] ▶ 3:16AM INF no leaks found
[INFO] [secrets] [2022-05-25T03:16:43Z] ▶ Creating report
Uploading artifacts for successful job
00:06
Uploading artifacts...
gl-secret-detection-report.json: found 1 matching files and directories
WARNING: Uploading artifacts as "archive" to coordinator... POST https://[redact]/api/v4/jobs/161268/artifacts: 500 Internal Server Error (Missing file) id=161268 responseStatus=500 Internal Server Error status=500 token=TS1Lczki
WARNING: Retrying... context=artifacts-uploader error=invalid argument
WARNING: Uploading artifacts as "archive" to coordinator... POST https://[redact]/api/v4/jobs/161268/artifacts: 500 Internal Server Error (Missing file) id=161268 responseStatus=500 Internal Server Error status=500 token=TS1Lczki
WARNING: Retrying... context=artifacts-uploader error=invalid argument
WARNING: Uploading artifacts as "archive" to coordinator... POST https://[redact]/api/v4/jobs/161268/artifacts: 500 Internal Server Error (Missing file) id=161268 responseStatus=500 Internal Server Error status=500 token=TS1Lczki
FATAL: invalid argument
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
Output of checks
no relevant.
Results of GitLab environment info
no relevant.
Results of GitLab application Check
no relevant.
Edited by Teo Cheng Lim