actions-runner-controller: Occasionally jobs are stuck in "waiting for a runnner to come online"

Checks

Controller Version

0.9.3

Deployment Method

Helm

Checks

  • This isn’t a question or user support case (For Q&A and community support, go to Discussions).
  • I’ve read the Changelog before submitting this issue and I’m sure it’s not due to any recently-introduced backward-incompatible changes

To Reproduce

No clear reproduction steps for the bug, as it is occasional. 
Team have noticed it occurs most often in the morning.

Describe the bug

In the example, on the CI piepline: image

  • At 06:49 A job was suppose to be schedule on gm2.dind.large-b4j7w runner after the job “get-ecr-login-password”
  • During 40 minutes the job “unit-tests” is stuck in waiting for runner
  • At 07:40:43 in the controller we get the log “Created new ephemeral runner”, which is named gm2.dind.large-b4j7w-runner-bsk5p. The runner will be use to run the job “unit-tests”

We have multiple cases of jobs waiting a long time for a runner, without any clear explanation.

Describe the expected behavior

  • Jobs is trigger
  • ARC controler create the runner
  • Runner is taking the job and start running it

Additional Context

There has been attempt to play around the ‘minWorkers’ configuration. of the runner-set to prevent the waiting issue.

Runner-set are deployed with helm using the values.yaml file:

githubConfigUrl: ${github_config_url}

githubConfigSecret:
  github_app_id: "${github_app_id}"
  github_app_installation_id: "${github_app_installation_id}"
  github_app_private_key: |
    ${github_app_private_key}

containerMode:
  type: "kubernetes"
  kubernetesModeWorkVolumeClaim:
    accessModes: ["ReadWriteOnce"]
    storageClassName: "github-arc"
    resources:
      requests:
        storage: 10Gi

minWorkers: 2

listenerTemplate:
  metadata:
    annotations:
      prometheus.io/scrape: "true"
      prometheus.io/path: "/metrics"
      prometheus.io/port: "8080"
  spec:
    containers:
    - name: listener
      securityContext:
        runAsUser: 1000
      resources:
        limits:
          memory: 64Mi
        requests:
          cpu: 100m
          memory: 64Mi
    nodeSelector:
      "karpenter.sh/nodepool": runner
    tolerations:
      - key: "karpenter.sh/nodepool"
        value: "runner"
        operator: "Equal"
        effect: "NoSchedule"

template:
  metadata:
    annotations:
      prometheus.io/scrape: "true"
      prometheus.io/path: "/metrics"
      prometheus.io/port: "8080"
  spec:
    securityContext:
      fsGroup: 1001
    serviceAccount: "${sa_name}"
    containers:
    - name: runner
      image: REDACTED/github-arc-runner:0.7
      command: ["/home/runner/run.sh"]
      env:
        - name: ACTIONS_RUNNER_REQUIRE_JOB_CONTAINER
          value: "false"
      resources:
        limits:
          cpu: "${resources.cpu}"
          memory: "${resources.memory}"
        requests:
          cpu: "${resources.cpu}"
          memory: "${resources.memory}"
    nodeSelector:
      "karpenter.sh/nodepool": runner
    tolerations:
      - key: "karpenter.sh/nodepool"
        value: "runner"
        operator: "Equal"
        effect: "NoSchedule"

Controller Logs

Logs would be best read when filtered on "gm2.dind.large-b4j7w"

"https://gist.github.com/victor-smg/1c7ed78e9702dd2389e98725c9ac37f5.js"

Runner Pod Logs

No relevant logs for the runner, as it is the lack of runner that is the issue

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 19
  • Comments: 15 (2 by maintainers)

Most upvoted comments

is there a workaround for this? the issue effectively causes a very poor experience

we have experienced the same issue here: we have 2 runner-scale-set for redundancy, both have same name as runner-scale-set, each has different runner group. It used to work, but now workflow hanging with “waiting for runner come online”. however, both runner-scale-set are online with green light. We could not see any errors in the arc-system namespace, and it seems like there is no way to check out the cause. For torubleshooting, we have uninstall both helm release of arc and runner-scale-set, and reinstall via helm both of them, but problem persists.

Any tips will be much appreciated!

Just an update, we kept seeing the listeners being offline on our github instance with no apparent reason. Deleting the autoscalingrunnerset made the listener to be recreated and be able to register again. As soon as we do this, the jobs are picked up and new runners are created. We are checking also on our github instance side what might be wrong, since we do not see no errors on the listeners/controller side and for the moment we’ve implemented a cronjob that deletes the autoscalingrunnerset every hour, checking first if there are any active runners for that label. If so the autoscalingrunnerset is not deleted, if no runners are present we delete the autoscalingrunnerset so it can register again.