actions-runner-controller: runner-scale-set-listener crashed, failed to start due to backend error

Checks

Controller Version

0.8.1

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

Im not sure how to reprocude this as i think this is an issue with GitHub backend

Describe the bug

Our listener pod had some issues communicating with GitHub backend due to unknown errors, the first error we saw:

2024-01-08T18:29:29Z ERROR listener-app Retryable client error {"error": "Get \"https://pipelinesghubeus23.actions.githubusercontent.com/MASKED/_apis/runtime/runnerscalesets/6/messages?sessionId=MASKED&api-version=6.0-preview\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)", "method": "GET", "url": "https://pipelinesghubeus23.actions.githubusercontent.com/MASKED/_apis/runtime/runnerscalesets/6/messages?sessionId=MASKED&api-version=6.0-preview", "error": "request failed"}

Then we got this error:


2024-01-08T18:30:06Z ERROR listener-app Retryable client error {"error": "Delete \"https://pipelinesghubeus23.actions.githubusercontent.com/MASKED/_apis/runtime/runnerscalesets/5/messages/15323?sessionId=MASKED&api-version=6.0-preview\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)", "method": "DELETE", "url": "https://pipelinesghubeus23.actions.githubusercontent.com/MASKED/_apis/runtime/runnerscalesets/5/messages/15323?sessionId=MASKED&api-version=6.0-preview", "error": "request failed"}

After these errors, our listener pod entered to some restart loop with the same error:

2024/01/08 18:30:44 Application returned an error: createSession failed: failed to create session: 409 - had issue communicating with Actions backend: The runner scale set arc-terraform-live-small-runners already has an active session for owner arc-terraform-live-small-runners-754b578d-listener.

We have only one listener pod for that runnerset, so im not sure why we got this response, the system was stuck like this for more than an hour, somehow if was fixed after some time, maybe because i tried to stop the container and the backend was able to “handle” the issue on his side.

Describe the expected behavior

The listener pod should restart automatically and connect to Github backend with no issues.

Additional Context

None

Controller Logs

None

Runner Pod Logs

None

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 5
  • Comments: 16 (6 by maintainers)

Most upvoted comments

Same error here with 0.10.1, the only manual workaround for me now is:

  • Delete the corresponding autoscalingrunnersets.actions.github.com object that deletes the listener
  • Wait 30-45s
  • Recreate autoscalingrunnersets.actions.github.com
  • Verify

I’ve tried to add a sleep initContainer via:

listenerTemplate:
  spec:
    containers:
      - name: listener
    initContainers:
      - name: init-sleep
        image: busybox
        command: ["sh", "-c", "sleep 45"]

That does kind of work in theory, but the controller recreates the listener pod before the 45s are reached because of Listener pod is not ready. I didn’t find a variable to increase the wait-time in the controller.

A automatic fix for this would be nice.

Hey @AlonAvrahami,

Thank you for reporting this issue. For the context deadline exceeded, we added HTTP client timeout of 5 minutes in this release. Could you please check if you have any network issues with the cluster that may be causing this problem?

The error having 409 status code when the listener restarts, is related to this issue. For more context, after the request fails, the listener crashes and starts up again. But since we forgot to delete the session, the listener cannot start talking to the actions service until the old session expires. Sorry for that, we have a PR that should fix the second problem.