Skip to content

Crash at first query after connection, index out of range #239

Description

@gbakeman

Discussed in #238

Originally posted by @r0m30rr July 3, 2026
Hello everyone! Could someone help me understand what is going on in this log that is preventing WinNUT from pulling accurate information from my Unifi UPS Tower?
image
Thanks!

Extracted text from image:

7/3/2026 1:19:53 PM [24228, Logger]: Attempt init log file: C:\Users\r0m30\AppData\Local\NUTDotNet\WinNUT Client\2.3.9492.23861\Logs\WinNUT-Client-2026-07-03.log
====History of 200 previous events ====
[1] 7/3/2026 1:18:53 PM [24228, UPS_Device]: Trying variable: battery.charge
[2] 7/3/2026 1:18:53 PM [24228, UPS_Device]: Socket or other unexpected error encountered. Expect a SocketBroken event to follow.
[3] 7/3/2026 1:18:53 PM [24228, UPS_Device]: Unable to get any UPS variable.
[4] 7/3/2026 1:18:53 PM [24228, UPS_Device]: Last exception recorded:
[5] 7/3/2026 1:18:53 PM [24228, UPS_Device]: System.IndexOutOfRangeException thrown in WinNUT-Client_Common
Message: Index was outside the bounds of the array.
at WinNUT_Client Common.Nut_Socket.Query_Data(String Query_Msg) in C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WinNUT-Client_Common\Nut_Socket.vb:line 185
at WinNUT_Client Common.UPS_Device.GetUPSVar(String[] varNames, Object Fallback_value, Boolean recursing) in C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WinNUT-Client_Common\UPS_Device.vb:line 461

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions