WebSocket Connection Failure

  • Last update:May 23, 2024
  • Phenomenon

    1. The Memory Utilization and CPU Utilization parameters appear empty on the Load Surveillance tab page when you log in to the decision-making platform as the admin and choose System Management > Intelligent O&M > Load Management.

    A prompt message "The socket is not connected. Real-time memory display is abnormal. The related ports may not be open." is displayed in the upper part, causing abnormalities such as real-time memory display faults.

    2. The Current Number of Online Users parameter cannot be displayed correctly on the Access Statistics tab page when you log in to the decision-making platform as the admin and choose System Management > Intelligent O&M > Platform Log. Statistics such as memory and time consumption cannot be collected in the template execution process.

    A message "The socket is not connected. System user visit statistics are abnormal. The related ports may not be open." is displayed in the upper part, causing abnormalities such as system-access user statistics faults.

    3. There may be multiple users editing the same data connection at the same time when you choose System Management > Data Connection and enter the data connection editing page.

    A prompt message "The socket is not connected. Multiple users may be editing at the same time, causing conflicts. The related ports may not be open." is displayed in the upper part, causing conflicts due to synchronous editing by multiple users.

    4. Real-time forcible logout fails, directly displaying the login page without a framework popup.

    iconNote:
    This problem occurs in scenarios such as single forcible logout, user disabling, user password modification, authentication method modification, switchover to synchronous import, forbidding platform users from disabling users or enabling User Restriction, and license change.


    5. No prompt message window pops up in the lower right corner. No message is prompted by the bell icon, but messages can be viewed when you click the bell icon and enter the message panel.

    6. Login timed out, failing to obtain a correct token validity period.

    Assume you select Keep Logged In when logging in to the decision-making platform. If you log in at 3 o'clock and perform an operation on the platform at 3:20

    You will be forcibly logged out at 4:20 (no operation on the platform) when WebSocket is connected successfully.

    You will be forcibly logged out at 4 o'clock when no new token can be obtained because WebSocket is not connected.

    If you select Keep Logged In when logging in to the decision-making platform, you will be forcibly logged out after 14 days of inactivity by default. If you perform any actions on the platform within 14 days but cannot obtain a new token, you will still be forcibly logged out after 14 days.

    A prompt message "The socket is not connected. The login status cannot be kept during usage. The related ports may not be open." is displayed in the upper part after you log in to the platform as the admin (causing failure to keep the login status during usage).

    A prompt will also pop up every time you refresh the platform on the browser (by clicking hot keys such as F5).

    iconNote:
    No such prompt will pop up for JAR generated from 2020-08-31 when WebSocket is not connected.

    7. No success or failure prompt will pop up when you install or uninstall plugins in the plugin store.

    WebSocket Connection Failure Verification

    You can verify WebSocket connection failure through the following three methods:

    1. Log in to the decision-making platform as the admin, choose System Management > Intelligent O&M > Load Management, and check whether the Memory Utilization and CPU Utilization parameters appear empty on the Load Surveillance tab page. If so, WebSocket is not connected.

    2. Open the console by pressing F12 and enter Dec.socket.connected. If false is returned, WebSocket is not connected.

    3. Open the console by pressing F12. If an error message about Socket ports like 48889 (default for proxy servers) is displayed, WebSocket is not connected.

    Failure to Directly Access Projects

    iconNote:
    This problem occurs in scenarios such as WebSocket connection failure due to direct project access (not through load balancing).

    You need to troubleshoot and optimize in sequence as follows.

    Checking Port Occupancy

    Check the following parameters in the fine_conf_entity table, and view the WebSocket port and forwarding port.

    Port Number
    JAR PackageParameterDefault Parameter Value

    WebSocket port

    /

    WebSocketConfig.port

    ["38888", "39888"]

    WebSocket forwarding port

    Generated before 2019-11-08

    WebSocketConfig.requestPort

    38889

    Generated from 2019-11-08

    WebSocketConfig.requestPorts

    38889

    Check whether the port or forwarding port is occupied by other processes. If so (especially occupied by important processes), switch to another available port.

    Super admin can modify the WebSocket port and forwarding port by filling. The settings take effect after the server is restarted.

    iconNote:
    This problem occurs in scenarios such as WebSocket connection failure due to direct project access (not through load balancing).

    Checking Whether the Port Configuration Takes Effect

    The following lists some precautions for setting the WebSocket port and forwarding port. Check whether the port number has been set correctly according to these precautions.

    1. The port number ranges from 1024 to 65535. If there are multiple values, separate them with commas (,), for example, [Port number 1, Port number 2, Port number 3].

    2. It is recommended that the value of the WebSocket forwarding port be greater than the number of nodes in the cluster. In this case, each node can be assigned an available port, preventing server startup failure due to port occupancy.

    3. You are advised to set WebSocket Port to multiple values for port backup, preventing port occupancy when multiple projects are deployed on one server.

    4. Do not set the port number to 3389 (one for remote server connection).

    5. If a project and NGINX load balancing are deployed in the same environment, do not set the WebSocket port and WebSocket forwarding port to the same port number.

    6. If spaces are placed after WebSocketConfig.port, WebSocketConfig.requestPort, and WebSocketConfig.requestPorts, the configuration will not take effect.

    7. The WebSocketConfig.port, WebSocketConfig.requestPort, and WebSocketConfig.requestPorts parameters are case-sensitive. Wrong capitalization will prevent the configuration from taking effect.

    8. The WebSocketConfig.requestPort and WebSocketConfig.requestPorts parameters cannot exist simultaneously in the fine_conf_entity table. Otherwise, an error may occur.

    Checking Whether the Port Is Open Externally

    Troubleshooting:

    If you verify that the WebSocket port or forwarding port is not occupied by other processes, check whether the configured port is open externally.

    linux: nc -vz -w 2 [IP address] [Port number]

    windows: telnet server IP address websocket port number

    Solution:

    1. Enable firewall port restrictions on the server.

    2. Enable the port restriction on the security group of Alibaba Cloud, Huawei Cloud, and Microsoft Cloud servers.

    3. Disable Alibaba Cloud's health check.

    Checking Whether an HTTPS Environment Is Deployed

    WebSocket needs to be configured in the HTTPS environment for certificate configuration.

    1. Key path limitations are as follows:

    Both absolute and relative paths can be used in server.xml during Tomcat configuration.

    The value of SSL Key Path under System Management > System Setting > General > HTTPS Setting in the decision-making platform can only be set to an absolute path.

    2. You cannot configure HTTPS for the designer and FineBI installed through EXE does not support configuring HTTPS setup.

    3. If HTTPS is configured for NGINX, you do not need to configure HTTPS under System Management > System Setting > General > HTTPS Setting.

    4. You can access HTTPS-configured projects through both HTTP and HTTPS. However, WebSocket allows you to only access either through HTTPS or HTTP.

    JAR Package Conflict

    Problem:

    If a JAR package conflict occurs in the project, a server deployment wizard will pop up, indicating WebSocket port exception, as shown in the following figure.

    Solution:

    Remove the conflict-incurring JAR package, kill the process of the project, wait 2 minutes for the port to be released, and 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 in %FineReport%\webapps\webroot\WEB-INF\lib. Otherwise, WebSocket port exception may occur.

    Checking Whether the Server Request Responds Slowly

    If the request time exceeds 20 seconds set in the code as the WebSocket connection interval, the WebSocket connection will be considered failed.

    Check Console Errors Reported

    Open the console by pressing F12 and check WebSocket errors reported. Common WebSocket errors and possible causes are as follows:

    net::ERR_SSL_PROTOCOL_ERROR: The project is configured with HTTPS, but Websocket is not.

    net::ERR_EMPTY_RESPONSE: The server configured with HTTPS is accessed through HTTP.

    net::ERR_CONNECTION_REFUSED: The port is not open or being listened on.

    net::ERR_CONNECTION_TIMEOUT: The domain name is parsed slowly due to network faults.

    Browser Cache

    Problem: If the project is accessed on different browsers of the same computer, some WebSocket connections succeed and some fail.

    Solution: Clear browser caches.

    Connection Failure After Project Access through Load Balancing

    iconNote:

    This problem occurs in scenarios such as WebSocket connection failure after project access through load balancing.

    You need to troubleshoot and optimize in sequence as follows.

    Checking Whether WebSocket Connection is Normal Through Server Access

    Access the project on the server using localhost and check whether WebSocket is connected properly.

    1. If so, proceed to Section "Checking Whether Connection Is Proper Through Direct Project Access" for further troubleshooting.

    2. If not, check whether the WebSocket port is occupied by other processes.

    Super admin can check the WebSocket port and forwarding port by referring to FINE_CONF_ENTITY Visual Configuration.

    Port Number
    JAR PackageParameterDefault Parameter Value

    WebSocket port

    /

    WebSocketConfig.port

    ["38888", "39888"]

    WebSocket forwarding port

    Generated before 2019-11-08

    WebSocketConfig.requestPort

    38889

    Generated from 2019-11-08

    WebSocketConfig.requestPorts

    38889

    Check whether the port or forwarding port is occupied by other processes. If so (especially occupied by important processes), switch to another available port.

    Super admin can modify the WebSocket port through the FINE_CONF_ENTITY Visual Configuration plugin. The settings take effect after the server is restarted.

    iconNote:
    For details about modifying field values in tables of FineDB databases, see FINE_CONF_ENTITY Visual Configuration.

    Checking Whether Connection Is Proper Through Direct Project Access

    Check whether WebSocket connection is proper through direct project access on third-party computers without passing through the load balancing server.

    1. If not, proceed to section “Failure to Directly Access Projects” for further troubleshooting.

    2. If so, verify that WebSocket connection fails through project access using a load balancing server. In this case, the problem is caused by load balancing server configuration. As such, you need to check the load balancing configuration.

    Checking Whether Listening Ports on the Load Balancing Server Is Normal

    1. Check whether the two ports used to listen on container ports and WebSocket ports on the load balancing server are normal, for example, whether they are occupied by other processes.

    2. Check whether related ports during access to computers, load balancing servers, and project WebSocket are all unblocked.

    Checking Whether the Load Balancing Server Has Proper Forwarding Configuration

    For example, you can use NGINX to forward mappings for FineBI projects.

    The default Tomcat port number is 8080. The default WebSocket port number is 38888 or 39888 and the forwarding port number is 38889.

    During forwarding through NGINX, you can use any available port on the NGINX server to forward port 8080 of Tomcat, and port 38889 on the NGINX server to forward port 38888 of the project.

    iconNote:
    1. When you use port 38889 on the NGINX server to forward port 38888 of the project, ensure that the accesses from the computer to port 38889 on the NGINX server and from the NGINX server to port 38888 on the project server are all smooth.

    F5 hardware load balancing has the same usage principle as NGINX, requiring you to forward container ports and WebSocket ports.

    2. When forwarding the WebSocket port through NGINX, you need to configure ip_hash, as shown in the following figure.

    Limitations on Load Balancing Configuration

    When you configure load balancing, disable health check, configure no security group policies to avoid port closing, and enable session maintenance.

    1. Enable firewall port restrictions on the server.

    2. Enable the port restriction on the security group of Alibaba Cloud, Huawei Cloud, and Microsoft Cloud servers.

    3. Disable Alibaba Cloud's health check.

    4. F5 hardware load balancing requires you to enable session maintenance.

    Notes

    1. When restarting the project, kill the processes running under the project, wait 2 minutes for ports to be released, and then restart the project. Otherwise, restart may fail.

    2. After troubleshooting and modification in the previous steps, WebSocket is connected properly. In this case, you can obtain only post-connection data such as memory and CPU display and platform logs. Historical data cannot be recovered.

    Attachment List


    Theme: Decision-making Platform
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy