Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes relating to bad/out-of-range values reported by NUT server #129

Closed
aazz-top opened this issue Feb 1, 2024 · 13 comments · Fixed by #131
Closed

Crashes relating to bad/out-of-range values reported by NUT server #129

aazz-top opened this issue Feb 1, 2024 · 13 comments · Fixed by #131
Assignees
Labels
bug Something isn't working

Comments

@aazz-top
Copy link

aazz-top commented Feb 1, 2024

我的UPS电源连接在群晖DS220+上。
群晖的设置已经正确,所有状态正常,IP也允许局域网的IP。
通过ssh的 upsc ups 也看见了ups 的状态。
但是windows上无法用winnut连接。连接成功后会立刻连接失败。.OverflowException: 算术运算导致溢出。
先连接建立成功,1秒钟不到,.OverflowException: 算术运算导致溢出。连接断开。
试了3个版本 2.0 2.2 。

System.OverflowException: 算术运算导致溢出。
在 WinNUT_Client.WinNUT.Event_UpdateBatteryState(String Reason) 位置 C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WinNUT-Client\WinNUT.vb:行号 533
在 WinNUT_Client.WinNUT.UPSDisconnectedEvent() 位置 C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WinNUT-Client\WinNUT.vb:行号 359
在 WinNUT_Client_Common.UPS_Device.DisconnectedEventHandler.Invoke()
在 WinNUT_Client_Common.UPS_Device.Disconnect(Boolean cancelReconnect, Boolean forceful) 位置 C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WinNUT-Client_Common\UPS_Device.vb:行号 185
在 WinNUT_Client_Common.UPS_Device.Retrieve_UPS_Datas(Object sender, EventArgs e) 位置 C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WinNUT-Client_Common\UPS_Device.vb:行号 366
在 System.Windows.Forms.Timer.OnTick(EventArgs e)
在 System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

@gbakeman
Copy link
Contributor

gbakeman commented Feb 2, 2024

Hello,

Please update to the latest Pre-Release and let me know if you still experience the error.

@gbakeman gbakeman added bug Something isn't working question Further information is requested labels Feb 2, 2024
@aazz-top
Copy link
Author

aazz-top commented Feb 5, 2024

Hello,

Please update to the latest Pre-Release and let me know if you still experience the error.

PC: windosw 10 22H2

Pre-Release v2.3.8800

System.OverflowException: 算术运算导致溢出。
在 WinNUT_Client.WinNUT.Event_UpdateBatteryState(String Reason) 位置 C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WinNUT-Client\WinNUT.vb:行号 587
在 WinNUT_Client.WinNUT.UPSDisconnectedEvent() 位置 C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WinNUT-Client\WinNUT.vb:行号 480
在 WinNUT_Client_Common.UPS_Device.DisconnectedEventHandler.Invoke()
在 WinNUT_Client_Common.UPS_Device.Disconnect(Boolean cancelReconnect, Boolean forceful) 位置 C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WinNUT-Client_Common\UPS_Device.vb:行号 186
在 WinNUT_Client_Common.UPS_Device.Retrieve_UPS_Datas(Object sender, EventArgs e) 位置 C:\Users\Glen\Repositories\nutdotnet\WinNUT-Client\WinNUT_V2\WinNUT-Client_Common\UPS_Device.vb:行号 367
在 System.Windows.Forms.Timer.OnTick(EventArgs e)
在 System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

@gbakeman gbakeman changed the title 先连接建立成功,1秒钟不到,.OverflowException: 算术运算导致溢出。连接断开。 OverflowException in WinNUT.Event_UpdateBatteryState Feb 7, 2024
@gbakeman
Copy link
Contributor

gbakeman commented Feb 7, 2024

I can see where the error is occurring, although I'm not quite sure why. Please download the debug build from here once it is available and let me know if it works. If you encounter an error again, please attach the full log file to your comment.

@aazz-top
Copy link
Author

aazz-top commented Feb 8, 2024

I can see where the error is occurring, although I'm not quite sure why. Please download the debug build from here once it is available and let me know if it works. If you encounter an error again, please attach the full log file to your comment.

WinNUT-Client-2024-02-08.log
System.NullReferenceException 未将对象引.txt

thank you very much !
this is log file

@gbakeman
Copy link
Contributor

gbakeman commented Feb 8, 2024

It looks like the original problem may have been fixed, although you found another one relating to the log file! I have another build going here. Please see if you can find any issues in this one. Thank you for your help!

@aazz-top
Copy link
Author

aazz-top commented Feb 9, 2024

It does not work properly and is automatically disconnected repeatedly.also.
WinNUT-Client-2024-02-09.log

@gbakeman
Copy link
Contributor

gbakeman commented Feb 9, 2024

I'm sorry, I'm going to have to look into this more. I think I need to make some changes in how WinNUT logs information so that will make it easier for me to troubleshoot issues, and it also looks like we may be facing an edge case or two being reported by the UPS. Please stand by.

@aazz-top
Copy link
Author

I'm sorry, I'm going to have to look into this more. I think I need to make some changes in how WinNUT logs information so that will make it easier for me to troubleshoot issues, and it also looks like we may be facing an edge case or two being reported by the UPS. Please stand by.

what can i do for you

@gbakeman
Copy link
Contributor

I just had a chance to make another small update. I don't expect this will fix the immediate issue, but I hope that it does improve logging somewhat. Please give this build a try and upload the log file. After this, I should be able to fix the current issue you're experiencing. You've been wonderful so far, thank you for your patience.

@aazz-top
Copy link
Author

I just had a chance to make another small update. I don't expect this will fix the immediate issue, but I hope that it does improve logging somewhat. Please give this build a try and upload the log file. After this, I should be able to fix the current issue you're experiencing. You've been wonderful so far, thank you for your patience.

WinNUT-Client-2024-02-18.log
plz cheak it thanks

@gbakeman gbakeman removed the question Further information is requested label Feb 18, 2024
@gbakeman
Copy link
Contributor

gbakeman commented Feb 18, 2024

I've made some changes that I think will fix the issue you're facing now, download here. Whether this one is successful or not, please upload the log again after testing. Thank you again for testing this.

@gbakeman gbakeman added the question Further information is requested label Feb 18, 2024
@aazz-top
Copy link
Author

I've made some changes that I think will fix the issue you're facing now, download here. Whether this one is successful or not, please upload the log again after testing. Thank you again for testing this.

WinNUT-Client-2024-02-28.log

Thank you very much, it is running successfully.Thank youThank youThank youThank youThank you

@gbakeman
Copy link
Contributor

And thank you for your patience and persistence - you helped me fix at least three different bugs here. I do want to mention that it looks like your UPS or NUT server are reporting strange values for different variables, mostly related to the battery. You may want to try restarting your NUT server to see if that corrects some of the values again.

In the meantime, I will work on sending out another pre-release so you can continue using WinNUT normally without the debug build.

@gbakeman gbakeman changed the title OverflowException in WinNUT.Event_UpdateBatteryState Crashes relating to bad/out-of-range values reported by NUT server Feb 28, 2024
@gbakeman gbakeman removed the question Further information is requested label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants