Skip to content

Crash with BadImageFormatException: Bad IL range on ARM64 when using submodules #4108

@tomasbarton-stemcell

Description

@tomasbarton-stemcell

Describe the bug

The run on a custom runner fails with the following message when running on an ARM64 system without git installed and when using submodules:

Build & Test Emulator
System.BadImageFormatException: Bad IL range.
   at GitHub.Services.WebApi.Utilities.Internal.UserAgentUtility.GetDefaultRestUserAgent()
   at GitHub.Services.WebApi.VssClientHttpRequestSettings.ConstructDefaultSettings()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at GitHub.Services.WebApi.VssClientHttpRequestSettings.get_Default()
   at GitHub.Runner.Sdk.VssUtil.InitializeVssClientSettings(List`1 additionalUserAgents, IWebProxy proxy)
   at GitHub.Runner.Worker.Worker.RunAsync(String pipeIn, String pipeOut)
   at GitHub.Runner.Worker.Program.MainAsync(IHostContext context, String[] args)

I can see that it is using the fallback method to get the repo on build that do not clone a submodule:

The repository will be downloaded using the GitHub REST API
To create a local Git repository instead, add Git 2.18 or higher to the PATH

The moment I try to get submodules the job fails to start with the exception above.

The issue goes away when I install git. Therefore it seems to me that some of the functionality that is used by the fallback GitHub REST API method is trying to use .NET functionality that is corrupted, or perhaps compiled on the wrong architecture?

To Reproduce
Steps to reproduce the behavior:

  • have a custom arm64 (raspberry pi OS for example) runner without git
  • having a repo with a git submodule
  • use the following to checkout with submodules:
      - name: Checkout repository
        uses: actions/checkout@v5
        with:
          submodules: true
          fetch-depth: 0
          fetch-tags: true

Expected behavior

I would expect this to either work or to give a clear message that submodules are not supported with the fallback repo clone method. Currently it fails even before the job seem to start as viewed in the web UI:

Image

Runner Version and Platform

2.329.0

64 bit Raspberry Pi OS (based of Debian 13)

What's not working?

Job fails to start.

Job Log Output

No logs because job fails to start. The only indication is the error message in the GUI.

Runner and Worker's Diagnostic Logs

[2025-11-10 23:43:52Z INFO HostContext] No proxy settings were found based on environmental variables (http_proxy/https_proxy/HTTP_PROXY/HTTPS_PROXY)
[2025-11-10 23:43:52Z INFO HostContext] Well known directory 'Bin': '/home/pi/actions-runner/bin'
[2025-11-10 23:43:52Z INFO HostContext] Well known directory 'Root': '/home/pi/actions-runner'
[2025-11-10 23:43:52Z INFO HostContext] Well known config file 'Credentials': '/home/pi/actions-runner/.credentials'
[2025-11-10 23:43:52Z INFO HostContext] Well known directory 'Bin': '/home/pi/actions-runner/bin'
[2025-11-10 23:43:52Z INFO HostContext] Well known directory 'Root': '/home/pi/actions-runner'
[2025-11-10 23:43:52Z INFO HostContext] Well known config file 'Runner': '/home/pi/actions-runner/.runner'
[2025-11-10 23:43:52Z INFO Worker] Version: 2.329.0
[2025-11-10 23:43:52Z INFO Worker] Commit: c76c59996c8fa32e989164a5a695efb12608ae5a
[2025-11-10 23:43:52Z INFO Worker] Culture: en-GB
[2025-11-10 23:43:52Z INFO Worker] UI Culture: en-GB
[2025-11-10 23:43:52Z ERR  Worker] System.BadImageFormatException: Bad IL range.
   at GitHub.Services.WebApi.Utilities.Internal.UserAgentUtility.GetDefaultRestUserAgent()
   at GitHub.Services.WebApi.VssClientHttpRequestSettings.ConstructDefaultSettings()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at GitHub.Services.WebApi.VssClientHttpRequestSettings.get_Default()
   at GitHub.Runner.Sdk.VssUtil.InitializeVssClientSettings(List`1 additionalUserAgents, IWebProxy proxy)
   at GitHub.Runner.Worker.Worker.RunAsync(String pipeIn, String pipeOut)
   at GitHub.Runner.Worker.Program.MainAsync(IHostContext context, String[] args)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions