Self-Hosted Gitlab Runner not picking up jobs

Self-Hosted Gitlab Runner not picking up jobs

I am hosting my runner in AWS. I followed this tutorial for setup. I am at the point where the runner is able to be seen as a Group Runner and is unlocked for use with my specific project. I am suspecting maybe there is an issue with AWS configurations, but I’m not sure.

Here is my gitlab-ci.yml file:

image: python:3.8

stages:
  - tests

run_tests:
  stage: tests
  tags:
    - "my-group-name"
  script:
    - echo "run tests 2"

And here is my config.toml file:

 concurrent = 15
 check_interval = 0
 
 [session_server]
   session_timeout = 1800
 
 [[runners]]
   name = "My Group Gitlab group runner"
   url = "https://gitlab.com/"
   token = "xxxxx"
   executor = "docker+machine"
   limit = 20
  [runners.cache]
     Type = "s3"
     Shared = true
     [runners.cache.s3]
       ServerAddress = "s3.amazonaws.com"
       AccessKey = "xxxxx"
       SecretKey = "xxxxx"
       BucketName = "gitlab-runner-my-group-cache"
       BucketLocation = "us-west-2"
   [runners.docker]
     tls_verify = false
     image = "python:3.9-buster"
     privileged = true
     disable_entrypoint_overwrite = false
     oom_kill_disable = false
     disable_cache = true
     shm_size = 0
   [runners.machine]
     IdleCount = 1
     IdleTime = 1800
     MaxBuilds = 10
     MachineDriver = "amazonec2"
     MachineName = "gitlab-docker-machine-%s"
     MachineOptions = ["amazonec2-access-key=xxxxx", "amazonec2-secret-key=xxxxx", "amazonec2-region=us-west-2", "amazonec2-vpc-id=vpc-xxxxx", "amazonec2-subnet-id=subnet-xxxxx", "amazonec2-zone=us-west-2a", "amazonec2-use-private-address=true", "amazonec2-tags=runner-manager-name,gitlab-aws-autoscaler,gitlab,    true,gitlab-runner-autoscale,true", "amazonec2-security-group=sg-xxxxx", "amazonec2-instance-type=m4.large"]
 
     [[runners.machine.autoscaling]]
       Periods = ["* * 9-17 * * mon-fri *"]
       Timezone = "UTC"
       IdleCount = 50
       IdleTime = 3600
 
     [[runners.machine.autoscaling]]
       Periods = ["* * * * * sat,sun *"]
       Timezone = "UTC"
       IdleCount = 5
       IdleTime = 60

Hi @eric255
whats the Job status in GitLab UI?

@balonik It queues for a long time, then there is a runner failure:

Job summary:

Job status:

GitLab Runner on Amazon Linux logs to /var/log/messages. Look into the log file for gitlab-runner errors. If it’s on Debian/Ubuntu look into /var/log/syslog

1 Like

@balonik Thanks for the tip. I’m getting some errors during docker-machine creation it looks like.

Error creating machine: Error in driver during machine creation: InvalidParameterValue: Value (sg-xxxxx) for parameter GroupName is invalid. Group names may not be in the format sg-*.#033[0;m  #033[31;1mdriver#033[0;m=amazonec2 #033[31;1mname#033[0;m=runner-xxxxx-gitlab-docker-machine-xxxxx #033[31;1moperation#033[0;m=create

My config.toml file is in the original post. I don’t see why it is trying to name the machine with the name of the AWS security group

security group must be specified without the sg- prefix, just what comes after. Change it in your config.toml and restart the runner.

"amazonec2-security-group=sg-xxxxx""amazonec2-security-group=xxxxx"

@balonik Looks like this issue is resolved. Thank you!