Skip to content

runner-scale-set-listener crashed, failed to start due to backend error #3210

Closed

Description

@AlonAvrahami

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

Activity

  1. added
    bug
    gha-runner-scale-set
    needs triage
    on Jan 9, 2024
  2. github-actions commented on Jan 9, 2024

    @github-actions
    Contributor

    Hello! Thank you for filing an issue.

    The maintainers will triage your issue shortly.

    In the meantime, please take a look at the troubleshooting guide for bug reports.

    If this is a feature request, please review our contribution guidelines.

  3. ahatzz11 commented on Jan 11, 2024

    @ahatzz11
    Contributor

    I've run into this issue as well when I do a new deployment of our gha-runner-scale-set. I've never had it stuck for an hour, it usually seems to go on for a couple of minutes and eventually the new listener starts up and connect to GitHub.

  4. nikola-jokic commented on Jan 22, 2024

    @nikola-jokic
    Collaborator

    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.

  5. added
    question
    and removed
    bug
    needs triage
    on Jan 22, 2024
  6. AlonAvrahami commented on Jan 23, 2024

    @AlonAvrahami
    Author

    Thanks @nikola-jokic!
    I don't remember seeing any network issues. I will wait for the fix and will test it in the future. It didn't happen again since I've opened this issue, so it's a rare bug.
    I guess we can close this issue and link it to #3209 which I haven't noticed and were opened a few hours before I've opened mine 😆

  7. nikola-jokic commented on Jan 29, 2024

    @nikola-jokic
    Collaborator

    Hey @AlonAvrahami,

    Thank you for the response. Let's close this issue but feel free to comment on it and if the issue is still valid in 0.8.2, we can always re-open it ☺️

  8. vladimirlinden-inv commented on Dec 5, 2024

    @vladimirlinden-inv

    I am having this exact issue in 0.9.3
    both controller and runner scale set are going wild:
    2024/12/05 09:42:20 Application returned an error: failed to get message: failed to get next message: Get "https://pipelinesghubeus23.actions.githubusercontent.com/eQzeTp4X5S2e3lskyMZArmydzNGrJkc40AXa6chFkroL0rqFDI/_apis/runtime/runnerscalesets/1/messages?sessionId=a5795dab-23dd-4a8c-9f04-caed0174a711&api-version=6.0-preview": GET https://pipelinesghubeus23.actions.githubusercontent.com/eQzeTp4X5S2e3lskyMZArmydzNGrJkc40AXa6chFkroL0rqFDI/_apis/runtime/runnerscalesets/1/messages?sessionId=a5795dab-23dd-4a8c-9f04-caed0174a711&api-version=6.0-preview giving up after 1 attempt(s): context canceled

  9. CasperGN commented on Jan 24, 2025

    @CasperGN

    @nikola-jokic I'm experiencing this issue on v.0.10.1 of both gha-runner-scale-set-controller & gha-runner-scale-set:

    (⎈|mannaz-dev-qp4zp-cluster-admin:default)➜  ~ k describe po -n runtime-mannaz-dev-mannaz-dev | grep "app.kubernetes.io"     
    Labels:           app.kubernetes.io/component=controller-manager
                      app.kubernetes.io/instance=gh-run-mannaz
                      app.kubernetes.io/name=gha-rs-controller
                      app.kubernetes.io/namespace=runtime-mannaz-dev-mannaz-dev
                      app.kubernetes.io/part-of=gha-rs-controller
                      app.kubernetes.io/version=0.10.1
                               app.kubernetes.io/component=runner-scale-set-listener
                               app.kubernetes.io/instance=mannaz-runner
                               app.kubernetes.io/managed-by=Helm
                               app.kubernetes.io/name=mannaz-runner
                               app.kubernetes.io/part-of=gha-runner-scale-set
                               app.kubernetes.io/version=0.10.1

    Controller logs that just keeps circling:

    (⎈|mannaz-dev-qp4zp-cluster-admin:default)➜  ~ k logs gh-run-mannaz-gha-rs-controller-849c9ddd4b-d2wk6 -n runtime-mannaz-dev-mannaz-dev
    2025-01-24T20:53:38Z    INFO    AutoscalingListener     Cleaning up the listener pod    {"version": "0.10.1", "autoscalinglistener": {"name":"mannaz-runner-7c6cf64b-listener","namespace":"runtime-mannaz-dev-mannaz-dev"}}
    2025-01-24T20:53:38Z    INFO    AutoscalingListener     Waiting for resources to be deleted before removing finalizer   {"version": "0.10.1", "autoscalinglistener": {"name":"mannaz-runner-7c6cf64b-listener","namespace":"runtime-mannaz-dev-mannaz-dev"}}
    2025-01-24T20:53:38Z    INFO    AutoscalingListener     Deleting resources      {"version": "0.10.1", "autoscalinglistener": {"name":"mannaz-runner-7c6cf64b-listener","namespace":"runtime-mannaz-dev-mannaz-dev"}}
    2025-01-24T20:53:38Z    INFO    AutoscalingListener     Cleaning up the listener pod    {"version": "0.10.1", "autoscalinglistener": {"name":"mannaz-runner-7c6cf64b-listener","namespace":"runtime-mannaz-dev-mannaz-dev"}}
    2025-01-24T20:53:38Z    INFO    AutoscalingListener     Waiting for resources to be deleted before removing finalizer   {"version": "0.10.1", "autoscalinglistener": {"name":"mannaz-runner-7c6cf64b-listener","namespace":"runtime-mannaz-dev-mannaz-dev"}}
    ...

    And from the listener pod:

    (⎈|mannaz-dev-qp4zp-cluster-admin:default)➜  ~ k logs mannaz-runner-7c6cf64b-listener -n runtime-mannaz-dev-mannaz-dev
    2025-01-24T20:55:26Z    INFO    listener-app    app initialized
    2025-01-24T20:55:26Z    INFO    listener-app    Starting listener
    ... 
    2025-01-24T20:55:27Z    INFO    listener-app.listener   Current runner scale set statistics.    {"statistics": "{\"totalAvailableJobs\":0,\"totalAcquiredJobs\":0,\"totalAssignedJobs\":0,\"totalRunningJobs\":0,\"totalRegisteredRunners\":0,\"totalBusyRunners\":0,\"totalIdleRunners\":0}"}
    2025-01-24T20:55:27Z    INFO    listener-app.worker.kubernetesworker    Calculated target runner count  {"assigned job": 0, "decision": 0, "min": 0, "max": 2147483647, "currentRunnerCount": 0, "jobsCompleted": 0}
    2025-01-24T20:55:27Z    INFO    listener-app.worker.kubernetesworker    Compare {"original": "{\"metadata\":{\"creationTimestamp\":null},\"spec\":{\"replicas\":-1,\"patchID\":-1,\"ephemeralRunnerSpec\":{\"metadata\":{\"creationTimestamp\":null},\"spec\":{\"containers\":null}}},\"status\":{\"currentReplicas\":0,\"pendingEphemeralRunners\":0,\"runningEphemeralRunners\":0,\"failedEphemeralRunners\":0}}", "patch": "{\"metadata\":{\"creationTimestamp\":null},\"spec\":{\"patchID\":0,\"ephemeralRunnerSpec\":{\"metadata\":{\"creationTimestamp\":null},\"spec\":{\"containers\":null}}},\"status\":{\"currentReplicas\":0,\"pendingEphemeralRunners\":0,\"runningEphemeralRunners\":0,\"failedEphemeralRunners\":0}}"}
    2025-01-24T20:55:27Z    INFO    listener-app.worker.kubernetesworker    Preparing EphemeralRunnerSet update     {"json": "{\"spec\":{\"patchID\":0,\"replicas\":null}}"}
    2025-01-24T20:55:27Z    INFO    listener-app.worker.kubernetesworker    Ephemeral runner set scaled.    {"namespace": "runtime-mannaz-dev-mannaz-dev", "name": "mannaz-runner-9579z", "replicas": 0}
    2025-01-24T20:55:27Z    INFO    listener-app.listener   Getting next message    {"lastMessageID": 0}
    2025-01-24T20:55:28Z    ERROR   listener-app    Retryable client error  {"error": "Get \"https://pipelinesghubeus12.actions.githubusercontent.com/af0DXjHziB7sRMkXjywgJ7STIj9NvppPwrhEY4Ej3Mj7OAFeP5/_apis/runtime/runnerscalesets/3/messages?sessionId=0a24e17e-2e46-4e62-84a9-2706d91219b9&api-version=6.0-preview\": context canceled", "method": "GET", "url": "https://pipelinesghubeus12.actions.githubusercontent.com/af0DXjHziB7sRMkXjywgJ7STIj9NvppPwrhEY4Ej3Mj7OAFeP5/_apis/runtime/runnerscalesets/3/messages?sessionId=0a24e17e-2e46-4e62-84a9-2706d91219b9&api-version=6.0-preview", "error": "request failed"}
    github.com/actions/actions-runner-controller/github/actions.(*clientLogger).Error
            github.com/actions/actions-runner-controller/github/actions/client.go:77
    github.com/hashicorp/go-retryablehttp.(*Client).Do
            github.com/hashicorp/[email protected]/client.go:718
    github.com/hashicorp/go-retryablehttp.(*RoundTripper).RoundTrip
            github.com/hashicorp/[email protected]/roundtripper.go:47
    net/http.send
            net/http/client.go:259
    net/http.(*Client).send
            net/http/client.go:180
    net/http.(*Client).do
            net/http/client.go:724
    net/http.(*Client).Do
            net/http/client.go:590
    github.com/actions/actions-runner-controller/github/actions.(*Client).Do
            github.com/actions/actions-runner-controller/github/actions/client.go:274
    github.com/actions/actions-runner-controller/github/actions.(*Client).GetMessage
            github.com/actions/actions-runner-controller/github/actions/client.go:578
    github.com/actions/actions-runner-controller/cmd/ghalistener/listener.(*Listener).getMessage
            github.com/actions/actions-runner-controller/cmd/ghalistener/listener/listener.go:272
    github.com/actions/actions-runner-controller/cmd/ghalistener/listener.(*Listener).Listen
            github.com/actions/actions-runner-controller/cmd/ghalistener/listener/listener.go:163
    github.com/actions/actions-runner-controller/cmd/ghalistener/app.(*App).Run.func1
            github.com/actions/actions-runner-controller/cmd/ghalistener/app/app.go:124
    golang.org/x/sync/errgroup.(*Group).Go.func1
            golang.org/x/[email protected]/errgroup/errgroup.go:78
    2025-01-24T20:55:28Z    INFO    listener-app.listener   Deleting message session
    2025/01/24 20:55:28 Application returned an error: failed to get message: failed to get next message: Get "https://pipelinesghubeus12.actions.githubusercontent.com/af0DXjHziB7sRMkXjywgJ7STIj9NvppPwrhEY4Ej3Mj7OAFeP5/_apis/runtime/runnerscalesets/3/messages?sessionId=0a24e17e-2e46-4e62-84a9-2706d91219b9&api-version=6.0-preview": GET https://pipelinesghubeus12.actions.githubusercontent.com/af0DXjHziB7sRMkXjywgJ7STIj9NvppPwrhEY4Ej3Mj7OAFeP5/_apis/runtime/runnerscalesets/3/messages?sessionId=0a24e17e-2e46-4e62-84a9-2706d91219b9&api-version=6.0-preview giving up after 1 attempt(s): context canceled

    The listener pod keeps starting, then terminating with the same above error.

  10. stefanandres commented on Feb 10, 2025

    @stefanandres
    Contributor

    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.

  11. kimxogus commented on May 9, 2025

    @kimxogus
    Contributor

    I had the same error with 0.11.0 too :(

  12. nikola-jokic commented on May 9, 2025

    @nikola-jokic
    Collaborator

    Hey, is this happening during the upgrade? The workaround from @stefanandres looks like the proper upgrade procedure.

  13. kimxogus commented on May 9, 2025

    @kimxogus
    Contributor

    No, those errors just occurred randomly in multiple runnersets

  14. nikola-jokic commented on May 9, 2025

    @nikola-jokic
    Collaborator

    Can you please post the listener log?

  15. kimxogus commented on May 9, 2025

    @kimxogus
    Contributor

    @nikola-jokic This is a sample of listeners' logs.
    Runner scale sets were running ok, and suddenly I had so many logs like this, and autoscaling listeners terminated with exit 1, and never recreated by controller. I had to recreate autoscalingscalesets.

    {"severity":"error","ts":"2025-05-09T08:17:32Z","logger":"listener-app","message":"Retryable client error","error":"Get \"https://broker.actions.githubusercontent.com/scalesets/message\": context canceled","method":"GET","url":"https://broker.actions.githubusercontent.com/scalesets/message","error":"request failed","stacktrace":"github.com/actions/actions-runner-controller/github/actions.(*clientLogger).Error\n\tgithub.com/actions/actions-runner-controller/github/actions/client.go:77\ngithub.com/hashicorp/go-retryablehttp.(*Client).Do\n\tgithub.com/hashicorp/[email protected]/client.go:718\ngithub.com/hashicorp/go-retryablehttp.(*RoundTripper).RoundTrip\n\tgithub.com/hashicorp/[email protected]/roundtripper.go:47\nnet/http.send\n\tnet/http/client.go:259\nnet/http.(*Client).send\n\tnet/http/client.go:180\nnet/http.(*Client).do\n\tnet/http/client.go:728\nnet/http.(*Client).Do\n\tnet/http/client.go:587\ngithub.com/actions/actions-runner-controller/github/actions.(*Client).Do\n\tgithub.com/actions/actions-runner-controller/github/actions/client.go:274\ngithub.com/actions/actions-runner-controller/github/actions.(*Client).GetMessage\n\tgithub.com/actions/actions-runner-controller/github/actions/client.go:578\ngithub.com/actions/actions-runner-controller/cmd/ghalistener/listener.(*Listener).getMessage\n\tgithub.com/actions/actions-runner-controller/cmd/ghalistener/listener/listener.go:272\ngithub.com/actions/actions-runner-controller/cmd/ghalistener/listener.(*Listener).Listen\n\tgithub.com/actions/actions-runner-controller/cmd/ghalistener/listener/listener.go:163\ngithub.com/actions/actions-runner-controller/cmd/ghalistener/app.(*App).Run.func1\n\tgithub.com/actions/actions-runner-controller/cmd/ghalistener/app/app.go:126\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\tgolang.org/x/[email protected]/errgroup/errgroup.go:78"}
    2025/05/09 08:17:32 Application returned an error: failed to get message: failed to get next message: Get "https://broker.actions.githubusercontent.com/scalesets/message": GET https://broker.actions.githubusercontent.com/scalesets/message giving up after 1 attempt(s): context canceled
    --
    
    
    
    
  16. nikola-jokic commented on May 9, 2025

    @nikola-jokic
    Collaborator

    Since this is context cancelled, it seems to me that something is sending sigint to the listener. Can you check the kubelet logs on the node where the listener was?

  17. kimxogus commented on May 13, 2025

    @kimxogus
    Contributor

    @nikola-jokic I couldn't find any suspicious kubelet log. The listener pod started normally, and no sigint sent to that.

  18. philprime commented on May 14, 2025

    @philprime

    Found this issue while researching solutions, I am also seeing the listener crash.

    This was in my logs:

    2025-05-14T21:37:48.117173582+02:00 stderr F 2025-05-14T19:37:48Z	INFO	listener-app.worker.kubernetesworker	Ephemeral runner set scaled.	{"namespace": "github-arc-1177490-62595682", "name": "k8s-ci-default-r6vkb", "replicas": 4}
    2025-05-14T21:37:48.117298343+02:00 stderr F 2025-05-14T19:37:48Z	INFO	listener-app.listener	Getting next message	{"lastMessageID": 100025890}
    2025-05-14T21:38:29.884706691+02:00 stderr F 2025-05-14T19:38:29Z	ERROR	listener-app	Retryable client error	{"error": "Get \"https://broker.actions.githubusercontent.com/scalesets/message?lastMessageId=100025890\": context canceled", "method": "GET", "url": "https://broker.actions.githubusercontent.com/scalesets/message?lastMessageId=100025890", "error": "request failed"}
    2025-05-14T21:38:29.884730072+02:00 stderr F github.com/actions/actions-runner-controller/github/actions.(*clientLogger).Error
    2025-05-14T21:38:29.884733052+02:00 stderr F 	github.com/actions/actions-runner-controller/github/actions/client.go:77
    2025-05-14T21:38:29.884735842+02:00 stderr F github.com/hashicorp/go-retryablehttp.(*Client).Do
    2025-05-14T21:38:29.884737792+02:00 stderr F 	github.com/hashicorp/[email protected]/client.go:718
    2025-05-14T21:38:29.884740552+02:00 stderr F github.com/hashicorp/go-retryablehttp.(*RoundTripper).RoundTrip
    2025-05-14T21:38:29.884743302+02:00 stderr F 	github.com/hashicorp/[email protected]/roundtripper.go:47
    2025-05-14T21:38:29.884745192+02:00 stderr F net/http.send
    2025-05-14T21:38:29.884747732+02:00 stderr F 	net/http/client.go:259
    2025-05-14T21:38:29.884749492+02:00 stderr F net/http.(*Client).send
    2025-05-14T21:38:29.884752262+02:00 stderr F 	net/http/client.go:180
    2025-05-14T21:38:29.884754982+02:00 stderr F net/http.(*Client).do
    2025-05-14T21:38:29.884757832+02:00 stderr F 	net/http/client.go:724
    2025-05-14T21:38:29.884760612+02:00 stderr F net/http.(*Client).Do
    2025-05-14T21:38:29.884763142+02:00 stderr F 	net/http/client.go:590
    2025-05-14T21:38:29.884766082+02:00 stderr F github.com/actions/actions-runner-controller/github/actions.(*Client).Do
    2025-05-14T21:38:29.884768552+02:00 stderr F 	github.com/actions/actions-runner-controller/github/actions/client.go:274
    2025-05-14T21:38:29.884770802+02:00 stderr F github.com/actions/actions-runner-controller/github/actions.(*Client).GetMessage
    2025-05-14T21:38:29.884772702+02:00 stderr F 	github.com/actions/actions-runner-controller/github/actions/client.go:578
    2025-05-14T21:38:29.884774572+02:00 stderr F github.com/actions/actions-runner-controller/cmd/ghalistener/listener.(*Listener).getMessage
    2025-05-14T21:38:29.884776372+02:00 stderr F 	github.com/actions/actions-runner-controller/cmd/ghalistener/listener/listener.go:272
    2025-05-14T21:38:29.884778102+02:00 stderr F github.com/actions/actions-runner-controller/cmd/ghalistener/listener.(*Listener).Listen
    2025-05-14T21:38:29.884779832+02:00 stderr F 	github.com/actions/actions-runner-controller/cmd/ghalistener/listener/listener.go:163
    2025-05-14T21:38:29.884781542+02:00 stderr F github.com/actions/actions-runner-controller/cmd/ghalistener/app.(*App).Run.func1
    2025-05-14T21:38:29.884783272+02:00 stderr F 	github.com/actions/actions-runner-controller/cmd/ghalistener/app/app.go:124
    2025-05-14T21:38:29.884785502+02:00 stderr F golang.org/x/sync/errgroup.(*Group).Go.func1
    2025-05-14T21:38:29.884787362+02:00 stderr F 	golang.org/x/[email protected]/errgroup/errgroup.go:78
    2025-05-14T21:38:29.884903934+02:00 stderr F 2025-05-14T19:38:29Z	INFO	listener-app.listener	Deleting message session
    2025-05-14T21:38:30.378596551+02:00 stderr F 2025/05/14 19:38:30 Application returned an error: failed to get message: failed to get next message: Get "https://broker.actions.githubusercontent.com/scalesets/message?lastMessageId=100025890": GET https://broker.actions.githubusercontent.com/scalesets/message?lastMessageId=100025890 giving up after 1 attempt(s): context canceled
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    gha-runner-scale-setquestion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions