...
Note |
---|
Rebooting is recommended. Many operating systems hold stuff in memory or cache and will not let go of changed files until you either reboot or force a recheck. |
Problem 7
The "vscode-server" process, automatically used as part of the VSCode "SSH-Remote" extension to provide helper communication between the local VSCode client and the remote SSH server, may have a stuck file lock which can't be fixed locally. The causes are most likely an exceeded file quota which would cause file corruption problems with the vscode-server state/cache files on the remote, or a non-graceful sudden loss of connectivity to the remote server which could also cause corruption of the same files.
The evidence of this problem would show up in the VSCode terminal output, the key lines being "Acquiring lock
" followed by "Installation already in progress...
":
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
[20:56:40.619] Log Level: 2
[20:56:40.639] SSH Resolver called for "ssh-remote+csil.cs.ucsb.edu", attempt 1
[20:56:40.640] "remote.SSH.useLocalServer": false
[20:56:40.641] "remote.SSH.useExecServer": false
[20:56:40.641] "remote.SSH.showLoginTerminal": false
[20:56:40.642] "remote.SSH.remotePlatform": {}
[20:56:40.642] "remote.SSH.path": undefined
[20:56:40.642] "remote.SSH.configFile": undefined
[20:56:40.643] "remote.SSH.useFlock": true
[20:56:40.643] "remote.SSH.lockfilesInTmp": false
[20:56:40.643] "remote.SSH.localServerDownload": auto
[20:56:40.644] "remote.SSH.remoteServerListenOnSocket": false
[20:56:40.644] "remote.SSH.showLoginTerminal": false
[20:56:40.644] "remote.SSH.defaultExtensions": []
[20:56:40.645] "remote.SSH.loglevel": 2
[20:56:40.647] "remote.SSH.enableDynamicForwarding": true
[20:56:40.648] "remote.SSH.enableRemoteCommand": false
[20:56:40.648] "remote.SSH.serverPickPortsFromRange": {}
[20:56:40.648] "remote.SSH.serverInstallPath": {}
[20:56:40.655] VS Code version: 1.86.2
[20:56:40.656] Remote-SSH version: remote-ssh@0.109.2024021615
[20:56:40.656] win32 x64
[20:56:40.660] SSH Resolver called for host: csil.cs.ucsb.edu
[20:56:40.660] Setting up SSH remote "csil.cs.ucsb.edu"
[20:56:40.667] Using commit id "903b1e9d8990623e3d7da1df3d33db3e42d80eda" and quality "stable" for server
[20:56:40.673] Install and start server if needed
[20:56:44.459] Checking ssh with "C:\Program Files\Eclipse Adoptium\jdk-17.0.4.101-hotspot\bin\ssh.exe -V"
[20:56:44.462] Got error from ssh: spawn C:\Program Files\Eclipse Adoptium\jdk-17.0.4.101-hotspot\bin\ssh.exe ENOENT
[20:56:44.462] Checking ssh with "C:\Windows\system32\ssh.exe -V"
[20:56:44.464] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT
[20:56:44.464] Checking ssh with "C:\Windows\ssh.exe -V"
[20:56:44.466] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT
[20:56:44.467] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V"
[20:56:44.468] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT
[20:56:44.468] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V"
[20:56:44.470] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT
[20:56:44.470] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[20:56:44.528] > OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
[20:56:44.535] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 16852 "csil.cs.ucsb.edu" bash
[20:56:44.540] Terminal shell path: C:\Windows\System32\cmd.exe
[20:56:45.291] > ]0;C:\Windows\System32\cmd.exe
[20:56:45.292] Got some output, clearing connection timeout
[20:56:45.565] > someuser@csil.cs.ucsb.edu's password:
[20:56:45.566] Showing password prompt
[20:56:49.171] Got password response
[20:56:49.171] "install" wrote data to terminal: "**************"
[20:56:49.196] >
[20:56:49.583] > 7b8709ba4652: running
[20:56:49.613] > Acquiring lock on /cs/student/someuser/.vscode-server/bin/903b1e9d8990623e3d7da
> 1df3d33db3e42d80eda/vscode-remote-lock.someuser.903b1e9d8990623e3d7da1df3d33db3
> e42d80eda
[20:56:49.622] > Installation already in progress...
> If you continue to see this message, you can try toggling the remote.SSH.useFloc
> k setting
> 7b8709ba4652: start
> exitCode==24==
> listeningOn====
> osReleaseId==fedora==
> arch==x86_64==
> vscodeArch==x64==
> bitness==64==
> tmpDir==/run/user/43085==
> platform==linux==
> unpackResult====
> didLocalDownload==0==
> downloadTime====
> installTime====
> extInstallTime====
> serverStartTime====
> 7b8709ba4652: end
[20:56:49.623] Received install output:
exitCode==24==
listeningOn====
osReleaseId==fedora==
arch==x86_64==
vscodeArch==x64==
bitness==64==
tmpDir==/run/user/43085==
platform==linux==
unpackResult====
didLocalDownload==0==
downloadTime====
installTime====
extInstallTime====
serverStartTime==== |
To be clear, don't follow the suggestion in the output to disable remote.SSH.useFlock in VSCode, that's not the correct solution. The file lock mechanism shouldn't be bypassed/disabled.
Solution 7
Before you address this, make sure your disk quota has not been exceeded. This issue would never resolve until there's free space.
Removing the old lock is the way to go. There are two ways:
Solution 7 (preferred): Use the VSCode client to clear the lock with a hidden command
In the VSCode window that's being used for remote SSH, press Ctrl+Shift+P (on PC) or ⇧⌘P (on MacOS), type the command "kill vs code server on host" and then choose the host from the drop-down.
The VSCode client may reload the active window, then it should ask for your credentials to the remote server. The client will then issue whatever required commands are needed on the remote host to clear the lock gracefully and minimize the possibility of losing any unsaved files in the session cache.
Solution 7: Delete the vscode-server files on the remote system without care for the loss of any uncommitted files
This solution option could introduce other problems to work through, so do this as a last resort. If any files were open and modified (but not saved yet) using Remote-SSH, deleting the vscode-server's files manually could cause cached files open in the editor to be lost. That can't be predicted ahead of time, so just be aware.
First, back up the contents of ~/.vscode-server
before continuing by copying the directory such as "cp -pr
if you're worried about vitally important cached information being lost, the files may be retrievable manually. The next step will delete the cache entirely and irretrievably.$HOME
/.vscode-server $HOME
/.vscode-server-backup"
The server process binary and its associated files and cache usually are in the $HOME/.vscode-server/bin
directory. Get rid of all the vscode-server files by running the following command on the remote server from an ordinary SSH terminal window: rm -rf $HOME/.vscode-server
The next time the VSCode client is used to remotely connect, it should re-install the vscode-server files and provide a working session.
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...