Native Agent 2 Windows builds produce invalid binaries

XMLWordPrintable

    • Type: Problem report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 6.0.47, 7.0.27, 7.0.28, 8.0.0beta2
    • Component/s: Agent2 (G)
    • None
    • Environment:
      Windows

      Steps to reproduce:

      1. Build Agent 2 natively on Windows (i.e., not in MSYS2)

      Result:
      A successfully built binary, but the binary is invalid. Attempting to execute the binary results in an error message with no execution. Additionally, even if Go 1.24.10 is installed in the system, the build will automatically and forcefully download 1.25.9 during the build and the binary is built against that downloaded version instead of the system Go.
      Expected:
      A valid Windows executable built against the system Go 1.24.10.

       

      Notes and Cause:

      Recently the minimum required Go version was changed to 1.25.9 in src/go/go.mod for the Agent 2 sources, as well as in src/go/vendor/modules.txt for the Zabbix Go SDK modules. However, the 6.0 documentation states "Go 1.23 or later is supported. See go.dev for installation instructions.", while the 7.0 and 8.0 documentation state "Go 1.24.10 or later is supported. See go.dev for installation instructions."

      I also wasn't able to find any mention of a change to 1.25.9 or later in any minor version release notes or upgrade notes.

      In addition, using Go 1.25.0 or greater to build natively on Windows results in an invalid binary that cannnot execute. This is a known bug in the CGO linker and is not yet resolved.

      https://github.com/golang/go/issues/75077

      I was able to build a non-native Agent 2 from within an MSYS2 shell that successfully executed but relied on MSYS libraries not available natively. However, when building natively from the Windows command prompt, the Agent 2 binary was built but could not be executed, with an error message that it was not a valid Windows executable. Additionally, the system Go version I had installed is 1.24.10, but the build automatically downloaded version 1.25.9 as specified in go.mod and modules.txt, and built against that instead of the system Go. I verified this against the non-native MSYS2 executable by passing the --version flag:

      ./zabbix_agent2.exe --version
      zabbix_agent2 Win64 (Zabbix) 7.0.28
      Revision 86f12eab509 6 July 2026, compilation time: 2026-07-16 15:53:24, built with: go1.25.9

      This is the result of trying to execute the native executable with the --version flag (Japanese locale Windows):

      zabbix_agent2.exe --version
      アクセスが拒否されました。

      As reported in the CGO issue link above, a workaround is to build with GOEXPERIMENT=nodwarf5.

      Please revert the Go version in go.mod and modules.txt back to the version in the documentation. If there is a reason that 1.25.9 or greater must be used, please correct the documentation to reflect this and also include it in release/upgrade notes.

            Assignee:
            Zabbix Support Team
            Reporter:
            Justin Boffemmyer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: