HenriWahl / Nagstamon

Nagios status monitor for your desktop.
https://nagstamon.de
Other
419 stars 170 forks source link

APP Crash on Windows using Zabbix connector #904

Open Lnunovero92 opened 1 year ago

Lnunovero92 commented 1 year ago

Hello dear friends,

I have been using Nagstamon version 3.8 to monitor Zabbix alarms without problems until recently when I upgraded to version 3.10. Once the upgrade was done, we started to notice the application closing automatically, as well as when clicking on the "Copy to clipboard - All Information" button.

This is the error message seen in the event log:

Faulting application name: Nagstamon.exe, version: 0.0.0.0, time stamp: 0x635afee7 Faulting module name: Qt6Core.dll, version: 6.3.1.0, time stamp: 0x6298c2d2 Exception code: 0xc0000409 Fault offset: 0x00000000000103b8 Faulting process id: 0x7724 Faulting application start time: 0x01d9375551267afb Faulting application path: C:\Program Files\Nagstamon\Nagstamon.exe Faulting module path: C:\Program Files\Nagstamon\PyQt6\Qt6\bin\Qt6Core.dll Report Id: ab5631f0-8538-4716-b1d2-dc165c931dc1 Faulting package full name: Faulting package-relative application ID:

I would be grateful if you could help me with this issue.

sebhofmann commented 1 year ago

This is probably caused by #901.

Lnunovero92 commented 1 year ago

Thank you for your prompt reply @sebhofmann . Is there any suggestion to apply a workaround for the Windows case?

The version of zabbix I'm using is 6.2.

Greetings.

sebhofmann commented 1 year ago

Maybe you can find the files described in the issue #901 somewhere in the folder C:\Program Files\Nagstamon\ and change them. I don´t know if they are stored on the disk or maybe packed inside the Nagstamon.exe. If they are packend you probably have to wait if someone makes a pull request and a realease.

HenriWahl commented 1 year ago

@Lnunovero92 please check latest release from https://github.com/HenriWahl/Nagstamon/releases/tag/latest

HenriWahl commented 1 year ago

@Lnunovero92 so this issue can be closed?

Lnunovero92 commented 1 year ago

It does not solve the problem, even installing the pre-release the Nagstamon console does not work, the process (.exe) closes the second it is executed.

Application name with errors: nagstamon.exe, version: 0.0.0.0.0, timestamp: 0x6364adaf Buggy module name: Qt6Core.dll, version: 6.3.1.0, timestamp: 0x6298c2d2 Exception code: 0xc0000409 Error offset: 0x000000000000000103b8 Process identifier with errors: 0x17d4 Application start time with errors: 0x01d947a3fc4d87e5 Path of the application with errors: C:\Program Files\Nagstamon\nagstamon.exe Path of the failed module: C:\Nagstamon.dll Files:\Nagstamon.exe Report Identifier: f8ee0648-4ae0-4d07-b20b-8956dea0e362 Full name of the package with errors: Relative application identifier of the package with errors:

HenriWahl commented 1 year ago

@Lnunovero92 please try latest debug version so we might find out more: https://github.com/HenriWahl/Nagstamon/releases/download/latest/Nagstamon-3.11-20230222-win64_debug.zip

Lnunovero92 commented 1 year ago

image

The error message indicates the following: (<class 'Nagstamon.thirdparty.zabbix_api.ZabbixAPIException'>, ZabbixAPIException('urllib2.URLError - HTTP Error 403: Forbidden'), <traceback object at 0x000001CDD063C540>)

sebhofmann commented 1 year ago

This looks like you don´t have the rights to read the REST-API. On inux or with linux subsystem you could check that with the commands:

Replace user with your user name, pw with your password and the host.zabbix.de with you zabbix url.

curl -X POST -H "Content-Type:application/json" -d '{
            "jsonrpc": "2.0",
            "method": "user.login",            
            "params": { "username": "user", "password": "pw"},
            "id": 0
        }                                          
' https://host.zabbix.de/api_jsonrpc.php

Replace the TOKEN with the token you get from the first command

curl -X POST -H "Content-Type:application/json" -d '{
            "jsonrpc": "2.0",
            "method": "problem.get", "params":{},
            "auth": "TOKEN",
            "id": 2
        }' https://host.zabbix.de/api_jsonrpc.php
HenriWahl commented 1 year ago

@Lnunovero92 to bad it crashes without notice but @sebhofmann is right, this looks like missing permissions.

Lnunovero92 commented 1 year ago

I apologize, the Nagstamon console does indeed work, but now there is an error when trying to copy all the information of an alert, the following message is displayed and the console closes immediately: image

HenriWahl commented 1 year ago

@Lnunovero92 I added a mitigation in release 3.11-20230225 at https://github.com/HenriWahl/Nagstamon/releases/tag/latest.

@Lnunovero92 @sebhofmann I do not understand how this error could happen - how can this key error appear if there is that service in the output of Zabbix - might there be some JSON problem with the string containing some ':'? @Lnunovero92 could you please again run in debug console to see if there is some feedback of Zabbix shown?

Lnunovero92 commented 1 year ago

Hello @HenriWahl Apologies for being away these days. I did the test with the latest mitigation and now the console does not crash but another inconvenience happens, when you click "Copy to clipboard - All information" to the alert I have which is as follows: image And then you paste the content, the following is shown:

Host: SERVER Status: UP Last check: n/a Duration: Attempt: N/A Status information:

The debug result does not show any problems. image

HenriWahl commented 1 year ago

Well, this mitigation actually only is a mitigation: I cannot reproduce the root cause, so the error will just be - mitigated. Maybe the whole response from the Zabbix server could help to see why the original error occurs.

HenriWahl commented 1 year ago

@Lnunovero92 could you provide the full output of the server's response? Even by private message if you like it better. Looks like some JSON is misinterpreted and leads to this error.

Lnunovero92 commented 1 year ago

Hi @HenriWahl I sent you the information through your e-mail "contact@nagstamon.de".

Greetings.

HenriWahl commented 12 months ago

@Lnunovero92 still happens with latest testing release?

Lnunovero92 commented 11 months ago

Yes, I tried again today with the latest release and it works as long as I don't copy all the information.

Regards

HenriWahl commented 11 months ago

@Lnunovero92 at least I can confirm the empty clipboard.

HenriWahl commented 11 months ago

@Lnunovero92 I think I fixed it - please check latest testing release 3.13-20230921.

Lnunovero92 commented 11 months ago

Hi HenriWahl, I recently did the download of the Nagstamon-3.13-20230927-win64_debug.zip version and I get the following error when opening Nagstamon:

[Errno 2] No such file or directory: 'C:\Users\test\.nagstamon\nagstamon.pid' Traceback (most recent call last): File "Nagstamon\Servers\Generic.py", line 78, in File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "requests_kerberos__init.py", line 17, in File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "requestskerberos\kerberos.py", line 6, in File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "spnego__init__.py", line 26, in File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "spnego\auth.py", line 10, in File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "spnego_negotiate.py", line 31, in File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "spnego_sspi.py", line 39, in File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "sspi\init.py", line 6, in File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "sspi\raw\init__.py", line 8, in File "src\sspi\raw\_context_attributes.pyx", line 1, in init sspi.raw._context_attributes File "src\sspi\raw\_security_context.pyx", line 1, in init sspi.raw._security_context File "src\sspi\raw\_credential.pyx", line 1, in init sspi.raw._credential ModuleNotFoundError: No module named 'sspi.raw._text'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "nagstamon.py", line 45, in File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "Nagstamon\QUI__init.py", line 53, in File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "Nagstamon\Servers\init__.py", line 36, in File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "Nagstamon\Servers\Nagios.py", line 20, in File "PyInstaller\loader\pyimod02_importers.py", line 391, in exec_module File "Nagstamon\Servers\Generic.py", line 80, in ModuleNotFoundError: No module named 'requests_gssapi'

HenriWahl commented 11 months ago

At least I get the same error with the debug version of Nagstamon for Windows.

HenriWahl commented 11 months ago

Please try latest 3.13-20231010 - not sure if it would work WITH Kerberos but it does at least WITHOUT.