Steps to Reproduce:
[09:52:12.633] Log Level: 2
[09:52:12.636] [email protected]
[09:52:12.637] win32 x64
[09:52:12.638] SSH Resolver called for "ssh-remote+test90", attempt 1
[09:52:12.639] SSH Resolver called for host: test90
[09:52:12.639] Setting up SSH remote "test90"
[09:52:12.642] Acquiring local install lock: C:\Users\sma\AppData\Local\Temp\vscode-remote-ssh-test90-install.lock
[09:52:12.654] Looking for existing server data file at c:\Users\sma\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-ssh\vscode-ssh-host-test90-78a4c91400152c0f27ba4d363eb56d2835f9903a\data.json
[09:52:12.654] Using commit id "78a4c91400152c0f27ba4d363eb56d2835f9903a" and quality "stable" for server
[09:52:12.655] Install and start server if needed
[09:52:12.657] Checking ssh with "ssh -V"
[09:52:12.691] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[09:52:12.691] Checking ssh with "C:\WINDOWS\System32\OpenSSH\ssh.exe -V"
[09:52:12.725] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[09:52:12.726] Checking ssh with "C:\Program Files\Git\usr\bin\ssh.exe -V"
[09:52:12.767] > OpenSSH_8.0p1, OpenSSL 1.1.1c 28 May 2019
[09:52:12.769] askpass server listening on \\.\pipe\vscode-ssh-askpass-429874e21720a1aa2c5e157ab42a85dd406ae87a-sock
[09:52:12.769] Spawning local server with {"ipcHandlePath":"\\\\.\\pipe\\vscode-ssh-askpass-1c04b125e0c94a914cf2864b38564dd0220af430-sock","sshCommand":"C:\\Program Files\\Git\\usr\\bin\\ssh.exe","sshArgs":["-v","-T","-D","9516","test90"],"dataFilePath":"c:\\Users\\sma\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-vscode-remote.remote-ssh\\vscode-ssh-host-test90-78a4c91400152c0f27ba4d363eb56d2835f9903a\\data.json"}
[09:52:12.769] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"c:\\Users\\sma\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.50.0\\out\\local-server\\askpass.bat","VSCODE_SSH_ASKPASS_NODE":"C:\\Users\\sma\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe","VSCODE_SSH_ASKPASS_MAIN":"c:\\Users\\sma\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.50.0\\out\\askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"\\\\.\\pipe\\vscode-ssh-askpass-429874e21720a1aa2c5e157ab42a85dd406ae87a-sock"}
[09:52:12.774] Spawned 17740
[09:52:12.850] > local-server> Spawned ssh: 7188
[09:52:12.876] stderr> OpenSSH_8.0p1, OpenSSL 1.1.1c 28 May 2019
[09:52:12.900] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:hjik4eW6ta5f8QfY17Ew8fCSMaMs3wSJDxuhbnOCUMU
[09:52:12.918] stderr> Authenticated to 192.168.130.90 ([192.168.130.90]:22).
[09:52:13.461] > Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 5.3.0-41-generic x86_64)
>
> * Documentation: https://help.ubuntu.com
> * Management: https://landscape.canonical.com
> * Support: https://ubuntu.com/advantage
>
> System information as of Tue Mar 10 09:52:14 CST 2020
>
> System load: 0.68 Processes: 269
> Usage of /: 19.2% of 78.24GB Users logged in: 0
> Memory usage: 15% IP address for ens33: 192.168.130.90
> Swap usage: 0%
>
> * Latest Kubernetes 1.18 beta is now available for your laptop, NUC, cloud
> instance or Raspberry Pi, with automatic updates to the final GA release.
>
> sudo snap install microk8s --channel=1.18/beta --classic
>
> * Multipass 1.1 adds proxy support for developers behind enterprise
> firewalls. Rapid prototyping for cloud operations just got easier.
>
> https://multipass.run/
>
> * Canonical Livepatch is enabled.
> - All available patches applied.
>
> 21 packages can be updated.
> 0 updates are security updates.
>
> Your Hardware Enablement Stack (HWE) is supported until April 2023.
[09:52:13.486] > ready: bf498b68ec99
[09:52:13.492] > Linux 5.3.0-41-generic #33~18.04.1-Ubuntu SMP Mon Feb 17 12:51:52 UTC 2020
[09:52:13.492] Platform: linux
[09:52:13.504] > bf498b68ec99: running
[09:52:13.518] > Acquiring lock on /home/sma/.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/vscode-remote-lock.sma.78a4c91400152c0f27ba4d363eb56d2835f9903a
[09:52:13.520] > \ln /home/sma/.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/vscode-remote-lock.sma.78a4c91400152c0f27ba4d363eb56d2835f9903a.target /home/sma/.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/vscode-remote-lock.sma.78a4c91400152c0f27ba4d363eb56d2835f9903a
[09:52:13.522] > Installation already in progress...
> bf498b68ec99##24##
[09:52:13.522] Received install output: bf498b68ec99##24##
[09:52:13.523] Server installation process already in progress - waiting and retrying
[09:52:13.523] Terminating local server
[09:52:13.523] stderr> ln: failed to create hard link '/home/sma/.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/vscode-remote-lock.sma.78a4c91400152c0f27ba4d363eb56d2835f9903a': File exists
[09:52:13.529] Local server exit: null
[09:52:14.526] askpass server listening on \\.\pipe\vscode-ssh-askpass-d90a061e3805eb169645b16717c01875a2a2bf63-sock
[09:52:14.526] Spawning local server with {"ipcHandlePath":"\\\\.\\pipe\\vscode-ssh-askpass-745bacebf51ed117503de26e0ca9787d89d43d60-sock","sshCommand":"C:\\Program Files\\Git\\usr\\bin\\ssh.exe","sshArgs":["-v","-T","-D","9516","test90"],"dataFilePath":"c:\\Users\\sma\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-vscode-remote.remote-ssh\\vscode-ssh-host-test90-78a4c91400152c0f27ba4d363eb56d2835f9903a\\data.json"}
[09:52:14.526] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"c:\\Users\\sma\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.50.0\\out\\local-server\\askpass.bat","VSCODE_SSH_ASKPASS_NODE":"C:\\Users\\sma\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe","VSCODE_SSH_ASKPASS_MAIN":"c:\\Users\\sma\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.50.0\\out\\askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"\\\\.\\pipe\\vscode-ssh-askpass-d90a061e3805eb169645b16717c01875a2a2bf63-sock"}
[09:52:14.531] Spawned 39048
[09:52:14.606] > local-server> Spawned ssh: 46428
[09:52:14.632] stderr> OpenSSH_8.0p1, OpenSSL 1.1.1c 28 May 2019
[09:52:14.656] stderr> debug1: Server host key: ecdsa-sha2-nistp256 SHA256:hjik4eW6ta5f8QfY17Ew8fCSMaMs3wSJDxuhbnOCUMU
[09:52:14.669] stderr> Authenticated to 192.168.130.90 ([192.168.130.90]:22).
[09:52:15.149] > Welcome to Ubuntu 18.04.4 LTS (GNU/Linux 5.3.0-41-generic x86_64)
>
> * Documentation: https://help.ubuntu.com
> * Management: https://landscape.canonical.com
> * Support: https://ubuntu.com/advantage
>
Does this issue occur when you try this locally?: Yes/No
Does this issue occur when you try this locally and all extensions are disabled?: Yes/No
the same issue here, and I figured out a way to fix it by removing the hardlink.
[09:52:13.523] stderr> ln: failed to create hard link '/home/sma/.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/vscode-remote-lock.sma.78a4c91400152c0f27ba4d363eb56d2835f9903a': File exists
the same issue here, and I figured out a way to fix it by removing the hardlink.
[09:52:13.523] stderr> ln: failed to create hard link '/home/sma/.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/vscode-remote-lock.sma.78a4c91400152c0f27ba4d363eb56d2835f9903a': File exists
Thanks,it works for me.
I remove the file and the target file.
I have the same issue, though the log is a bit different
Update: problem solved by downgrading remote ssh to former version
[11:50:13.863]` Log Level: 2
[11:50:13.936] [email protected]
[11:50:13.936] win32 x64
[11:50:13.939] SSH Resolver called for "ssh-remote+7b22686f73744e616d65223a22646f7444617461446576536572766572227d", attempt 1
[11:50:13.939] SSH Resolver called for host: dotDataDevServer
[11:50:13.939] Setting up SSH remote "dotDataDevServer"
[11:50:13.949] Acquiring local install lock: D:\Users\000001A00APTE\AppData\Local\Temp\vscode-remote-ssh-dotDataDevServer-install.lock
[11:50:14.171] Looking for existing server data file at d:\Users\000001A00APTE\AppData\Roaming\Code\User\globalStorage\ms-vscode-remote.remote-ssh\vscode-ssh-host-dotDataDevServer-78a4c91400152c0f27ba4d363eb56d2835f9903a\data.json
[11:50:14.172] Using commit id "78a4c91400152c0f27ba4d363eb56d2835f9903a" and quality "stable" for server
[11:50:14.174] Install and start server if needed
[11:50:14.179] Checking ssh with "ssh -V"
[11:50:15.159] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[11:50:15.160] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V"
[11:50:16.001] > OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[11:50:16.001] Checking ssh with "C:\Program Files\Git\usr\bin\ssh.exe -V"
[11:50:19.540] > OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
[11:50:19.543] askpass server listening on \\.\pipe\vscode-ssh-askpass-1e0edd8781e3525f350cbf4ab46c4dfafe7147bc-sock
[11:50:19.544] Spawning local server with {"ipcHandlePath":"\\\\.\\pipe\\vscode-ssh-askpass-a1f8e5372ec83b7244737a3c3260353386cce56f-sock","sshCommand":"C:\\Program Files\\Git\\usr\\bin\\ssh.exe","sshArgs":["-v","-T","-D","62311","dotDataDevServer"],"dataFilePath":"d:\\Users\\000001A00APTE\\AppData\\Roaming\\Code\\User\\globalStorage\\ms-vscode-remote.remote-ssh\\vscode-ssh-host-dotDataDevServer-78a4c91400152c0f27ba4d363eb56d2835f9903a\\data.json"}
[11:50:19.544] Local server env: {"DISPLAY":"1","ELECTRON_RUN_AS_NODE":"1","SSH_ASKPASS":"d:\\Users\\000001A00APTE\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.50.0\\out\\local-server\\askpass.bat","VSCODE_SSH_ASKPASS_NODE":"D:\\Users\\000001A00APTE\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe","VSCODE_SSH_ASKPASS_MAIN":"d:\\Users\\000001A00APTE\\.vscode\\extensions\\ms-vscode-remote.remote-ssh-0.50.0\\out\\askpass-main.js","VSCODE_SSH_ASKPASS_HANDLE":"\\\\.\\pipe\\vscode-ssh-askpass-1e0edd8781e3525f350cbf4ab46c4dfafe7147bc-sock"}
[11:50:19.636] Spawned 5504
[11:50:19.941] > local-server> Spawned ssh: 7256
[11:50:20.320] stderr> OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
[11:50:20.693] stderr> /bin/sh: line 0: exec: C:Program: not found
[11:50:20.693] stderr> kex_exchange_identification: Connection closed by remote host
[11:50:20.718] > local-server> ssh child died, shutting down
[11:50:21.065] Local server exit: 0
[11:50:21.066] Received install output: OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
/bin/sh: line 0: exec: C:Program: not found
kex_exchange_identification: Connection closed by remote host
[11:50:21.067] Stopped parsing output early. Remaining text: OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019/bin/sh: line 0: exec: C:Program: not foundkex_exchange_identification: Connection closed by remote host
[11:50:21.067] Failed to parse remote port from server output
[11:50:21.068] Resolver error:
[11:50:21.071] ------
same issue, still working on it
the same issue here, and I figured out a way to fix it by removing the hardlink.
[09:52:13.523] stderr> ln: failed to create hard link '/home/sma/.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/vscode-remote-lock.sma.78a4c91400152c0f27ba4d363eb56d2835f9903a': File exists
Thanks,it works for me.
I remove the file and the target file.
thanks, it works
So you saw this but did you have multiple windows trying to log in at the same time or something like that?
@DucNguyenPTIT I have no idea where your issue is coming from.
/bin/sh: line 0: exec: C:Program: not found
What if you set "remote.SSH.useLocalServer": false, does that work with the latest extension version?
@roblourens
So you saw this but did you have multiple windows trying to log in at the same time or something like that?
Even with one window I still can't log in
What if you set
"remote.SSH.useLocalServer": false, does that work with the latest extension version?
I've tried as you said and it kept retrying connection for several times, no successful connection though
Could you open a new issue with the full log from that last attempt?
@roblourens
Sorry, I tried setting "remote.SSH.useLocalServer": false again and now it works with the latest version
Was having the same issue with latest remote-SSH (0.50.0). Could connect OK to CentOS boxes but the one Ubuntu box I have just wasn't connecting. Set 'remote.SSH.useLocalServer' to false as suggested and things started working again. Thanks @roblourens
@DucNguyenPTIT thanks, still thinking about your issue, do you have some non-standard shell set as your default local shell, or something like that?
@lunedam-git would appreciate if you try again with that setting enabled, and create a new issue with the log from the Remote-SSH output channel. I've identified a few issues but I want to make sure I get yours.
do you have some non-standard shell set as your default local shell, or something like that?
@roblourens
I don't think so, I only use bash or powershell as my default shell
@roblourens sorry! Neglected to submit new issue as requested. Now done with 2528
So you saw this but did you have multiple windows trying to log in at the same time or something like that?
@roblourens I just ran into the same issue as the reporter when my installation upgraded to 1.43.
It had two windows with Remote: SSH to the same host and one local window.
The first window was taking a long time doing _something_ while setting up the upgraded remote server bits, while the second one retried until popping some UI to close or retry the remote.
My remote is like the reporter's on 18.04, my home directory is on a somewhat slow NFS mount.
Future attempts to connect even with one window still failed until manually removing the mentioned hardlink, after which the installation appears to have completed and is usable, but I'm not sure about its integrity.
the same issue here, and I figured out a way to fix it by removing the hardlink.
[09:52:13.523] stderr> ln: failed to create hard link '/home/sma/.vscode-server/bin/78a4c91400152c0f27ba4d363eb56d2835f9903a/vscode-remote-lock.sma.78a4c91400152c0f27ba4d363eb56d2835f9903a': File exists
Thanks, had the same issue after upgrading, google brought me here.
Remove the file, and restarted VSCODE, which worked!
@DocNguyenPTIT now tracking your issue in https://github.com/microsoft/vscode-remote-release/issues/2546
Is everyone with this issue using NFS? Does "remote.SSH.lockfilesInTmp": true help?
As a workaround (maybe temporary), delete the referenced file or run "Kill VS Code Server on Host..."
I can unfortunately not reproduce this to test that setting - as I didn't save the previously broken state and after successfully upgrading there's nothing to upgrade.
For what it's worth, I haven't been able to get multiple remote sessions to clash when doing initial installations of the server code, the second one neatly waits for the first to complete there in the couple of attempts I've done.
Closing this as a dupe of https://github.com/microsoft/vscode-remote-release/issues/2518
I had something which resembled this wedge now as I got back to work and it tried connecting to the machine in question, where several of the windows popped the same kind of failure dialog as before.
I set "remote.SSH.lockfilesInTmp": true, exited, and restarted and it seemed to connect fine. Whether this actually means anything or if it was just blind luck and a different problem that looked like the one, I don't know.
Sorry for not being able to give any useful information.
I happened upon this link searching for the hard link error which I too have but...
In my case, I am using a fresh vagrant/Virtual Box with Ubuntu 16.04 to debug bpf issues.
At first Remote SSH worked because I was not sharing a folder into the VM i.e. I was using default vagrant user. Once I created a user within the vm to match my host user name's id, I halted the VM and added the shared folder to act as the Guest's home (so I can do backups). Voila, both the ssh password loop and the hard link issue appeared.
Switching back to the 'vagrant' user, no shared folder -> it works!
It would also explain why "remote.SSH.lockfilesInTmp": true, works since /tmp is not shared.
Hope that helps someone...
I had the same issue after VS Code upgraded from 1.44 to 1.44.1. Remote SSH was working before the upgrade. After the upgrade it failed with the "failed to create hard link" error. Setting remote.SSH.useLocalServer from true to false did not fix it.
What fixed it was deleting this file (after backing it up):
$HOME/.vscode-server/bin/<long id>/vscode-remote-lock.<username>.<long id>
After that, I could connect normally, even with remote.SSH.useLocalServer=true.
Remote OS: Ubuntu 19.10
I had the same issue after VS Code upgraded from 1.44 to 1.44.1. Remote SSH was working before the upgrade. After the upgrade it failed with the "failed to create hard link" error. Setting
remote.SSH.useLocalServerfrom true to false did not fix it.What fixed it was deleting this file (after backing it up):
$HOME/.vscode-server/bin/<long id>/vscode-remote-lock.<username>.<long id>After that, I could connect normally, even with
remote.SSH.useLocalServer=true.Remote OS: Ubuntu 19.10
Yes! i tried it and it worked!! Thanks!!
Most helpful comment
the same issue here, and I figured out a way to fix it by removing the hardlink.