VScode连接失败问题

windows上使用vscode ssh连接到linux服务器,一直可以正常使用,但是突然就连接失败了,报错一下log

原因是:vscode自己更新了,导致原有的服务器上~/.vscode-server中的文件过期了,如果服务器一直连接外网的,那么vscode会自己下载,如果服务器没有连接外网,就出现了我的情况,一直连接不成功,一直报错下面的信息。

[08:48:13.513] Server installation process already in progress - waiting and retrying
[08:48:14.517] Running script with connection command: ssh -T -D 58042 "192.168.31.235" bash
[08:48:14.518] Terminal shell path: C:\Windows\System32\cmd.exe
[08:48:14.900] > ]0;C:\Windows\System32\cmd.exe
[08:48:14.900] Got some output, clearing connection timeout
[08:48:14.933] "install" terminal command done
[08:48:14.933] Install terminal quit with output: 
[08:48:15.404] > 741b6048ee5c: running
[08:48:15.469] > Acquiring lock on /home/zhangyasheng/.vscode-server/bin/c3f126316369cd610563c75b
> 1b1725e0679adfb3/vscode-remote-lock.zhangyasheng.c3f126316369cd610563c75b1b1725e
> 0679adfb3
[08:48:15.478] > Installation already in progress...
> If you continue to see this message, you can try toggling the remote.SSH.useFloc
> k setting
> 741b6048ee5c: start
> exitCode==24==
> listeningOn====
> osReleaseId==ubuntu==
> arch==x86_64==
> tmpDir==/run/user/1017==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> 741b6048ee5c: end
[08:48:15.478] Received install output: 
exitCode==24==
listeningOn====
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/1017==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====

[08:48:15.478] Server installation process already in progress - waiting and retrying
[08:48:16.481] Running script with connection command: ssh -T -D 58042 "192.168.31.235" bash
[08:48:16.482] Terminal shell path: C:\Windows\System32\cmd.exe
[08:48:16.862] > ]0;C:\Windows\System32\cmd.exe
[08:48:16.863] Got some output, clearing connection timeout
[08:48:16.899] "install" terminal command done
[08:48:16.900] Install terminal quit with output: 
[08:48:17.397] > 741b6048ee5c: running
[08:48:17.459] > Acquiring lock on /home/zhangyasheng/.vscode-server/bin/c3f126316369cd610563c75b
> 1b1725e0679adfb3/vscode-remote-lock.zhangyasheng.c3f126316369cd610563c75b1b1725e
> 0679adfb3
[08:48:17.467] > Installation already in progress...
> If you continue to see this message, you can try toggling the remote.SSH.useFloc
> k setting
> 741b6048ee5c: start
> exitCode==24==
> listeningOn====
> osReleaseId==ubuntu==
> arch==x86_64==
> tmpDir==/run/user/1017==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> 741b6048ee5c: end
[08:48:17.468] Received install output: 
exitCode==24==
listeningOn====
osReleaseId==ubuntu==
arch==x86_64==
tmpDir==/run/user/1017==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime====

  • 当我碰到这个问题时,我利用powershell使用ssh登录服务器,然后删除报错中加锁的文件
    rm -rf /home/zhangyasheng/.vscode-server/bin/c3f126316369cd6105
    -然后在服务器中找到 ~/.vscode-server/bin路径,然后再将其bin下面的所有文件删除
    rm -rf xxxxx
    -然后再用vscode重新连接就好了。

参考网页:
vscode ssh连接失败

猜你喜欢

转载自blog.csdn.net/weixin_44133327/article/details/121875088
今日推荐