Skip to content

Windows gitea runner tool error #548

@hulto

Description

@hulto

Problem

I'm trying to spin-up a gitea windows runner with garm.
I'm seeing it fail when trying to get the runner tools from garm.

Garm error message:

failed to get runner install template" error="failed to get runner install context: failed to find tools: failed to find tools for OS windows and arch amd64

Based on my troubleshooting below seems like the gitea runner tool for windows is returning windows instead of the expected win.
Have I misconfigured the runner templates or endpoint release URL?

If not what's the best course of action to implement a change?
If it's not too complicated i'm happy to write a fix.
I remember seeing somewhere else a soft match eg.

if (ghOs == tool.GetOS() || osType == tool.GetOS()) && \
        (ghArch == tool.GetArchitecture() || osArch == tool.GetArchitecture()):

Would that be an appropriate solution?

Trouble shooting

Made sure the newly created template is available.

The gitea_windows template was cloned from the github_windows template
To help debug i also tried cloning the gitea_linux template as a windows template for gitea and saw the same behavior

$ garm-cli template ls

+----+----------------+----------------------------------------------------+------------+---------+--------+
| ID | NAME           | DESCRIPTION                                        | FORGE TYPE | OS TYPE | OWNER  |
+----+----------------+----------------------------------------------------+------------+---------+--------+
|  1 | github_windows | Default Windows runner install template for GitHub | github     | windows | system |
+----+----------------+----------------------------------------------------+------------+---------+--------+
|  2 | github_linux   | Default Linux runner install template for GitHub   | github     | linux   | system |
+----+----------------+----------------------------------------------------+------------+---------+--------+
|  3 | gitea_linux    | Default Linux runner install template for Gitea    | gitea      | linux   | system |
+----+----------------+----------------------------------------------------+------------+---------+--------+
|  5 | gitea_windows  | Default Windows runner install template for Gitea  | gitea      | windows | root   |
+----+----------------+----------------------------------------------------+------------+---------+--------+

$ garm-cli template show gitea_windows
+-------------+---------------------------------------------------+
| FIELD       | VALUE                                             |
+-------------+---------------------------------------------------+
| ID          | 5                                                 |
| Created At  | 2025-10-05 02:28:16.1702374 +0000 UTC             |
| Updated At  | 2025-10-05 02:28:16.1702374 +0000 UTC             |
| Name        | gitea_windows                                     |
| Description | Default Windows runner install template for Gitea |
| Owner       | root                                              |
| Forge Type  | gitea                                             |
| OS Type     | windows                                           |
+-------------+---------------------------------------------------+

Added debug prints.

Image
$ git diff vendor/github.com/cloudbase/garm-provider-common/util/util.go
diff --git a/vendor/github.com/cloudbase/garm-provider-common/util/util.go b/vendor/github.com/cloudbase/garm-provider-common/util/util.go
index 36ce09ba..b33b940f 100644
--- a/vendor/github.com/cloudbase/garm-provider-common/util/util.go
+++ b/vendor/github.com/cloudbase/garm-provider-common/util/util.go
@@ -20,6 +20,7 @@ import (
        "crypto/rand"
        "encoding/base64"
        "encoding/binary"
+    "encoding/json"
        "fmt"
        "io"
        "math/big"
@@ -30,6 +31,7 @@ import (
        "strings"
        "unicode"
        "unicode/utf16"
+       "log/slog"
 
        runnerErrors "github.com/cloudbase/garm-provider-common/errors"
        "github.com/cloudbase/garm-provider-common/params"
@@ -216,6 +218,9 @@ func GetTools(osType params.OSType, osArch params.OSArch, tools []params.RunnerA
                if err != nil {
                        continue
                }
+               b, _ := json.Marshal(tool)
+               slog.Debug(fmt.Sprintf("available tool: %s", string(b)))
+               slog.Debug(fmt.Sprintf("available tool: %s == %s && %s == %s: %s", tool.GetArchitecture(), ghArch, tool.GetOS(), ghOS, tool.GetDownloadURL()))
                if tool.GetArchitecture() == ghArch && tool.GetOS() == ghOS {
                        return tool, nil
                }
time=2025-10-05T02:56:39.714Z level=DEBUG msg="available tool: {\"os\":\"windows\",\"architecture\":\"x64\",\"download_url\":\"https://gitea.com/gitea/act_runner/releases/download/v0.2.13/act_runner-0.2.13-windows-amd64.exe.xz\",\"filename\":\"act_runner-0.2.13-windows-amd64.exe.xz\"}"
time=2025-10-05T02:56:39.714Z level=DEBUG msg="available tool: x64 == x64 && windows == win: https://gitea.com/gitea/act_runner/releases/download/v0.2.13/act_runner-0.2.13-windows-amd64.exe.xz"
time=2025-10-05T02:56:39.714Z level=INFO msg="failed to get runner install template" error="failed to get runner install context: failed to find tools: failed to find tools for OS windows and arch amd64"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions