aws-samples / amazon-ec2-gitlab-runner

This repository contains code to deploy and manage Gitlab Runners on Amazon EC2.
MIT No Attribution
58 stars 36 forks source link

Error occurred during build: Command 09ConfigureDockerExecutor failed #17

Open dreamiter opened 4 months ago

dreamiter commented 4 months ago

Error when running ./deploy-runner.sh <properties-file> <region> <aws-profile> <stack-name>

Error message from EC2: cloud-init[2273]: Error occurred during build: Command 09ConfigureDockerExecutor failed

Relevant code:

            09ConfigureDockerExecutor:
              command: !Sub
                - |
                  for GitlabGroupToken in `aws ssm get-parameters --names /${AWS::StackName}/ci-tokens --query 'Parameters[0].Value' | sed -e "s/\"//g" | sed "s/,/ /g"`;do
                      sudo gitlab-runner register \
                      --non-interactive \
                      --url "${GitlabServerURL}" \
                      --token $GitlabGroupToken \
                      --executor "docker" \
                      --docker-image "${DockerImagePath}" \
                      --description "Gitlab Runner with Docker Executor" \
                      --docker-volumes "/var/run/docker.sock:/var/run/docker.sock"
                  done
                - isLOCKED: !FindInMap [GitlabRunnerRegisterOptionsMap, !Ref RunnerEnvironment, isLOCKED]
                  ACCESS: !FindInMap [GitlabRunnerRegisterOptionsMap, !Ref RunnerEnvironment, ACCESS]

Possible root cause? The ability to pass a runner registration token, and support for certain configuration arguments was deprecated in GitLab 15.6 and will be removed in GitLab 18.0. Runner authentication tokens should be used instead. For more information, see Migrating to the new runner registration workflow.