-
I have MC installed in an Oracle A1 VPS as per official documentation with mongodb and nginx as reverse proxy (I only serve MPS directly from MC). My problem is that almost all agents momentarily lose connection but they don't go offline according to logs. It is random (not all agents go down at the same time), happens more on linux agents than windows and for that 1-2 seconds they appear grey and all action buttons (desktop/terminal/files) disappear and then come back. If I happen to be connected to agent's desktop/terminal/files the session might freeze for a second and continue like it didn't happen but it won't disconnect me. Anyone having a similar issue? How should I debug this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
A few things here. On Windows, you can run the agent like this:
This will run the agent from the command line and you will see the agent connecting, retrying, etc. This can help with debug. Also, the agent will connect to the server using a long standing websocket connection. Some firewalls, HTTP proxies, load balances, reverse-proxies, etc do not like idle connections and will automatically close them. To fix this, try one of these lines in the settings section of the config.json:
The goal with these lines is to fix your problem while generating the least amount of traffic as possible. So, if you take a stopwatch and see agents reconnecting every 3 minutes, put a "agentpong" at the 2 minute 50 second mark and see if it fixes it. Only use "agentping" if required. Do not use a "ping" and a "pong" to the same target a the same time, it's just a waste. Let me know if that works, |
Beta Was this translation helpful? Give feedback.
-
I tried |
Beta Was this translation helpful? Give feedback.
A few things here. On Windows, you can run the agent like this:
This will run the agent from the command line and you will see the agent connecting, retrying, etc. This can help with debug. Also, the agent will connect to the server using a long standing websocket connection. Some firewalls, HTTP proxies, load balances, reverse-proxies, etc do not like idle connections and will automatically close them. To fix this, try one of these lines in the settings section of the config.json: