Skip to content

Gitlab runner shell executor doesn't work on Ubuntu focal

Summary

Shell executor jobs fail to run any commands on ubuntu focal.

Steps to reproduce

  1. Create a server running ubuntu 20.04
  2. Download the deb https://gitlab-runner-downloads.s3.amazonaws.com/latest/deb/gitlab-runner_amd64.deb
  3. dpkg -i gitlab-runner_amd64.deb
  4. Register the runner using shell executor
  5. Run a pipeline
.gitlab-ci.yml
---
job:
    script:
        - echo "Hello world"

Actual behavior

Job fails without executing any commands

Expected behavior

Job should output 'Hello world'

Relevant logs and/or screenshots

job log
 Running with gitlab-runner 13.0.1 (21cb397c)
  on ip-172-31-56-16 rLWqVpe-
Preparing the "shell" executor
00:00
Using Shell executor...
Preparing environment
00:00
Running on ip-172-31-56-16...
Uploading artifacts for failed job
00:00
bash: line 90: cd: /home/gitlab-runner/builds/rLWqVpe-/0/rwky/gitlab-runner-focal-test: No such file or directory
ERROR: Job failed: exit status 1

Environment description

I've set up a public sample project here https://gitlab.com/rwky/gitlab-runner-focal-test/

config.toml contents
concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "ip-172-31-56-16"
  url = "https://gitlab.com/"
  token = "<token>"
  executor = "shell"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]

Used GitLab Runner version

Version:      13.0.1
Git revision: 21cb397c
Git branch:   13-0-stable
GO version:   go1.13.8
Built:        2020-06-01T08:24:47+0000
OS/Arch:      linux/amd64