webterminal icon indicating copy to clipboard operation
webterminal copied to clipboard

WebTerminal Disconnect after a few secounds

Open zhaancampbell opened this issue 5 years ago • 9 comments

Hi,

I can connect to the WebTerminal BUT after a few seconds it seems like I get disconnected and See You! is displayed. I can only execute about 3/4 commands before it disconnects.

I Installed CWTv4.9.3 on ache for UNIX (Oracle Solaris for x86-64) 2018.1.2 (Build 309_5_19235U) Thu Aug 22 2019 14:50:54 EDT Am running it via a Apache CSP install on Solaris intel. CSP Version Version: | 2018.1.0.184.0 Gateway Build: | 1801.1631h and Apache version Apache/2.4.38

the only thing in the logfiles that I could see is in the CSP.log BUT that does now happen when this issue occur. A Connection between the CSP Gateway and Cache has been found to be closed (possibly as a result of an intermediary, such as a firewall, timing-out the TCP session) The firewall in between is set dot timeout connections after 300 secs (and changed to 54000 secs now)

Could you please assist!

P.S When the CWT is access via the webserver on the DB on Port 57772 we do not experience the issue. Thanks

zhaancampbell avatar Apr 22 '20 12:04 zhaancampbell

Hello! Thank you for asking!

I can only execute about 3/4 commands before it disconnects.

I've such issues before, and as far as I can remember they are caused by WebSocket connection being closed. Using e.g. Chrome Dev Tools you can ensure that it is exactly the case (switch to WS filter and observe it is closed, having no ending data frame (error/close reason) sent by WebTerminal). As far as I remember, it was caused by some load balancer dropping the WebSocket connection.

Hence, if your firewall have no specific configuration for long-lasting connections like WebSocket than it's a trouble. WebTerminal's session lives inside the WebSocket session, and once it's closed the session is terminated, making no sense to reconnect from the WebTerminal's perspective.

If you'd find out the exact solution in your setup that would be awesome! But so far it seems like it's not a WebTerminal's issue itself.

nikitaeverywhere avatar Apr 22 '20 12:04 nikitaeverywhere

Hi, Our Firewall is set to allow long lasting connections between CSP gteway and database on port 1972. Should it also be between the client(browser) and the CSP server Port 443 in my case?

The Chrome Dev tools WS show the time as pending en then 20secs when it stops. then it is disconnected.

zhaancampbell avatar Apr 23 '20 05:04 zhaancampbell

Yes, what I meant is exactly the browser <-> server connection and everything in between which can timeout that connection. If the timeout is constant (20sec) in every case, it definitely means that something cuts the connection and it's not the system flakiness.

nikitaeverywhere avatar Apr 23 '20 07:04 nikitaeverywhere

Ok BUT why the same if I open a browser on the server console THUS no network connections between the client browser and the CSP server it still happens, eliminating everything between the client and the CSP server it is still happening.

I have also entered a command repeatedly giving results and after 20secs of the total connection the next enter "See You!" meaning for me not a timeout of inactivity as I have kept the connection active.

Then this points me to what ever is happening between the CSP server and the DB server. Looking at that. I have a Application the takes very long (about 2mins) and when I call that application via the CSP, I can run that with success meaning to me that whatever is limiting long connections can accommodate at least 2 mins.

Sorry for being so buggy BUT I have to get this working.

zhaancampbell avatar Apr 23 '20 08:04 zhaancampbell

I have also did a telnet on port 1972 from the CSP server to the DB server and that stayed alive for longer that a minute (or rather I disconnected manually)

zhaancampbell avatar Apr 23 '20 08:04 zhaancampbell

I have also entered a command repeatedly giving results and after 20secs of the total connection the next enter "See You!" meaning for me not a timeout of inactivity as I have kept the connection active.

Does it happen when you open WebTerminal and just wait for 20s, not executing any commands? (this is important) If it does, then it sounds like a networking problem breaking the (WebSocket! always alive) connection. If not, then it's a problem with WebTerminal. Note that other applications you're referring to, where connections last for 2m+, may not use WebSocket at all, while the usual case we've seen is load balancers not supporting WebSocket well (just wondering whether it's the same case).

Ok BUT why the same if I open a browser on the server console THUS no network connections between the client browser and the CSP server it still happens, eliminating everything between the client and the CSP server it is still happening.

Did you remote desktop to the machine, opening a local browser? Does localhost:xxxxx/terminal/ work in this case? If your machine is available by its IP address in the network, can you try connecting to it xxx.xxx.xxx.xxx:yyyyy/terminal/? Does it still breaks the connection?

In case connecting to localhost and to bare IP works fine you need to investigate your firewall/load balancer which exposes the machine to an outer network (or connecting from where you have a problem)

Thank you for providing this info!

nikitaeverywhere avatar Apr 23 '20 08:04 nikitaeverywhere

Yes it still happens when you leave the terminal for 20secs BUT will only show is you enter something.

It is a solaris machine BUT yes from the console. Connecting to IP makes no difference. I also created some ssh tunnels in different ways to connect BUT all gives the same problem.

At this stage to confirm the only way it words is via the DB's local webserver on port57772. No other way is working.

zhaancampbell avatar Apr 23 '20 09:04 zhaancampbell

Yes it still happens when you leave the terminal for 20secs BUT will only show is you enter something.

Aha. So you wait for 20-40s - nothing happens, and then once you enter something it responds with "See you!"? Then it sounds like a WebTerminal problem... Did you try to import it once again? (there were rare cases when it magically helped)

Thanks for the information. Now let's think how can I reproduce this problem... Maybe you have some "testing server"? You can contact me via nikita.tk

nikitaeverywhere avatar Apr 23 '20 09:04 nikitaeverywhere

I have done a reompier as well as a recompile with only "c" compile flag, Although now the initial connection is A LOT FASTER, is still happens after about 20 secs. with commands entered and without.

zhaancampbell avatar Apr 23 '20 09:04 zhaancampbell