ssh executor fails on openbsd targets
Summary
gitlab-runner fails to ssh and open a shell if the target OS is openbsd.
It works just fine with a very similar host running FreeBSD, or Archlinux, or Fedora.
Steps to reproduce
Here is my very simple runner:
[[runners]]
name = "openbsd"
url = "https://lab.louiz.org/ci"
token = "9d55421490bcf576..."
executor = "ssh"
[runners.ssh]
user = "tester"
password = "xxxx"
host = "192.168.122.71"
Of course, ssh’ing manually on this IP works just fine, with any command (bash, sh, ksh…) see:
22:16 louiz@fenouil ~% ssh tester@192.168.122.71 bash --login
tester@192.168.122.71's password:
uname -a
OpenBSD openbsd.my.domain 6.3 GENERIC#100 amd64
Actual behavior
It fails like this: https://lab.louiz.org/testing/biboumi/-/jobs/15854
Note that setting a value like
shell = "sh"
in config.toml doesn’t change a lot the result:
https://lab.louiz.org/testing/biboumi/-/jobs/15883
Relevant logs and/or screenshots
docker gitlab-runner logs shows this:
Checking for jobs... received job=15880 repo_url=https://lab.louiz.org/testing/biboumi.git runner=9d554214
Requeued the runner builds=1 runner=9d554214
Running with gitlab-runner 11.0.0 (5396d320) job=15880 project=50 runner=9d554214
on openbsd 9d554214 job=15880 project=50 runner=9d554214
Shell configuration: environment: []
dockercommand:
- sh
- -c
- "if [ -x /usr/local/bin/bash ]; then\n\texec /usr/local/bin/bash --login\nelif [
-x /usr/bin/bash ]; then\n\texec /usr/bin/bash --login\nelif [ -x /bin/bash ]; then\n\texec
/bin/bash --login\nelif [ -x /usr/local/bin/sh ]; then\n\texec /usr/local/bin/sh
--login\nelif [ -x /usr/bin/sh ]; then\n\texec /usr/bin/sh --login\nelif [ -x /bin/sh
]; then\n\texec /bin/sh --login\nelse\n\techo shell not found\n\texit 1\nfi\n\n"
command: bash
arguments:
- --login
passfile: false
extension: ""
job=15880 project=50 runner=9d554214
Using SSH executor... job=15880 project=50 runner=9d554214
Starting SSH command... job=15880 project=50 runner=9d554214
Connecting to SSH server... job=15880 project=50 runner=9d554214
Checking for jobs... nothing runner=9d554214
Feeding runners to channel builds=1
Checking for jobs... nothing runner=cd3b0138
Waiting for signals... job=15880 project=50 runner=9d554214
Checking for jobs... nothing runner=13c35f97
WARNING: Job failed: Process exited with: 127. Reason was: () job=15880 project=50 runner=9d554214
Environment description
% docker info
Containers: 52
Running: 3
Paused: 0
Stopped: 49
Images: 83
Server Version: 1.13.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: journald
Cgroup Driver: systemd
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Authorization: rhel-push-plugin
Swarm: inactive
Runtimes: oci runc
Default Runtime: oci
Init Binary: /usr/libexec/docker/docker-init-current
containerd version: fbadd789ddf86a4be9d6905528b7486c61e52612 (expected: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1)
runc version: 30c1ca9e67c12cb94addb10595e4f73f9daed614-dirty (expected: 9df8b306d01f59d3a8029be411de015b7304dd8f)
init version: N/A (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
seccomp
WARNING: You're not using the default seccomp profile
Profile: /etc/docker/seccomp.json
selinux
Kernel Version: 4.14.3-300.fc27.x86_64
Operating System: Fedora 27 (Twenty Seven)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 3
CPUs: 12
Total Memory: 31.32 GiB
Name: fenouil
ID: 2PTQ:6MB4:WEIU:DCNR:JHZV:TKDP:NEXO:EU76:LSIR:HEIW:YTGG:UMJB
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: louiz
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: true
Registries: docker.io (secure), registry.fedoraproject.org (secure), registry.access.redhat.com (secure), docker.io (secure)
Used GitLab Runner version
% docker exec -it gitlab-runner gitlab-runner -v
Version: 11.0.0
Git revision: 5396d320
Git branch: 11-0-stable
GO version: go1.8.7
Built: 2018-06-22T11:01:11+00:00
OS/Arch: linux/amd64