/build/build.sh: No such file or directory
Summary
GitLab Runner can't find /build/build.sh
on a project.
- It's a
shell
runner. - The project uses Auto DevOps.
- The project contains a Docker file in its root dir.
- The branch built is not the main branch.
- Similar issues exist.
Steps to reproduce
That's hard to tell. Here is what we did:
- First, we had an older GitLab and Runner v.
11.8.0 (4745a6f3)
. That went fine, the Docker Image built and put into the Container Registry. Nice. - Now after upgrading and some time we are getting the below log, essentially saying
/build/build.sh: No such file or directory
after each push and retry.
We are using Auto DevOps on the branch, hence no .gitlab-ci.yml
.
Project directory:
somebody@example:~/somedir/docker-nginx-brotli$ tree
.
├── Dockerfile
├── nginx.conf
├── nginx.vh.default.conf
├── README.md
└── travis.py
Actual behavior
- docker build is never started
Expected behavior
- docker build
- docker push
as described on https://docs.gitlab.com/ee/topics/autodevops/stages.html#auto-build-using-a-dockerfile
Relevant logs and/or screenshots
job log
new:
Running with gitlab-runner 13.0.0 (c127439c)
on build.example.com:nginx-brotli 76fde655
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:00
Running on build...
Getting source from Git repository
00:01
Fetching changes...
Initialisierte leeres Git-Repository in /home/gitlab-runner/builds/76fde655/0/elearning/docker-nginx-brotli/.git/
Created fresh repository.
Von https://git.example.com/elearning/docker-nginx-brotli
* [neue Referenz] refs/pipelines/6332 -> refs/pipelines/6332
* [neuer Branch] master -> origin/master
* [neuer Branch] mlu -> origin/mlu
* [neuer Branch] nginx-mlu -> origin/nginx-mlu
Checking out 26ccae9e as mlu...
Skipping Git submodules setup
Restoring cache
00:00
Downloading artifacts
00:00
Running before_script and script
00:00
$ if [[ -z "$CI_COMMIT_TAG" ]]; then # collapsed multi-line command
$ /build/build.sh
bash: Zeile 127: /build/build.sh: Datei oder Verzeichnis nicht gefunden
Running after_script
00:00
Uploading artifacts for failed job
00:00
ERROR: Job failed: exit status 1
old:
Running with gitlab-runner 11.8.0 (4745a6f3)
on build.example.com:nginx-brotli 76fde655
Using Shell executor...
Running on build...
00:00
Fetching changes...
00:02
Lösche .codeclimate.yml
Lösche .csslintrc
Lösche .eslintignore
Lösche .eslintrc.yml
Lösche .rubocop.yml
Lösche coffeelint.json
Lösche gl-code-quality-report.json
HEAD ist jetzt bei 6a08a2a Build bro tool
Von https://git.example.com/elearning/docker-nginx-brotli
* [neuer Branch] mlu -> origin/mlu
Checking out 6a08a2ae as mlu...
Skipping Git submodules setup
$ # Auto DevOps variables and functions # collapsed multi-line command
00:04
$ setup_docker
$ build
Logging to GitLab Container Registry with CI credentials...
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /home/gitlab-runner/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
Building Dockerfile-based application...
Step 1/9 : FROM alpine:3.7
---> 34ea7509dcad
Step 2/9 : LABEL maintainer="NGINX Docker Maintainers <docker-maint@nginx.com>"
---> Using cache
---> 8c134252fff3
Step 3/9 : ARG NGINX_VERSION=1.13.9
---> Using cache
---> e3c4cfdc6dd9
Step 4/9 : ARG NGX_BROTLI_COMMIT=bfd2885
---> Using cache
---> c1f1d5d093e9
Step 5/9 : RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 && CONFIG="
...
"
Step 9/9 : CMD ["nginx", "-g", "daemon off;"]
---> Using cache
---> 3a1236f8f150
Successfully built 3a1236f8f150
Successfully tagged docker-registry.example.com/elearning/docker-nginx-brotli/mlu:6a08a2aec32fc518d25641ff7934f74745cdXXXX
Pushing to GitLab Container Registry...
The push refers to repository [docker-registry.example.com/elearning/docker-nginx-brotli/mlu]
6d3e839cf859: Preparing
9320f4825119: Preparing
08560a13a380: Preparing
ebf12965380b: Preparing
08560a13a380: Mounted from elearning/docker-nginx-brotli/master
ebf12965380b: Mounted from elearning/docker-nginx-brotli/master
9320f4825119: Mounted from elearning/docker-nginx-brotli/master
6d3e839cf859: Mounted from elearning/docker-nginx-brotli/master
6a08a2aec32fc518d25641ff7934f74745cdXXXX: digest: sha256:83689495ae99123bd04ee3b25fb7c9e11dda33edd70efaf6d52bc1303112XXXX size: 1154
Job succeeded
Environment description
- custom installation: yes
- runner version: 12.10.1 and 13.0.0 (c127439c) after upgrade to the newest available version [issue still persists]
- gitlab: 12.9.2 (ac5568eb5d8)
- executor: shell (bash)
- Ubuntu 16.04.6 LTS
config.toml contents
[[runners]]
name = "build.example.com:nginx-brotli"
url = "https://git.example.com/"
token = "XXXXXXXXXXXXXXXXX"
executor = "shell"
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
Used GitLab Runner version
Running with gitlab-runner 12.10.1 (ce065b93)
on XXXXX deploy 7721e8b1
Possible fixes
Edited by 🤖 GitLab Bot 🤖