Page 1 of 1

[SOLVED] DISCONNECTED stations + solution

Published: October 21, 2019 - 6:56 PM
by erickeke
Hi,

I had most of my machines disconnected.

This can happen if there's more than a 5-minute time difference between the client and server times.

In my case, that wasn't the problem.

Looking at my machines with TCPVIEW (from Sysinternals), I noticed they were trying to use the proxy.

I saw a post from sfonteneau saying that the WebSocket library sometimes insists on using the proxy.

On my machines, I had defined the environment variables http_proxy, https_proxy, and no_proxy for software like Git, npm, and other Linux-based tools.

However, when I looked at the code, I realized that the library couldn't read no_proxy for anything that was a subdomain: e.g., .mydomain.com.

So I updated my environment variable on all my machines by adding the FQDN of my server, wapt.mydomain.com: problem solved!

I only have one remaining issue, but I'm waiting to see if the procedure I started tonight will resolve it:

the Python service on my WAPT server is running at 99% CPU usage, and I'm getting several messages:
WARNING Invalid session 917a29931507404db3d67aad566bfb38.

The agents are up to date; I hope it's related to my proxy problem. More news tomorrow.

Detail for the Websocket library:

In C:\Program Files (x86)\wapt\lib\site-packages\websocket\_url.py:

The following function does not support subdomain verification (.mydomain.com)
def _is_no_proxy_host(hostname, no_proxy):
if not no_proxy:
v = os.environ.get("no_proxy", "").replace(" ", "")
no_proxy = v.split(",")
if not no_proxy:
no_proxy = DEFAULT_NO_PROXY_HOST

if hostname in no_proxy:
return True
elif _is_ip_address(hostname):
return any([_is_address_in_network(hostname, subnet) for subnet in no_proxy if _is_subnet_address(subnet)])

return False

Re: DISCONNECTED stations + solution

Published: October 22, 2019 - 8:55 AM
by dcardon
Hello Erickeke,
erickeke wrote: Oct 21, 2019 - 6:56 PM Most of my machines were disconnected.

It's worth noting that this can happen if there's more than a 5-minute time difference between the client and server times.

In my case, that wasn't the problem.

Looking at my machines with TCPVIEW (from Sysinternals), I realized they were trying to use the proxy.

I saw a message from sfonteneau saying that the WebSocket library sometimes insisted on using the proxy.

On my machines, I had defined the environment variables http_proxy, https_proxy, and no_proxy for software like Git, npm, and other Linux-based applications.

However, upon examining the code, I realized that the library couldn't read the `no_proxy` directive for anything in a subdomain, e.g., `.mydomain.com`.

So, I updated my environment variable on all my machines, adding the FQDN of my server, `wapt.mydomain.com`: problem solved!

I only have one remaining issue, but I'm waiting to see if the procedure I started tonight will resolve it:

the Python service on my Wapt server is running at 99% CPU usage, and I'm getting several messages: `
WARNING Invalid session 917a29931507404db3d67aad566bfb38`.

The agents are up to date; I hope this is related to my proxy problem. More news tomorrow.

Detail for the Websocket library:

In C:\Program Files (x86)\wapt\lib\site-packages\websocket\_url.py:

The following function does not support subdomain verification (.mydomain.com)
def _is_no_proxy_host(hostname, no_proxy):
if not no_proxy:
v = os.environ.get("no_proxy", "").replace(" ", "")
no_proxy = v.split(",")
if not no_proxy:
no_proxy = DEFAULT_NO_PROXY_HOST

if hostname in no_proxy:
return True
elif _is_ip_address(hostname):
return any([_is_address_in_network(hostname, subnet) for subnet in no_proxy if _is_subnet_address(subnet)])

return False
Indeed, this is a bug in the WebSocket library. Do you really need to define these environment variables at the system level? The WAPT agent runs in the LocalSystem account, and if the variables are only defined in the user context, it shouldn't be a problem.

Sincerely,

Denis

Re: DISCONNECTED stations + solution

Published: October 22, 2019 - 10:09 AM
by erickeke
Thank you for your reply. I needed it for certain programming software to bypass the proxy, but now that I've found the workaround, no problem. :D

It was mainly to share for posterity. :)

Re: [SOLVED] DISCONNECTED stations + solution

Published: October 23, 2019 - 11:47 AM
by sfonteneau
Regarding your CPU usage problem at 99%,

see viewtopic.php?f=13&p=6617#p6617