Agent 2 on windows exits with runtime error: index out of range [1] with length 0 [recovered, repanicked]

XMLWordPrintable

    • Type: Problem report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 7.0.27rc1, 7.4.11rc1, 8.0.0beta1
    • Component/s: Agent2 (G)

      Description:

      Agent 2 is running on Windows in foreground mode. Sometimes it exits with error:

      panic: runtime error: index out of range [1] with length 0 [recovered, repanicked]

      This behaviour is not consistent. Sometimes agent2 is exiting with or without errors.

      Could reproduce this error with host: winhost.yaml

      Reproduced same behaviour for master, release/7.4, release/7.0 

       

      Preconditions:

      Build agent2 via Jenkins job.

      ZIP (For master): zabbix_agent2-8.0.0beta1-windows-amd64-static_master.zip

      Steps to reproduce:

      1. Import host to Zabbix UI
      2. Adjust zabbix_agent2.config file parameters. 
        1. Server=server IP
        2. ServerActive=server IP for active checks
        3. Hostname=winhost
      3. Start Server
      4. Start agent2 on Windows in foreground mode. Used command for PowerShell:
        .\bin\zabbix_agent2.exe -c .\conf\zabbix_agent2.conf -f
      1. Make sure Server gets data via active and passive agent2 mode
      2. Exit agent2

      Result:
      Please see screenshot from PowerShell:

      Please see message from from zabbix_agent2.log file:

      2026/05/19 20:39:19.000742 check 'net.tcp.port[192.168.56.1:10050,10050]' is not supported: Invalid first parameter.
      2026/05/19 20:39:19.000742 check 'net.udp.service.perf[ntp,192.168.56, 123]' is not supported: Invalid second parameter.
      2026/05/19 20:39:19.000742 check 'net.tcp.port[192.168.56.103/path,80]' is not supported: Invalid first parameter.
      2026/05/19 20:39:19.000742 check 'net.udp.service[ntp,Sand2/path, 123]' is not supported: Invalid second parameter.
      2026/05/19 20:39:19.000742 check 'net.udp.service[ntp,192.168.56.103:123, 123]' is not supported: Invalid second parameter.
      2026/05/19 20:39:19.000742 check 'net.udp.service.perf[ntp,Sand2/path, 123]' is not supported: Invalid second parameter.
      2026/05/19 20:39:19.001269 check 'net.udp.service.perf[ntp,192.168.56.103:123, 123]' is not supported: Invalid second parameter.
      2026/05/19 20:39:20.002287 failed to read request from 192.168.56.1: Cannot read message: 'read tcp 192.168.56.1:10050->192.168.56.1:9998: i/o timeout'
      2026/05/19 20:39:21.009249 failed to read request from 192.168.56.1: Cannot read message: 'read tcp 192.168.56.1:10050->192.168.56.1:10002: i/o timeout'
      2026/05/19 20:39:22.001100 Critical failure: runtime error: index out of range [1] with length 0
      2026/05/19 20:39:22.001100 goroutine 34 [running]:
      2026/05/19 20:39:22.001100 runtime/debug.Stack()
      2026/05/19 20:39:22.001670     C:/Users/ZABBIX/go/pkg/mod/golang.org/[email protected]/src/runtime/debug/stack.go:26 +0x5e
      2026/05/19 20:39:22.001670 golang.zabbix.com/sdk/log.PanicHook()
      2026/05/19 20:39:22.001670     C:/Users/ZABBIX/build-agents-dev-windows-amd64/zabbix-8.0.0beta1/src/go/vendor/golang.zabbix.com/sdk/log/log.go:291 +0x49
      2026/05/19 20:39:22.001670 panic({0x135dfc0?, 0xc0001701f8?})
      2026/05/19 20:39:22.001670     C:/Users/ZABBIX/go/pkg/mod/golang.org/[email protected]/src/runtime/panic.go:783 +0x132
      2026/05/19 20:39:22.001670 golang.zabbix.com/agent2/internal/agent/scheduler.pluginHeap.Less({0xc000814160?, 0x9000000007f80ff?, 0x10001012d0001?}, 0x0?, 0x2?)
      2026/05/19 20:39:22.001670     C:/Users/ZABBIX/build-agents-dev-windows-amd64/zabbix-8.0.0beta1/src/go/internal/agent/scheduler/pluginheap.go:29 +0xf7
      2026/05/19 20:39:22.001670 container/heap.up({0x14f3e00, 0xc0001eb460}, 0x1?)
      2026/05/19 20:39:22.001670     C:/Users/ZABBIX/go/pkg/mod/golang.org/[email protected]/src/container/heap/heap.go:92 +0x74
      2026/05/19 20:39:22.001670 container/heap.Fix({0x14f3e00, 0xc0001eb460}, 0x1)
      2026/05/19 20:39:22.001670     C:/Users/ZABBIX/go/pkg/mod/golang.org/[email protected]/src/container/heap/heap.go:85 +0x58
      2026/05/19 20:39:22.002771 golang.zabbix.com/agent2/internal/agent/scheduler.(*pluginHeap).Update(...)
      2026/05/19 20:39:22.004289     C:/Users/ZABBIX/build-agents-dev-windows-amd64/zabbix-8.0.0beta1/src/go/internal/agent/scheduler/pluginheap.go:75
      2026/05/19 20:39:22.004289 failed to read request from 192.168.56.1: Cannot read message: 'read tcp 192.168.56.1:10050->192.168.56.1:10007: i/o timeout'
      2026/05/19 20:39:22.005281 golang.zabbix.com/agent2/internal/agent/scheduler.(*Manager).processFinishRequest(0xc0001eb450, {0x14fb540, 0xc00018f200})
      2026/05/19 20:39:22.005281     C:/Users/ZABBIX/build-agents-dev-windows-amd64/zabbix-8.0.0beta1/src/go/internal/agent/scheduler/manager.go:510 +0x214
      2026/05/19 20:39:22.005281 golang.zabbix.com/agent2/internal/agent/scheduler.(*Manager).run(0xc0001eb450)
      2026/05/19 20:39:22.005281     C:/Users/ZABBIX/build-agents-dev-windows-amd64/zabbix-8.0.0beta1/src/go/internal/agent/scheduler/manager.go:617 +0x888
      2026/05/19 20:39:22.005937 created by golang.zabbix.com/agent2/internal/agent/scheduler.(*Manager).Start in goroutine 1
      2026/05/19 20:39:22.005937     C:/Users/ZABBIX/build-agents-dev-windows-amd64/zabbix-8.0.0beta1/src/go/internal/agent/scheduler/manager.go:691 +0xa5
      2026/05/19 20:39:22.005937 
      

       

      Please see error for release/7.4:

      Please see error for release/7.0

      Expected:
      Agent2 should exit without any failures.

        1. winhost.yaml
          17 kB
          Glebs Mirosnikovs
        2. image-2026-05-19-21-15-18-389.png
          90 kB
          Glebs Mirosnikovs
        3. image-2026-05-19-21-43-05-047.png
          93 kB
          Glebs Mirosnikovs
        4. image-2026-05-19-21-51-59-384.png
          89 kB
          Glebs Mirosnikovs

            Assignee:
            Zabbix Development Team
            Reporter:
            Glebs Mirosnikovs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: