Gitlab CI Autoscale Builds fail with no log

Hello.

I’m testing Gitlab Runner’s autoscale feature (on a Gitlab Omnibus instance) with the amazonec2 driver. The builds fail with no log (in the build page).

In /var/log/messages I get “gitlab-runner[21238]: Machine creation failed, trying to provision exit status 1” and after this a lot of “gitlab-runner[21238]: Retrying removal”, which keep appearing every 10 seconds or so.

Is there a way to know what make my builds fail ?

Here is my config.toml:

concurrent = 1 

[[runners]]
  name = "runner_01"
  url = "http://gitlab.acme.com/ci/"
  token = "9d656571f2b9ff60a90c9b19f360fc"
  executor = "shell"
  [runners.ssh]
  [runners.docker]
    tls_verify = false
    image = ""
    privileged = false
    disable_cache = false
  [runners.parallels]
    base_name = ""
    disable_snapshots = false

[[runners]]
  name = "my-autoscale-runner"
  url = "http://gitlab.acme.com/ci"
  token = "29f7881f9221594d5d3683502168ef"
  executor = "docker+machine"
  [runners.ssh]
  [runners.docker]
    tls_verify = false
    image = ""
    privileged = false
    disable_cache = false
  [runners.machine]
    IdleCount = 0 
    IdleTime = 600 
    MachineName = "auto-scale-runners-%s.my.domain.com"
    MachineDriver = "amazonec2"
    MachineOptions = [ 
      "amazonec2-access-key=AKI...",
      "amazonec2-secret-key=TW...",
      "amazonec2-region=eu-central-1"
    ]   
  [runners.parallels]
    base_name = ""
    disable_snapshots = false
  [runners.virtualbox]
    base_name = ""
    disable_snapshots = false
  [runners.cache]
    Insecure = false

OK, this is solved. I tried to create the ec2 instance directly from Docker Machine:

docker-machine create --driver amazonec2 --amazonec2-access-key AKI*** --amazonec2-secret-key TW*** instanceName

This allowed me to see that the problem was nothing more than my aws user not having enough permissions.

As for the “Retrying removal” flooding the logs, this a a registered bug. The only solution is to restart the Gitlab Runner.

(Thanks to Kamil for his help on the #gitlab irc channel)