Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebTerminal Disconnect after a few secounds #135

Open
zhaancampbell opened this issue Apr 22, 2020 · 9 comments
Open

WebTerminal Disconnect after a few secounds #135

zhaancampbell opened this issue Apr 22, 2020 · 9 comments

Comments

@zhaancampbell
Copy link

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

@nikitaeverywhere
Copy link
Member

nikitaeverywhere commented Apr 22, 2020

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.

@zhaancampbell
Copy link
Author

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.

@nikitaeverywhere
Copy link
Member

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.

@zhaancampbell
Copy link
Author

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
Copy link
Author

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)

@nikitaeverywhere
Copy link
Member

nikitaeverywhere commented Apr 23, 2020

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!

@zhaancampbell
Copy link
Author

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.

@nikitaeverywhere
Copy link
Member

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

@zhaancampbell
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants