stf icon indicating copy to clipboard operation
stf copied to clipboard

Socket connection was lost

Open David-gulu opened this issue 8 years ago • 5 comments

Hi, there.

We deployed Openstf in production mode(APP role, database role, proxy role on one server and provider role on another server). When tried to install an app of small size(20MB), everything worked out fine. Yet when tried installing apks of relatively bigger sizes(100MB above), the progress bar was stuck there whereas the apk activity was launched successfully in the webpage (the following figure).

1

Worse still, sometimes the following situation came up as well(the following figure). After stucking for a period of time, the apk activity was launched successfully in the webpage. In addition at the same time a hint came up to inform the socket connection was lost.

2

This was not a problem on a specific device. There was no problem when checking logs of the provider, triproxy, processor and the stf doctor. In case the logs are useful, the stf doctor logs of the provider are given as follow:

2018-03-13T07:11:53.582Z INF/cli:doctor 133 [] OS Arch: x64 2018-03-13T07:11:53.583Z INF/cli:doctor 133 [] OS Platform: linux 2018-03-13T07:11:53.584Z INF/cli:doctor 133 [] OS Platform: 3.10.0-514.el7.x86_64 2018-03-13T07:11:53.584Z INF/cli:doctor 133 [] Using Node 6.11.2 2018-03-13T07:11:53.618Z INF/cli:doctor 133 [] Using ZeroMQ 4.1.4 2018-03-13T07:11:53.632Z ERR/cli:doctor 133 [] RethinkDB is not installed (rethinkdb is missing) 2018-03-13T07:11:53.632Z ERR/cli:doctor 133 [] ProtoBuf is not installed (protoc is missing) 2018-03-13T07:11:53.632Z ERR/cli:doctor 133 [] ADB is not installed (adb is missing) 2018-03-13T07:11:54.002Z INF/cli:doctor 133 [*] Using GraphicsMagick 1.3.23

I want to know under what situation will trigger the prompting of "socket connection was lost" and are there any advices to help solve this problem?

Thanks a lot.

yours, David

David-gulu avatar Mar 13 '18 07:03 David-gulu

If you're used the reference nginx config, could you try moving the following options directly under the http context, and take them out of the location?

client_max_body_size 1024m;
client_body_buffer_size 128k;

The socket disconnecting sounds like a separate issue, perhaps a timeout. Is your client a Windows machine? Is your STF running on port 80?

sorccu avatar Mar 14 '18 04:03 sorccu

Thanks for your reply @sorccu. Our client is a Windows machine, and the stf running on 7100. Through our research, the behavior of "socket connection was lost" seems to be clear. When it comes to separation mode, the performance of the client as well as the browser itself truly becomes the bottleneck. When pushing large apks, Firefox 55 and above will stuck for a while. When stuck happens, the browser itself will not response any operation. If the performance of the client is relatively poor, then the stuck period is longer than it should be, which may be regarded as connection lost at the STF server side. Testing shows that Chrome 34 is a good choice.

The progress bar still was stuck there when using Chrome 34, yet socket connection lost never happened again, and the apk activity was launched successfully. We will try to figure out why progress bar was stuck and reply.

David-gulu avatar Mar 14 '18 05:03 David-gulu

Originally, a long long time ago, we noticed in our internal corporate network that something was causing Windows to drop persistent connections after a while if "default" ports like 80 or 8080 were used. We solved that by switching everything to HTTPS and 443. I was wondering if you may be experiencing a similar issue here.

Also, since you're running on port 7100, I assume you're using stf local? Unfortunately, the reverse proxy we use for development, poorxy (short for poor proxy), is known to have mysterious issues. Sometimes uploads may fail or other weird things can happen. For a serious production deployment, I would suggest following the deployment guide, or at least replacing poorxy with nginx, which usually fixes all upload related issues.

sorccu avatar Mar 14 '18 06:03 sorccu

Thanks for your reply @sorccu. We will try your advices. We noticed poorxy when investigating stf local mode. Currently we are not using stf local. we are now using multiple docker containers to run each stf service individually and using nginx for url mappings. We just use the same port 7100 with nothing more than that.

David-gulu avatar Mar 14 '18 06:03 David-gulu

encountered such problem again... reopen and seek for help

David-gulu avatar Jul 04 '18 08:07 David-gulu