1. 報(bào)錯
[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
??上面的報(bào)錯信息都是引用的網(wǎng)絡(luò)掰派,自己的報(bào)錯信息,等到解決后,沒有了傀顾。
2. 原因
??是vscode官方升級導(dǎo)致對之前的glibc的一些庫不支持了:
3. 解決方案
3.1 升級庫
??這里升級庫比較麻煩,有root權(quán)限碌奉,可以直接yum install升級(也可以直接在服務(wù)器里面搜一下短曾,看看有沒有新的庫,cp過來)赐劣,或者修改庫的引用路徑嫉拐。
通過任意ssh客戶端登陸服務(wù)器,會發(fā)現(xiàn)有個/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* #再次確認(rèn)版本
對node文件進(jìn)行patch献雅,這里用了我在服務(wù)器上翻出來的新版本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
??關(guān)閉Vscode自動更新:Vscode默認(rèn)是自動更新的,所以需要手動關(guān)閉防止再次出先問題塌计。
參考資料
vscode 無法遠(yuǎn)程連接waiting the server log
vscode ssh sw服務(wù)器
Vscode連接remote ssh 報(bào)錯挺身,The VS Code Server failed to start,vscode1.86.0更新后出現(xiàn)
conda環(huán)境下“/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20‘ not found”問題解決