Crash during register with docker executor
Summary
I wanted to setup a gitlab-runner within my docker environment. As i wanted to register a new runner within the container i got the following stacktrace:
docker-exec -it docker_gitlab-runner_1 gitlab-ci-multi-runner register --url "http://gitlab.<domain>.de/ci" --registration-token "<token>" --description "docker-ruby-2.1" --executor "docker" --docker-image ruby:2.1 --docker-postgres latest --docker-mysql latest
panic: reflect: call of reflect.Value.Type on zero Value [recovered]
panic: reflect: call of reflect.Value.Type on zero Value
goroutine 1 [running]:
panic(0x144c320, 0xc4203b77c0)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
main.main.func1()
/go/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/main.go:32 +0x7f
panic(0x144c320, 0xc4203b77c0)
/usr/local/go/src/runtime/panic.go:458 +0x243
reflect.Value.Type(0x0, 0x0, 0x0, 0xc42035c640, 0x14ede02)
/usr/local/go/src/reflect/value.go:1670 +0x224
gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/gitlab.com/ayufan/golang-cli-helpers.convertMarshal(0x0, 0x0, 0x0, 0xa, 0xc4204e92a0, 0xc4200e72a0, 0xc4204e92e0, 0x51da4d)
/go/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/gitlab.com/ayufan/golang-cli-helpers/convert.go:47 +0x43
gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/gitlab.com/ayufan/golang-cli-helpers.convertToString(0x0, 0x0, 0x0, 0x0, 0x0, 0x153e7e0, 0xc4200a2100, 0x445131, 0x62e6d1d9000002dc)
/go/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/gitlab.com/ayufan/golang-cli-helpers/convert.go:58 +0x5d
gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/gitlab.com/ayufan/golang-cli-helpers.StructFieldValue.String(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/gitlab.com/ayufan/golang-cli-helpers/struct_field.go:32 +0x7b
gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/gitlab.com/ayufan/golang-cli-helpers.(*StructFieldValue).String(0xc4200a2100, 0x153e7e0, 0xc4200a2100)
<autogenerated>:5 +0x7a
flag.isZeroValue(0xc42004b480, 0x0, 0x0, 0x14ede33)
/usr/local/go/src/flag/flag.go:393 +0x12d
flag.(*FlagSet).PrintDefaults.func1(0xc42004b480)
/usr/local/go/src/flag/flag.go:467 +0x1d5
flag.(*FlagSet).VisitAll(0xc42006b320, 0xc4204e9588)
/usr/local/go/src/flag/flag.go:323 +0x67
flag.(*FlagSet).PrintDefaults(0xc42006b320)
/usr/local/go/src/flag/flag.go:476 +0x4f
flag.defaultUsage(0xc42006b320)
/usr/local/go/src/flag/flag.go:509 +0x96
flag.(*FlagSet).usage(0xc42006b320)
/usr/local/go/src/flag/flag.go:825 +0x55
flag.(*FlagSet).failf(0xc42006b320, 0x164ef6d, 0x22, 0xc4204e9790, 0x1, 0x1, 0xc4204e9738, 0x47c52e)
/usr/local/go/src/flag/flag.go:814 +0x116
flag.(*FlagSet).parseOne(0xc42006b320, 0x1, 0x0, 0x0)
/usr/local/go/src/flag/flag.go:873 +0xad8
flag.(*FlagSet).Parse(0xc42006b320, 0xc42000a120, 0xe, 0xe, 0x2fc4ef8, 0x0)
/usr/local/go/src/flag/flag.go:915 +0x60
gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/github.com/codegangsta/cli.Command.Run(0x162f1cf, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x16411b8, 0x15, 0x0, ...)
/go/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/github.com/codegangsta/cli/command.go:98 +0xc33
gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/github.com/codegangsta/cli.(*App).Run(0xc42000a400, 0xc42000a100, 0x10, 0x10, 0x0, 0x0)
/go/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/github.com/codegangsta/cli/app.go:159 +0x705
main.main()
/go/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/main.go:58 +0x24f
I am using the following version:
gitlab-runner --version
Version: 9.0.2
Git revision: fa8b86d
Git branch: 9-0-stable
GO version: go1.7.5
Built: Thu, 06 Apr 2017 17:05:19 +0000
OS/Arch: linux/amd64
Here is my docker-compose.yml:
version: '2'
services:
nginx-proxy:
restart: always
image: jwilder/nginx-proxy
volumes:
- /root/docker/certs:/etc/nginx/certs:ro
- /etc/nginx/vhost.d
- /usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
ports:
- "80:80"
- "443:443"
nginx-companion:
restart: always
image: alastaircoote/docker-letsencrypt-nginx-proxy-companion
volumes:
- /root/docker/certs:/etc/nginx/certs:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
volumes_from:
- nginx-proxy
depends_on:
- nginx-proxy
gitlab:
restart: always
image: gitlab/gitlab-ce
hostname: gitlab.nodedev.de
volumes:
- /root/docker/gitlab/config:/etc/gitlab
- /root/docker/gitlab/data:/var/opt/gitlab
- /root/docker/gitlab/logs:/var/log/gitlab
- /root/docker/certs:/etc/gitlab/ssl:ro
environment:
- "VIRTUAL_HOST=gitlab.<domain>.de"
- "LETSENCRYPT_HOST=gitlab.<domain>.de"
- "LETSENCRYPT_EMAIL=<mail>"
ports:
- "2222:22"
depends_on:
- nginx-proxy
- nginx-companion
gitlab-runner:
restart: always
image: gitlab/gitlab-runner:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /root/docker/gitlab-runner:/etc/gitlab-runner
depends_on:
- gitlab