WebSocket Connection Failed

  • Last update:  2023-10-26
  • Phenomenon

    (1) The Load, Memory Utilization, and CPU Utilization parameters appear empty on the Load Monitor tab page after you log in to the FineBI system as admin and choose System Management > Intelligent O&M > Load Management.

    A message is displayed in the upper part, prompting you to open related ports that may be closed when Socket is not connected (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 after you log in to the FineBI as 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 is displayed in the upper part, prompting you to open related ports that may be closed when Socket is not connected (causing abnormalities such as system-access user statistics faults).

    (3) There are 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 message is displayed in the upper part, prompting you to open related ports that may be closed when Socket is not connected (causing conflicts due to synchronous editing by multiple users).

    (4) Real-time forcible logout fails, directly displaying the login page without framework popup, as shown in the following figure.

    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.

     WebSocket 图1.png

    (5) No 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 that you select Keep Logged In when logging in to the FineBI system. If you log in at 3 o'clock and perform an operation on the platform at 3:20 when the login timeout interval is set to 1 hour

    • 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 WebSocket is not connected (in which case you cannot obtain a new token).

    If you select Keep Logged In when logging in to the FineBI system, 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.

    iconNote 1:
    Such problem will not occur for JAR generated at and after 2020-08-31 when WebSocket is not connected.
    iconNote 2:
    Such problem can be solved by using the plugin for refreshing the login status if you cannot open extra ports or use Socket for JAR generated at and after 2020-08-31.

    A message is displayed in the upper part after you log in to the platform as admin, prompting you to open related ports that may be closed when Socket is not connected (causing failure to keep the login status during using).

    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 at and after 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 FineBI system as admin, choose System Management > Intelligent O&M > Load Management, enable Real-time Load, and check whether the Load, Memory Utilization, and CPU Utilization parameters appear empty. 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.

    1.png

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

    2.png

    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 Whether the Port Is Occupied

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

    Port
    JAR PackageParameterDefault Value

    WebSocket port

    /

    WebSocketConfig.port

    ["48888", "49888"]

    WebSocket forwarding port

    Generated before 2019-11-08

    WebSocketConfig.requestPort

    48889

    Generated at and after 2019-11-08

    WebSocketConfig.requestPorts

    48889

    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:
    Note 2: Super admin can view and modify the WebSocket port by referring to FINE_CONF_ENTITY Visual Configuration, but cannot view or modify the WebSocket forwarding port through this plugin.

    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 WebSocket Forwarding Port be greater than the number of nodes in the cluster. In this case, each node can be assigned with an available port, preventing server startup failure due to port occupation.

    (3) You are advised to set WebSocket Port to multiple values for port backup, preventing port occupation 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 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 to take 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 Pathunder System Management > System Setting > General > HTTPS Setting in the FineBI system can only be set to an absolute path.

    (2) You cannot configure HTTPS for the FineBI installed through EXE and designer.

    (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.

    WebSocket 图4.png

    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, WebSocket connection will be considered as failed.

    Checking Errors Reported on the Console

    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.

    Clearing Browser Caches

    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.

    PortJAR PackageParameterDefault Value

    WebSocket port

    /

    WebSocketConfig.port

    ["48888", "49888"]

    WebSocket forwarding port

    Generated before 2019-11-08

    WebSocketConfig.requestPort

    48889

    Generated at and after 2019-11-08

    WebSocketConfig.requestPorts

    48889

    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.

    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 48888 or 49888 and forwarding port number is 48889.

    During forwarding through Nginx, you can use any available port on the Nginx server to forward port 8080 of Tomcat, and port 48889 on the Nginx server to forward port 48888 of the project.

     WebSocket 图6.png

    iconNote 1:

    When you use port 48889 on the Nginx server to forward port 48888 of the project, ensure that the access from the computer to port 48889 on the Nginx server and from the Nginx server to port 48888 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.


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

     WebSocket 图7.png

    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.

    Note

    (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.

    附件列表


    主题: System Management
    • 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