Tag Archives: websocket error

[Solved] websocket error in Linux service: / lib64 / libc. So. 6: version ` glibc_2.17‘ not found

1.Error reporting
after the websocket service is installed on the server,
when viewing the log, the following error messages are found:
/lib64/libc. So. 6: version ` glibc_ 2.17’ not found (required by ./node)

It shows that the version of a plug-in in the Lib library does not exist

2.Solution
1. View the glibc version available in the system

// Use the strings command to view
strings /lib64/libc.so.6 |grep GLIBC_
// View the results as follows.
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_PRIVATE

As can be seen from the figure, there is no glibc_ Version 2.17 of glibc library, so you need to download a newer version of glibc library.

2. Download a new version of glibc library
https://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
Or through

wget https://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz
# Unpack the tarball
tar -xvf glibc-2.17.tar.gz

3. Compile and install

# 1. Go to the glibc-2.17 directory
cd glibc-2.17
# 2. Create the build directory
mkdir build
# 3. Go into the build directory
cd build
# 4, execute . /configure
... /configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
# 5. Install
make && make install

4. View shared libraries

ls -l /lib64/libc.so.6
=====================
// You can see that the soft link has been created
lrwxrwxrwx. 1 root root 12 Jan 13 01:49 /lib64/libc.so.6 -> libc-2.17.so

5. Review the glibc version in the system again

[root@localhost ~]# strings /lib64/libc.so.6 |grep GLIBC_
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
GLIBC_PRIVATE

It can be found that it is the latest version

6. Check the log again and find that the original error has been solved ~

[Solved] websocket: the client is not using the websocket protocol: ‘upgrade’ token not found in ‘Connection’ head

Error analysis

websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' head

WebSocketThis problem occurs when the reverse proxy or load balancer is not delivering the request correctly.

solution

Nginx plus the following analysis

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade

Apache plus the following analysis

 <Location /ws>
     ProxyPass ws://localhost:8000
     ProxyPassReverse ws://localhost:8000/
 </Location>