1. 报错
[17:32:59.765] > Waiting for server log...
[17:32:59.801] > Waiting for server log...
[17:32:59.831] >
> *
> * Visual Studio Code Server
> *
> * By using the software, you agree to
> * the Visual Studio Code Server License Terms (https://aka.ms/vscode-server-lice
> ense) and
> * the Microsoft Privacy Statement (https://privacy.microsoft.com/en-US/privacyst
> tatement).
> *
>
[17:32:59.848] > Server did not start successfully. Full server log at /root/.vscode-server/.0504
> 47486b6df5eb8d44b2ecd70ea3bdf775fd937.log >>>
> Warning: Missing GLIBCXX >= 3.4.25! from /usr/lib64/libstdc++.so.6.0.19
> Warning: Missing GLIBC >= 2.28! from /usr/lib64/libc-2.17.so
> Error: Missing required dependencies. Please refer to our FAQ https://aka.ms/vsc
> code-remote/faq/old-linux for additional information.
> <<< End of server log
上面的报错信息都是引用的网络,自己的报错信息,等到解决后,没有了。
2. 原因
是vscode官方升级导致对之前的glibc的一些库不支持了:
3. 解决方案
3.1 升级库
这里升级库比较麻烦,有root权限,可以直接yum install升级(也可以直接在服务器里面搜一下,看看有没有新的库,cp过来),或者修改库的引用路径。
通过任意ssh客户端登陆服务器,会发现有个/home/用户名/.vscode-server目录,vscode-server下面会有一个bin,bin下面有个名字奇怪的文件夹,文件夹里有一个GLIBC版本不匹配的node:
[swmore@psn009 ~]$ ls .vscode-server/
bin
[swmore@psn009 ~]$ ls .vscode-server/bin/
78a4c91400152c0f27ba4d363eb56d2835f9903a
[swmore@psn009 ~]$ ls .vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/
bin extensions LICENSE node node_modules out package.json product.json server.sh
[swmore@psn009 ~]$ ldd .vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node
.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by .vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node)
.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by .vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node)
.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.5' not found (required by .vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node)
.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by .vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node)
.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by .vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node)
.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node: /lib64/libc.so.6: version `GLIBC_2.16' not found (required by .vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node)
.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by .vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/node)
linux-vdso.so.1 => (0x00007fffc6fff000)
libdl.so.2 => /lib64/libdl.so.2 (0x000000366fe00000)
librt.so.1 => /lib64/librt.so.1 (0x0000003670600000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003675e00000)
libm.so.6 => /lib64/libm.so.6 (0x0000003670200000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003673e00000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x000000366fa00000)
libc.so.6 => /lib64/libc.so.6 (0x000000366f600000)
/lib64/ld-linux-x86-64.so.2 (0x000000366ee00000)
[swmore@psn009 ~]$
确定glibc版本和查找新的glibc版本:
strings /usr/lib64/libstdc++.so.6 |grep GLIBCXX*
ls -l /usr/lib64/libstdc++.so*
lrwxrwxrwx. 1 root root 19 5月 6 14:48 /usr/lib64/libstdc++.so.6 -> libstdc++.so.6.0.19
-rwxr-xr-x. 1 root root 995840 9月 30 2020 /usr/lib64/libstdc++.so.6.0.19
find / -name libstdc++.so.6* ##这里会返回不同版本的libstdc,找到高版本的,然后替换/usr/lib64/libstdc++.so.6 即可
strings /usr/lib64/libstdc++.so.6 |grep GLIBCXX* #再次确认版本
对node文件进行patch,这里用了我在服务器上翻出来的新版本glibc和patchelf:
~/anaconda3/bin/patchelf --set-rpath /usr/sw-cluster/apps/lib/glibc-2.17/lib64/:/usr/sw-cluster/apps/Anaconda/anaconda3/lib/ --set-interpreter /usr/sw-cluster/apps/lib/glibc-2.17/lib64/ld-linux-x86-64.so.2 node
3.2 vscode换成低版本
vscode 1.85.2版本的即可:https://code.visualstudio.com/updates/v1_85
关闭Vscode自动更新:Vscode默认是自动更新的,所以需要手动关闭防止再次出先问题。
参考资料
vscode 无法远程连接waiting the server log
vscode ssh sw服务器
Vscode连接remote ssh 报错,The VS Code Server failed to start,vscode1.86.0更新后出现
conda环境下“/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20‘ not found”问题解决