Test failures when using gitlab-runner:alpine 15.9.0 - Permission denied creating /builds/ directory
### Summary
Reliable E2E tests are failing as the test pipeline is always failing with this error:
Seems to only occur for the shell executor which is what a number of tests use.
```
Running with gitlab-runner 15.9.0 (c20f0bec)
on runner-for-project-with-security-findings-118129e4b9ec6304 hsLPUzH2, system ID: r_ZvMVyOaZApPi
Resolving secrets
00:00
Preparing the "shell" executor
00:00
Using Shell (bash) executor...
Preparing environment
00:00
Running on 6da33fade79a...
Getting source from Git repository
00:00
mkdir: can't create directory '/builds/': Permission denied
Uploading artifacts for failed job
00:00
mkdir: can't create directory '/builds/': Permission denied
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1
```
.gitlab-ci.yaml
```
include:
template: Dependency-Scanning.gitlab-ci.yml
template: Container-Scanning.gitlab-ci.yml
template: SAST.gitlab-ci.yml
template: DAST.gitlab-ci.yml
template: License-Scanning.gitlab-ci.yml
dependency_scanning:
tags: [secure_report]
script:
- echo "Skipped"
artifacts:
reports:
dependency_scanning: gl-dependency-scanning-report.json
container_scanning:
tags: [secure_report]
only: null # Template defaults to feature branches only
variables:
GIT_STRATEGY: fetch # Template defaults to none, which stops fetching the premade report
script:
- echo "Skipped"
artifacts:
reports:
container_scanning: gl-container-scanning-report.json
sast:
tags: [secure_report]
only: null # Template defaults to feature branches only
script:
- echo "Skipped"
artifacts:
reports:
sast: gl-sast-report.json
dast:
tags: [secure_report]
only: null # Template defaults to feature branches only
script:
- echo "Skipped"
artifacts:
reports:
dast: gl-dast-report.json
license_scanning:
tags: [secure_report]
script:
- echo "Skipped"
artifacts:
reports:
license_scanning: gl-license-scanning-report.json
```
<!-- Summarize the bug encountered concisely. -->
### Steps to reproduce
<!-- Describe how one can reproduce the issue - this is very important. Please use an ordered list. -->
### Example Project
https://staging.gitlab.com/gitlab-qa-sandbox-group-2/qa-test-2023-02-20-00-38-59-6328e724efa29470/project-with-security-findings-118129e4b9ec6304/-/jobs/44118175
<!-- If possible, please create an example project here on GitLab.com that exhibits the problematic
behavior, and link to it here in the bug report. If you are using an older version of GitLab, this
will also determine whether the bug is fixed in a more recent version. -->
### What is the current *bug* behavior?
<!-- Describe what actually happens. -->
### What is the expected *correct* behavior?
<!-- Describe what you should see instead. -->
### Relevant logs and/or screenshots
<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code
as it's tough to read otherwise. -->
### Output of checks
<!-- If you are reporting a bug on GitLab.com, uncomment below -->
<!-- This bug happens on GitLab.com -->
<!-- /label ~"reproduced on GitLab.com" -->
#### Results of GitLab environment info
<!-- Input any relevant GitLab environment information if needed. -->
<details>
<summary>Expand for output related to GitLab environment info</summary>
<pre>
(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)
(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
</pre>
</details>
#### Results of GitLab application Check
<!-- Input any relevant GitLab application check information if needed. -->
<details>
<summary>Expand for output related to the GitLab application check</summary>
<pre>
(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:check SANITIZE=true`)
(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true`)
(we will only investigate if the tests are passing)
</pre>
</details>
### Possible fixes
<!-- If you can, link to the line of code that might be responsible for the problem. -->
issue