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

When the client fails to connect to the UPS (because of access denied), it then also fails to generate a bug report #80

Closed
miguno opened this issue Feb 18, 2023 · 13 comments · Fixed by #86
Assignees
Labels
bug Something isn't working

Comments

@miguno
Copy link

miguno commented Feb 18, 2023

In my case a forbidden IP address on which the client was running caused the client to fail its connection to the UPS. This was expected. What was not expected was that the client app then failed to generate a bug report.

Here is the original error message, when the client's IP address was not yet permitted to connect to the UPS:

Exception type: WinNUT_Client_Common.NutException
Exception message: ACCESSDENIED (ERR ACCESS-DENIED)
Query: LOGOUT
Exception stack trace:
   at WinNUT_Client_Common.Nut_Socket.Query_Data(String Query_Msg)
   at WinNUT_Client_Common.Nut_Socket.Disconnect(Object silent, Object forceful)
   at WinNUT_Client_Common.UPS_Device.Disconnect(Boolean cancelReconnect, Boolean silent, Boolean forceful)
   at WinNUT_Client.WinNUT.UPSDisconnect()
   at WinNUT_Client.WinNUT.Menu_Reconnect_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

The actual problem described in this issue is, however, that the client then also failed to generate a bug report:

Exception type: System.InvalidOperationException
Exception message: Collection was modified; enumeration operation may not execute.
Exception stack trace:
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
   at WinNUT_Client.My.MyApplication.Generate_Button_Click(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

The attached screenshots show the same information.

error1

error2

@gbakeman
Copy link
Contributor

Thank you for the detailed report! I just want to mention that the Generate Report bug sounds related to #79 , so I'm going to focus on that first if you won't mind testing some debug builds soon.

@miguno
Copy link
Author

miguno commented Feb 27, 2023

Thanks. Works for me!

@gbakeman
Copy link
Contributor

So just to be sure, I'm assuming that this is happening on Pre-Release 2.2.8436?

@miguno
Copy link
Author

miguno commented Feb 27, 2023

Yes, this was the latest available release (tag) when I downloaded it.

@myself248
Copy link

This is happening to me too. I reported the initial crash in #82 but then the while-generating-the-report crash is here:

Exception type: System.InvalidOperationException
Exception message: Collection was modified; enumeration operation may not execute.
Exception stack trace:
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
at WinNUT_Client.My.MyApplication.Generate_Button_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I am using 2.2.8436.

@gbakeman
Copy link
Contributor

Everyone,

Apologies for the long wait. I've released a new debug build that hopes to at least address the crash when you try generating a bug report. Please download the debug build here, extract it to a temporary folder (in your Downloads folder for example), run it, then provide the log when you see the crash again. Thank you!

@gbakeman gbakeman self-assigned this May 26, 2023
@gbakeman gbakeman added the bug Something isn't working label May 26, 2023
@gbakeman gbakeman added this to the 2.2 Stable Release milestone May 26, 2023
@gbakeman gbakeman linked a pull request May 26, 2023 that will close this issue
@gbakeman
Copy link
Contributor

I've tried to replicate this crash by connecting to a NUT server that I shouldn't be allowed to connect to (by way of hosts.deny/allow), but I can't seem to reproduce it. I did clean up the authentication/login code a little, so I'd like everyone experiencing this issue to please download the latest debug build and try running it. If you still experience the error, please describe in detail how you're producing it. Thanks everyone!

@andsoitgoes
Copy link

I've tried to replicate this crash by connecting to a NUT server that I shouldn't be allowed to connect to (by way of hosts.deny/allow), but I can't seem to reproduce it. I did clean up the authentication/login code a little, so I'd like everyone experiencing this issue to please download the latest debug build and try running it. If you still experience the error, please describe in detail how you're producing it. Thanks everyone!

Just wondering if there's anything that's come of this? Do I need to upload further debug logs or are the ones I submitted sufficient?

@gbakeman
Copy link
Contributor

gbakeman commented Jul 2, 2023

I've tried to replicate this crash by connecting to a NUT server that I shouldn't be allowed to connect to (by way of hosts.deny/allow), but I can't seem to reproduce it. I did clean up the authentication/login code a little, so I'd like everyone experiencing this issue to please download the latest debug build and try running it. If you still experience the error, please describe in detail how you're producing it. Thanks everyone!

Just wondering if there's anything that's come of this? Do I need to upload further debug logs or are the ones I submitted sufficient?

I had made some changes that I thought would help with the crashing, but I had confirmation that that is not the case in #79. I'm actually wondering if this is a duplicate of #79, and I realize I forgot to check what NUT server everyone is connecting to here. Do you all connect to a Synology NUT server by any chance?

@gbakeman gbakeman removed a link to a pull request Jul 2, 2023
gbakeman added a commit that referenced this issue Jul 2, 2023
Improvements to Login subroutine

Closing to merge changes and continue broader efforts towards #79 and #80 per PR #86 .
@gbakeman gbakeman linked a pull request Jul 3, 2023 that will close this issue
@gbakeman
Copy link
Contributor

gbakeman commented Jul 4, 2023

All,

Please download the latest debug build and extract to a temporary location to test. If you would please, provide the full log even if the test is successful (should be in the Data directory, which you can find in your settings menu in the log section). Also I would like to know exactly what the NUT server is that you're connecting to.

Thank you!

@myself248
Copy link

Hey, this one works! Okay, the NUT sever I'm connecting to is on a Synology NAS, and it has a dialog for entering the IP addresses of permitted hosts. Evidently my desktop's IP was stable for a very long time but then changed, and the server was rejecting it, which I suspect might've been causing the crashes, but I didn't think to check the server config because "nothing had changed". Hah.

Now that this build doesn't immediately crash, it still wouldn't connect, so I went looking for other causes, found the server config, and added my desktop's current IP. (I'll go fix this with static DHCP later.) Now it connects!

WinNUT-Client-2023-07-15.log

@gbakeman
Copy link
Contributor

gbakeman commented Aug 2, 2023

All,

The issue closed as a result of me merging the pull request with the main branch. I think the primary problem(s) here have been resolved so I'm working towards a pre-release now. I think we still need to do a better job handling ACCESS-DENIED errors, so if you're interested, please subscribe to issue #96 for further updates. And stay tuned for a pre-release in the near future.

@andsoitgoes
Copy link

All,

The issue closed as a result of me merging the pull request with the main branch. I think the primary problem(s) here have been resolved so I'm working towards a pre-release now. I think we still need to do a better job handling ACCESS-DENIED errors, so if you're interested, please subscribe to issue #96 for further updates. And stay tuned for a pre-release in the near future.

Thank you!! It's so nice to have this back up and working!!

I had to go through the whole setup again because I'd totally forgotten what the heck I needed to do, tested it again and it fully connected!

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
Development

Successfully merging a pull request may close this issue.

4 participants