Skip to content

A lot of random "A task was cancelled" errors #3819

Open

Description

@omer2500

Describe the bug

We've encountered intermittent "A task was cancelled" errors during various phases of our GitHub Actions workflows. These errors occur inconsistently—sometimes during the setup-job phase, and other times mid-execution within a job step.

In the logs, we didn't find anything interesting...
And we are looking for a direction to investigate
To Reproduce

Steps to reproduce the behavior:

  1. run a lot of matrix jobs in self self-hosted runner

Runner Version and Platform

Version of your runner?

linux 2.323.0

What's not working?

Image

we are running the runner on a self hosted aws eks cluster with ARC

Activity

  1. added
    bug
    on Apr 22, 2025
  2. patrickvinograd commented on Apr 23, 2025

    @patrickvinograd

    We are also observing this for roughly the last week.

  3. omer2500 commented on Apr 24, 2025

    @omer2500
    Author

    Can confirm, for example https://github.com/pylonmc/pylon-core/actions/runs/14648537973/job/41108671805

    im not sure its the same issue

    Error: The operation was canceled. vs Error: A task was canceled

  4. Seggan commented on Apr 24, 2025

    @Seggan

    Ah, maybe not. I'll make a separate issue

  5. mjeszenkavalstro commented on Apr 28, 2025

    @mjeszenkavalstro

    Our organization is having the same issue.

  6. adel-s commented on Apr 29, 2025

    @adel-s

    Ours also.

  7. Noamshmueli commented on Apr 29, 2025

    @Noamshmueli

    Our organization also experience the same issue

  8. YevhS commented on May 7, 2025

    @YevhS

    The same for me as well

  9. m0ana commented on May 7, 2025

    @m0ana

    Same in our org

  10. Storm-BE commented on May 13, 2025

    @Storm-BE

    Same thing here :(

  11. Storm-BE commented on May 13, 2025

    @Storm-BE

    I did some investigation before on the logs of our runners, and found a pattern for jobs that get cancelled while being started.

    Image

    The runner shuts down immediately because it gets a 'Runner not found' response from some API.
    This seems related to following change: #3536
    I suspect that this 'runner not found' is a transient issue and a retry fixed it before this change got merged

  12. patrickvinograd commented on May 15, 2025

    @patrickvinograd

    We see the same pattern in the runner logs. If we put them side-by-side with the gha-scale-set-controller logs, we see:

    May 15 06:47:02.249 | gha-runner-scale-set-controller | Checking if runner exists in GitHub service
    May 15 06:47:02.249 | gha-runner-scale-set-controller | Runner exists in GitHub service
    

    And then immediately in the runner logs:

    An error occurred: Runner not found
    

    The scale-set-controller tries up to 5 times before failing the ephemeral runner, and the pattern is consistent throughout - the controller thinks the runner resource exists on the GHA service side, the runner starts up and thinks it does not. I have not dug through the code to see if they are invoking the exact same API/referring to the same thing.

  13. patrickvinograd commented on May 15, 2025

    @patrickvinograd

    The runner code is generating the RunnerNotFound exception here invoking a /message endpoint and getting some error payload with "RunnerNotFound" from that GHA broker API. I.e. it's not a connection failure or anything like that, it's getting a response back from the service and parsing it.

    The scale-set-controller is invoking a GetRunner method here, seems to be a totally different endpoint _apis/distributedtask/pools/0/agents/<runner_id> that's returning successfully.

    Without knowing any internal details of the Github Actions service APIs I don't see what else affected parties outside of Github can do to resolve or even mitigate this.

  14. mihstaub commented on May 15, 2025

    @mihstaub

    Our org have the same issue....

  15. 14 remaining items

  16. moatorres commented on Dec 20, 2025

    @moatorres

    The core issue is the lack of feedback and the opaque nature of the cancellation. There’s no indication of cause or any hint as to why the actions are being cancelled. Improving or expanding the error context would help clarify what’s happening.

  17. jeaye commented on Dec 28, 2025

    @jeaye

    I'm seeing the same thing regularly for one of my jobs (the one which publishes my releases, alas). Has anyone found a workaround?

    Error: The operation was canceled.
    ##[debug]System.OperationCanceledException: The operation was canceled.
    ##[debug]   at System.Threading.CancellationToken.ThrowOperationCanceledException()
    ##[debug]   at GitHub.Runner.Sdk.ProcessInvoker.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Channel`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
    ##[debug]   at GitHub.Runner.Common.ProcessInvokerWrapper.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Channel`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
    ##[debug]   at GitHub.Runner.Worker.Handlers.DefaultStepHost.ExecuteAsync(IExecutionContext context, String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Boolean inheritConsoleHandler, String standardInInput, CancellationToken cancellationToken)
    ##[debug]   at GitHub.Runner.Worker.Handlers.ScriptHandler.RunAsync(ActionRunStage stage)
    ##[debug]   at GitHub.Runner.Worker.ActionRunner.RunAsync()
    ##[debug]   at GitHub.Runner.Worker.StepsRunner.RunStepAsync(IStep step, CancellationToken jobCancellationToken)
    ##[debug]Finishing: Build and test jank
    
  18. moatorres commented on Dec 29, 2025

    @moatorres

    I'm seeing the same thing regularly for one of my jobs (the one which publishes my releases, alas). Has anyone found a workaround?

    In my case the worker was silently failing due to OOM kills. I've managed to tame it by reducing --max-old-space-size to 4096 using NODE_OPTIONS.

  19. olefemmy commented on Jan 7, 2026

    @olefemmy

    Same here - I have experienced a lot of these today, and I probablty get lucky after re-running the same pipeline after about 3 or 4 times:
    Hosted Compute Agent
    Version: 20251211.462
    Commit: 6cbad8c2bb55d58165063d031ccabf57e2d2db61
    Build Date: 2025-12-11T16:28:49Z
    Worker ID: {bc46e5ea-c794-4c2b-af75-32cfa97c6b2b}
    Image: ubuntu-24.04
    Version: 20251215.174.1
    Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20251215.174/images/ubuntu/Ubuntu2404-Readme.md
    Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20251215.174

    Wed, 07 Jan 2026 17:58:28 GMT Error: The operation was canceled.
    Wed, 07 Jan 2026 17:58:28 GMT ##[debug]System.OperationCanceledException: The operation was canceled.
    Wed, 07 Jan 2026 17:58:28 GMT ##[debug]   at System.Threading.CancellationToken.ThrowOperationCanceledException()
    Wed, 07 Jan 2026 17:58:28 GMT ##[debug]   at GitHub.Runner.Sdk.ProcessInvoker.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Channel`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
    Wed, 07 Jan 2026 17:58:28 GMT ##[debug]   at GitHub.Runner.Common.ProcessInvokerWrapper.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Channel`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
    Wed, 07 Jan 2026 17:58:28 GMT ##[debug]   at GitHub.Runner.Worker.Handlers.DefaultStepHost.ExecuteAsync(IExecutionContext context, String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Boolean inheritConsoleHandler, String standardInInput, CancellationToken cancellationToken)
    Wed, 07 Jan 2026 17:58:28 GMT ##[debug]   at GitHub.Runner.Worker.Handlers.ScriptHandler.RunAsync(ActionRunStage stage)
    Wed, 07 Jan 2026 17:58:28 GMT ##[debug]   at GitHub.Runner.Worker.ActionRunner.RunAsync()
    Wed, 07 Jan 2026 17:58:28 GMT ##[debug]   at GitHub.Runner.Worker.StepsRunner.RunStepAsync(IStep step, CancellationToken jobCancellationToken)
    Wed, 07 Jan 2026 17:58:28 GMT ##[debug]Finishing: Build
    
  20. olefemmy commented on Jan 9, 2026

    @olefemmy

    When I reverted from ubuntu-latest to ubuntu-22.04, the pipeline seems to be happy.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions