0
votes

I've set up the gitlab runner on a windows host, and have it pointing to a lubuntu vm. The vm also has a gitlab runner installed inside it, however the windows host virtualbox executor still cant upload any artifacts.

It keeps saying that the there is no runner installed on the cloned machine - is there something inside the runner that makes it wipe out the cloned VM's gitlab-runner or is it just a bad cloning proccess?

Things I've tried:

I do have a gitlab-runner installed on the VM that is being cloned.

I also made the gitlab ci file try to search for the gitlab-runner with which gitlab-runner and it didn't find it.

As a last resort i made the gitlab ci file install and run a gitlab-runner when it clones the vm (insisde the gitlab ci file in the before_script: section) - this option actually worked and the artifacts were uploaded. This however, I don't feel is a valid solution to the problem and is pretty gross, because it adds a new runner to the gitlab-server each run.

  • echo passwordgoeshere | sudo -S curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64

  • echo passwordgoeshere | sudo -S chmod +x /usr/local/bin/gitlab-runner

  • echo passwordgoeshere | sudo -s gitlab-runner install --user=usernamegoeshere --working-directory=/home/usernamegoeshere

  • echo passwordgoeshere | sudo -S gitlab-runner register --non-interactive --url "gitlab-server-url" --registration-token "token" --executor "shell" --description "vm_runner" --tag-list "vm" --run-untagged="true" --locked="false" --access-level="not_protected"

    • echo passwordgoeshere | sudo -S gitlab-runner start

update:

I have sinced changed the vm to a freshly created one and am now getting this error:

Uploading artifacts...
panic: reflect: call of reflect.Value.Type on zero Value [recovered]
    panic: reflect: call of reflect.Value.Type on zero Value

goroutine 1 [running]:
main.main.func1()
    /go/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/main.go:32 +0x7f
panic(0x14fcc60, 0xc4204aa200)
    /usr/local/go/src/runtime/panic.go:489 +0x2cf
reflect.Value.Type(0x0, 0x0, 0x0, 0x410a9f, 0xc42016d250)
    /usr/local/go/src/reflect/value.go:1688 +0x21f
gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/gitlab.com/ayufan/golang-cli-helpers.convertMarshal(0x0, 0x0, 0x0, 0xc42016d2b0, 0x4d5dc1, 0xc420091540, 0xc42016d2c0, 0x41db87)
    /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, 0xc42037af80, 0x444fb8, 0x2a, 0x2dc62e6d1d9)
    /go/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/gitlab.com/ayufan/golang-cli-helpers/convert.go:58 +0x5a
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(0xc42037af80, 0x15f73a0, 0xc42037af80)
    <autogenerated>:5 +0x70
flag.isZeroValue(0xc4203a33c0, 0x0, 0x0, 0x14922e7)
    /usr/local/go/src/flag/flag.go:395 +0x102
flag.(*FlagSet).PrintDefaults.func1(0xc4203a33c0)
    /usr/local/go/src/flag/flag.go:469 +0x1b9
flag.(*FlagSet).VisitAll(0xc4204a8060, 0xc42016d610)
    /usr/local/go/src/flag/flag.go:325 +0x67
flag.(*FlagSet).PrintDefaults(0xc4204a8060)
    /usr/local/go/src/flag/flag.go:478 +0x4f
flag.(*FlagSet).defaultUsage(0xc4204a8060)
    /usr/local/go/src/flag/flag.go:511 +0x8e
flag.(*FlagSet).(flag.defaultUsage)-fm()
    /usr/local/go/src/flag/flag.go:973 +0x2a
flag.(*FlagSet).usage(0xc4204a8060)
    /usr/local/go/src/flag/flag.go:826 +0x2f
flag.(*FlagSet).failf(0xc4204a8060, 0x1719425, 0x22, 0xc42016d898, 0x1, 0x1, 0x0, 0x16f8e6d)
    /usr/local/go/src/flag/flag.go:816 +0xea
flag.(*FlagSet).parseOne(0xc4204a8060, 0xc42000e101, 0x0, 0x0)
    /usr/local/go/src/flag/flag.go:871 +0x2ee
flag.(*FlagSet).Parse(0xc4204a8060, 0xc42000e120, 0xe, 0xe, 0x31de860, 0x0)
    /usr/local/go/src/flag/flag.go:913 +0x60
gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/github.com/codegangsta/cli.Command.Run(0x17057a4, 0x12, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1724306, 0x2c, 0x0, ...)
    /go/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/github.com/codegangsta/cli/command.go:98 +0xb59
gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/github.com/codegangsta/cli.(*App).Run(0xc420363b00, 0xc42000e100, 0x10, 0x10, 0x0, 0x0)
    /go/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/vendor/github.com/codegangsta/cli/app.go:159 +0x56f
main.main()
    /go/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner/main.go:58 +0x2af
1

1 Answers

1
votes

So i figured it out.

The problem was relating to how i installed the gitlab-runner insisde the vm manually. What i did instead was, create a brand new vm;

  1. intalled git, openssh-server, openssh-lient
  2. ran ssh-keygen ( i'm not sure if i needed this step or not.)
  3. then closed the vm down.

used the virtualbox executor and pointed it at the new vm and it worked perfectly.

for any who finds this, and has searched all of google but found 0 help here is how i set up the runners.

  1. download and install the gitlab runner ( for me i used windows, and there is some security stuff you need to fix if you want to run the runner as a service.) their website has some pretty good info on installing.
  2. work your way through the install stuff, NOTING the username and password you have to use is the same creditintials that you would use to ssh into the VM you want the runner to run on.
    • the other thing to note is that you need to tell the runner the name of the VM, this is found in Virtualbox and is just it's name.
  3. then you can start the runner with 'gitlab-runner --debug start', just to ensure it's working right.

then regfer to the top section of this answer for how to make sure the vm will need to be configured.

hope this helps.