反馈已提交

网络繁忙

You are viewing 5.1 help doc. More details are displayed in the latest help doc.

WebSocket Connection Failed

  • Recent Updates: December 06, 2022
  • Ⅰ. WebSocket connection failure phenomenon

    1) The administrator logs in to the Decision-making System, clicks "Manage > Intelligent Operations> Memory Management", and the two graphs "Memory Utilization" and "CPU Utilization" under the "Memory Alert" tab are blank.

    A prompt message pops up at the top: Socket is not connected, real-time memory display is abnormal, and the relevant port may not be open

    2) The administrator logs in to the Decision-making System, clicks "Manage> Intelligent Operations > Platform Log", and the "The current number of online users" under the "Access Statistics" Tab cannot be displayed correctly. Template execution process statistics such as memory and time consumption cannot be recorded.

    A prompt message pops up at the top: Socket is not connected, system access user statistics are abnormal, please open the relevant port, the relevant port may not be open

    3) The user clicks "Manage > Data Connection" to enter the data connection editing interface. There may be multiple people editing the same data connection at the same time.

    A prompt message pops up at the top: Socket is not connected, there may be conflicts caused by multiple people editing at the same time, and the relevant ports may not be open

    4) Kick-out login is invalid and cannot be kicked out in real time. The login page is displayed in the frame, that is, it jumps directly to the login interface without jumping out of the frame. As shown below:

    Note: Scenarios for this problem: single sign-on kicking out, disabling users, changing user passwords, changing authentication methods, switching synchronous import, platform using users to disable users/turn on the restriction switch, replace Lic, e

    5) The user cannot receive the message pop-up window in the lower right corner and there is no message prompt at the small bell, but can click the small bell to enter the message panel to view.

    6) Login timed out, unable to get the correct token validity period

    When a user logs in to the data decision system, "Keep logged in" is not checked. The login timeout is set to 1 hour. If the user logs in at 3:00, the operation is performed on the platform at 3:20.

    • The WebSocket connection is successful, and it should be kicked out at 4:20 (in the case of no operation on the platform).

    • If the WebSocket is not connected, the token cannot be obtained again, and it will be kicked out at 4 o'clock.

    When users log in to the data decision system, check "Keep logged in", and by default they will be kicked out after 14 days of inactivity.

    Note 1: For 2020-08-31 and later JARs, this phenomenon does not occur when Websocket is not connected.

    Note 2: For JARs before 2020-08-31, if additional ports cannot be opened or sockets are not allowed, you can install the " Refresh Login Status Plugin " to solve this problem.

    After the administrator logs in to the platform, a prompt message will pop up at the top: Socket is not connected, the login state cannot be maintained during use, and the relevant ports may not be open

    Every time the platform page is refreshed, a prompt will pop up. Refreshing refers to a browser refresh such as F5.

    Note: For JARs of 2020-08-31 and later, when the Websocket is not connected, there is no such prompt.

    7) There is no success or failure prompt when installing or deleting a plug-in in the plug-in store.

    Ⅱ. Confirm that the Websocket connection fails

    The user can confirm the failure of the Websocket connection in three ways.

    1) The administrator logs in to the data decision system, and checks the two pictures of "Manage > Intelligent Operations > Memory Management > Real-time Memory". If it is not displayed, it is not connected.

    2022-07-13_16-12-47.png

    2) F12 to open the console, enter "Dec.socket.connected", if it is "false", it means not connected.

    2022-07-13_16-14-09.png

    3) F12 opens the console, if there is an error about the Socket port such as 48889 (the default port number of the proxy server), it means that the connection is not successful.

    2022-07-13_16-15-31.png

    Ⅲ. Direct access to the project connection failed

    Applicable scenarios: The project is not accessed through load balancing, the project is directly accessed, and the websocket connection fails

    Please check and optimize according to the following.

    1. Confirm whether the port is occupied

    Super administrators can view the WebSocket port/forwarding port through the " fine_conf_entity Visual Configuration Plugin ".

    port

    JAR package

    parameter name

    parameter default value

    Websocket port

    -

    WebSocketConfig.port

    ["48888",   "49888"]

    Websocket forwarding port

    Before 2019-11-08

    WebSocketConfig.requestPort

    48889

    2019-11-08 and after

    WebSocketConfig.requestPorts

    48889

    Check whether the port /forwarding port is occupied by other processes. If it is occupied and the process is important, please replace it with another available port.

    Super administrators can modify the WebSocket port through the "fine_conf_entity visual configuration plugin". The settings take effect after restarting the server.

    Note: For the method of modifying table field values in FineDB database, please refer to Modification of Common Table Fields in FineDB .


    2. Confirm whether the port configuration does not take effect

    There are some precautions for setting the WebSocket port/forwarding port, please confirm whether the port number is set correctly:

    1) The range of the port number can be set: 1024~65535. If there are multiple values, the setting format is: [port number 1, port number 2, port number 3].

    2) It is recommended that the value of "WebSocket forwarding port" be greater than the number of cluster nodes, to ensure that each node will select the currently available port, and the server will not fail to start due to port occupation.

    3) It is recommended to set multiple values for "WebSocket port" as a backup to prevent multiple projects from being deployed on one server and the port is occupied.

    4) Do not set the port number as the server remote connection port 3389.

    5) If the project and nginx load balancing are in the same environment, do not repeatedly set a port number to be both a WebSocket port and a WebSocket forwarding port.

    6) If there are spaces after the fields of WebSocketConfig.port, WebSocketConfig.requestPort, and WebSocketConfig.requestPorts, the configuration will not take effect.

    7) If the case of WebSocketConfig.port, WebSocketConfig.requestPort, and WebSocketConfig.requestPorts is wrong, the configuration will not take effect.

    8) WebSocketConfig.requestPort and WebSocketConfig.requestPorts cannot exist in the fine_conf_entity table at the same time, otherwise an error will occur.


    3. Confirm whether the port is open to the outside world

    Troubleshooting steps:

    If it is determined that the WebSocket port/forwarding port is not occupied by other processes, please confirm whether the set port is open to the outside world.

    • linux: nc -vz -w 2 [ip] [port]

    • windows: telnet server ip websocket port

    Solution:

    1) Open the firewall port limit of the server.

    2) Enable the security group port restriction of Alibaba Cloud/HUAWEI CLOUD/Microsoft Cloud Server.

    3) Disable Alibaba Cloud's health check.


    4. Confirm whether it is an HTTPS environment

    The https environment of certificate configuration needs to configure websocket, refer to the document: HTTPS environment configuration WebSocket

    1) Key path:

    • Absolute path/relative path in server.xml in Tomcat configuration can be used.

    • The "SSL key path" in "System > General > https Settings" in the Decision-making System only supports absolute paths.

    2) The designer does not support configuring HTTPS, and the BI installed by EXE does not support configuring HTTPS.

    3) If Nginx is configured with https, then do not configure it in the "System> General > https" settings.

    4) The project is configured with https, and both http and https can access the project. However, websocket cannot support both, the https connection is normal, and the http connection fails.


    5. JAR package conflicts

    Problem Description:

    When there is a conflict between the JAR packages under the project, the server deployment wizard will appear, prompting "WebSocket port exception".

    Solution:

    Delete the conflicting JAR package, kill the process of the project, wait for 2 minutes after the port is released, and then restart the project.

    If Apache Impala is downloaded from the official website, do not put slf4j-log4j12-1.5.11.jar and slf4j-api-1.5.11.jar under % FineReport%\webapps\webroot\WEB-INF\lib , otherwise it will create Websoket port exception.


    6. Check if the server request is too slow

    WebSocket connection time code is set to 20 seconds. If the request time exceeds, it will directly determine that the WebSocket connection fails.


    7. View console errors

    F12 opens the console. Common WebSocket errors and possible reasons are as follows:

    • net::ERR_SSL_PROTOCOL_ERROR: The project is      configured with https, but the websocket is not configured.

    • net::ERR_EMPTY_RESPONCE: The server is configured      with https, but accessed via http.

    • net::ERR_CONNECTION_REFUSED: The port is not open or      the port is not listening.

    • net::ERR_CONECTION_TIMEOUT: Network problem, domain      name resolution is slow.


    8. Browser cache

    Problem description: 

    Different browsers on the same computer access the project, some websocket connections succeed, and some connections fail.

    Solution: 

    Clear the browser cache.

    Ⅳ. Failed to access engineering connection through load balancing

    Applicable scenario: Accessing the project through load balancing, the websocket connection fails

    Please check and optimize according to the following.

    1. Confirm whether the access websocket on the server is connected normally

    Use localhost to access the project on the server and confirm whether the websocket is connected normally.

    1) If the websocket is connected, go to the troubleshooting steps in Section 4.2 .

    2) If the websocket connection fails, please confirm whether the websocket port is occupied by other processes .

    Super administrators can view the WebSocket port/forwarding port through the " fine_conf_entity Visual Configuration Plugin ".

    port

    JAR package

    parameter name

    parameter default value

    Websocket port

    -

    WebSocketConfig.port

    ["48888",   "49888"]

    Websocket forwarding port

    Before 2019-11-08

    WebSocketConfig.requestPort

    48889

    2019-11-08 and after

    WebSocketConfig.requestPorts

    48889

    Check whether the port/forwarding port is occupied by other processes. If it is occupied and the process is important, please replace it with another available port.

    Super administrators can modify the WebSocket port through the "fine_conf_entity visual configuration plugin". The settings take effect after restarting the server.

    Note: For the method of modifying table field values in FineDB database, please refer to Modification of Common Table Fields in FineDB .


    2. Confirm whether the connection is normal when accessing the project directly without going through the load server

    Without going through the load balancing server, the third-party computer directly accesses the project to confirm whether the websocket connection is normal.

    1) If the direct access to the project websocket connection fails, use the content in Chapter 3 of this article for troubleshooting.

    2) If the direct access project websocket connection is normal, the project is accessed through the load server, and the websocket connection fails, it can be confirmed that the load server configuration problem is the problem, and the load configuration needs to be checked .


    3. Confirm whether the listening port on the load balancing server is normal

    1) Confirm whether the two ports used to monitor the container port and the websocket port on the load balancing server are normal and whether they are occupied by other processes.

    2) Make sure to access the computer > load balancing server > project websocket, the relevant ports on this road are unblocked.


    4. Confirm whether the load server forwarding configuration is correct

    For example, a BI project uses nginx for forwarding mapping.

    The default tomcat port is 8080, the default websocket port is 48888, 49888, and the default websocket forwarding port is 48889

    When forwarding with nginx, you can use any free port on the nginx server to forward port 8080 of tomcat, and use port 48889 on the nginx server to forward port 48888 of the project

    Reference document: Nginx.conf configuration manual

    Note 1: nginx uses 48889 to forward the project's 48888. It is necessary to ensure that the access computer to nginx's 48889 is connected, and the nginx server to the project server's 48888 is connected.

    The hardware load such as F5 is the same as that of nginx, and the container port and websocket port must be forwarded.

    Note 2: When nginx forwards the websocket port, ip_hash needs to be configured, as shown in the following figure:

    5. Configuration Restrictions Related to Load Balancing

    Attention should be paid to all load balancing configurations: do not enable health detection, whether there is a security group policy that causes the port not to be opened, and session retention needs to be enabled.

    1) Open the firewall port limit of the server.

    2) Enable the security group port restriction of Alibaba Cloud/HUAWEI CLOUD/Microsoft Cloud Server.

    3) Disable Alibaba Cloud's health check.

    4) F5 hardware load needs to enable session persistence.

    Ⅴ. Precautions

    1) When restarting the project, you need to kill the process running under the project, wait for 2 minutes after the port is released, and then restart the project, otherwise the restart may fail.

    2) Through the above investigation and modification, after the websocket can be connected normally, only the following data such as memory and CPU display, platform log and so on can be obtained. Historical data cannot be recovered.

    Attachment List


    Theme: Admin Guide
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    售前咨询电话

    400-811-8890转1

    在线技术支持

    在线QQ:800049425

    热线电话:400-811-8890转2

    总裁办24H投诉

    热线电话:173-1278-1526

    文 档反 馈

    鼠标选中内容,快速反馈问题

    鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。

    不再提示

    10s后关闭