I am using vscode for remote development on a server. While my local ssh works perfectly and vscode too manages to connect I cannot understand why it struggles with acquiring a lock:
[15:30:21.166] Log Level: 2
[15:30:21.167] remote-ssh@0.76.1
[15:30:21.167] linux x64
[15:30:21.170] SSH Resolver called for "ssh-remote+myservername", attempt 1
[15:30:21.170] "remote.SSH.useLocalServer": true
[15:30:21.170] "remote.SSH.path": undefined
[15:30:21.170] "remote.SSH.configFile": undefined
[15:30:21.170] "remote.SSH.useFlock": true
[15:30:21.170] "remote.SSH.lockfilesInTmp": false
[15:30:21.171] "remote.SSH.localServerDownload": auto
[15:30:21.171] "remote.SSH.remoteServerListenOnSocket": false
[15:30:21.171] "remote.SSH.showLoginTerminal": false
[15:30:21.171] "remote.SSH.defaultExtensions": []
[15:30:21.171] "remote.SSH.loglevel": 2
[15:30:21.171] "remote.SSH.enableDynamicForwarding": true
[15:30:21.171] "remote.SSH.enableRemoteCommand": false
[15:30:21.173] "remote.SSH.serverPickPortsFromRange": {}
[15:30:21.173] "remote.SSH.serverInstallPath": {}
[15:30:21.182] SSH Resolver called for host: myservername
[15:30:21.182] Setting up SSH remote "myservername"
[15:30:21.185] Acquiring local install lock: /tmp/vscode-remote-ssh-71abc574-install.lock
[15:30:21.188] Looking for existing server data file at /home/pablo.jeken/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-71abc574-c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1-0.76.1/data.json
[15:30:21.189] Using commit id "c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1" and quality "stable" for server
[15:30:21.194] Install and start server if needed
[15:30:21.201] PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
[15:30:21.201] Checking ssh with "ssh -V"
[15:30:21.207] > OpenSSH_8.2p1 Ubuntu-4ubuntu0.4, OpenSSL 1.1.1f 31 Mar 2020
[15:30:21.218] askpass server listening on /run/user/10009775/vscode-ssh-askpass-3d1c8a273f03be7c5d0c82b4d05d7bac4a210902.sock
[15:30:21.218] Spawning local server with {"serverId":1,"ipcHandlePath":"/run/user/10009775/vscode-ssh-askpass-1cc1dcb318a81e2eccd3798a104e90247b955e4e.sock","sshCommand":"ssh","sshArgs":["-v","-T","-D","46751","-o","ConnectTimeout=15","myservername"],"serverDataFolderName":".vscode-server","dataFilePath":"/home/pablo.jeken/.config/Code/User/globalStorage/ms-vscode-remote.remote-ssh/vscode-ssh-host-71abc574-c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1-0.76.1/data.json"}
[15:30:21.219] Local server env: {"SSH_AUTH_SOCK":"/run/user/10009775/keyring/ssh","SHELL":"/bin/bash","DISPLAY":":0","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"/home/pablo.jeken/.vscode/extensions/ms-vscode-remote.remote-ssh-0.76.1/out/local-server/askpass.sh","VSCODE_SSH_ASKPASS_NODE":"/usr/share/code/code","VSCODE_SSH_ASKPASS_EXTRA_ARGS":"--ms-enable-electron-run-as-node","VSCODE_SSH_ASKPASS_MAIN":"/home/pablo.jeken/.vscode/extensions/ms-vscode-remote.remote-ssh-0.76.1/out/askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"/run/user/10009775/vscode-ssh-askpass-3d1c8a273f03be7c5d0c82b4d05d7bac4a210902.sock"}
[15:30:21.221] Spawned 603360
[15:30:21.289] > local-server-1> Spawned ssh, pid=603368
[15:30:21.291] stderr> OpenSSH_8.2p1 Ubuntu-4ubuntu0.4, OpenSSL 1.1.1f 31 Mar 2020
[15:30:21.310] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:xnBKjqpfpJS7fUOyaBfLXfFKXhrQHy0gTzx+EgsjOWE
[15:30:21.395] stderr> Server not found in Kerberos database
[15:30:21.435] stderr> Authenticated to myservername-myuni.com ([10.202.224.1]:22).
[15:30:21.515] > ready: 8065c191363a
[15:30:21.517] > Linux 4.18.0-240.1.1.el8_3.x86_64 #1 SMP Thu Nov 19 17:20:08 UTC 2020
[15:30:21.517] Platform: linux
[15:30:21.518] > /bin/bash
[15:30:21.518] Shell: bash
[15:30:21.524] > 8065c191363a: running
[15:30:21.540] > Acquiring lock on /home/pjeken/.vscode-server/bin/c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1/vscode-remote-lock.pjeken.c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1
This issue is provided at the github page of vscode, but was closed without a solution.
I tried both setting remote.SSH.useFlock
to false
and remote.SSH.lockfilesInTmp
to true
as suggested in the threat, but nothing solved the problem. Either vscode got caught in a loop trying to connect with ssh or the same problem persisted (same as in the threat).
Does anyone know where the issue might be? Thanks in advance.
Update:
I tried out the flock test as suggested in the answer below. The lock cannot be solved and is permanently stuck. Therefore, I assume flock
to be indeed the problem. Moving away from flock
, as stated before, has not solved the problem either.
I finally solved my issue by disabling flock and installing vscode in a different way on the server.
Disable flock: Set remote.SSH.useFlock
to false
in the vscode settings.
Install vscode by deploying it from a downloaded package (see how to do it here).