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!

@balonik I have the same issue but i’am not getting failure but instead it’s an internal error 500, if you have any suggestion for that would be really greatfull.

@Tarek23

try to look into GitLab logs if you can find some hints whats causing you issue.

Well i did but always when i try to simulate a pipeline i get this error 500, looked into logs and i got this:

"POST /project_name/-/ci/lint HTTP/2.0" 500 2950 "https://gitlab.domain.com/project_name/-/ci/lint" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36