HenriWahl / Nagstamon

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

Connection to Alertmanager shows Proxy Error, even though proxy is NOT enabled #944

Open froemra opened 1 year ago

froemra commented 1 year ago

Migrated from Version 3.10.1 to 3.12.0 (OS: Windows 10, Nagstamon-3.12.0-win64_setup)

The Proxy Handling seems garbled.

I have 4 Monitoring Servers configured. All 3 altermanager configurations show "PROXY ERROR", even though there is NO proxy enabled in the settings. Icinga Monitoring works (proxy disabled as well)...

I also checked the server-configs below .nagstamon\servers. All server are configured as follows: use_proxy = False use_proxy_from_os = False

Debug log says:

ERROR: 2023-06-23 12:42:02.076712 Altermanager -- Traceback (most recent call last):
  File "urllib3\connectionpool.py", line 776, in urlopen
  File "urllib3\connectionpool.py", line 1041, in _prepare_proxy
  File "urllib3\connection.py", line 618, in connect
  File "http\client.py", line 925, in _tunnel
OSError: Tunnel connection failed: 403 URLBlocked

The above exception was the direct cause of the following exception:

urllib3.exceptions.ProxyError: ('Unable to connect to proxy', OSError('Tunnel connection failed: 403 URLBlocked'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "requests\adapters.py", line 486, in send
  File "urllib3\connectionpool.py", line 844, in urlopen
  File "urllib3\util\retry.py", line 515, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='***', port=443): Max retries exceeded with url: /api/v2/alerts (Caused by ProxyError('Unable to connect to proxy', OSError('Tunnel connection failed: 403 URLBlocked')))
froemra commented 1 year ago

A complete reinstall (Unistall in Windows Apps, manually remove .nagstamon-Directory) and setting up from scratch didn't help either.

froemra commented 1 year ago

Finally did a complete uninstall again (including .nagstamon-dir) and reinstalling the old Nagstamon-3.10.1-win64_setup.exe -> Everything is working again!

HenriWahl commented 1 year ago

Hi @froemra - this sounds really strange.

Would be interesting what sends you the "403 URLBlocked" message?

HenriWahl commented 1 year ago

@stearz do you have any idea what could cause this?

froemra commented 1 year ago

Perhaps Environment-Variables are picked up with the latest Version, no matter what is configured? (HTTPS_PROXY=...)

HenriWahl commented 1 year ago

@froemra no, the HTTP_PROXY variable won't be evaluated if no proxy was set. Does it exist at all in your Windows environment?

HenriWahl commented 1 year ago

@froemra aside the previous question - is there any network security software active in your network?

froemra commented 1 year ago

@froemra no, the HTTP_PROXY variable won't be evaluated if no proxy was set. Does it exist at all in your Windows environment?

Yes, HTTP_PROXY, HTTPS_PROXY and NO_PROXY are set in System-Env

froemra commented 1 year ago

@froemra aside the previous question - is there any network security software active in your network?

Well sure, there are Firewalls etc., but nothing local on my Laptop that I know of. A college upgraded using the same Configuration without Problems, so there has to be something with my local configuration ...

HenriWahl commented 1 year ago

@froemra are the proxy variables set as well on the Windows machines of your colleague?

froemra commented 1 year ago

@froemra are the proxy variables set as well on the Windows machines of your colleague?

I tried myself and got it running now! I added the Adress of Altermanager to the NO_PROXY System-Environment Variable and it is working... But the Usage of Proxy is still not enabled in Nagstamon. It seems the PROXY is used if these System-Variables are defined, no matter what ...

That beaviour definately changed from V3.10.

HenriWahl commented 1 year ago

@froemra this is really strange. I fear the Alertmanager code handles it a little bit differently due to the fact it is not derived from Nagios behaviour.

@stearz do you have any idea?