Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Remote SSH] Non-default profile causing connection issues in 1.95 #232602

Closed
ruijzhan opened this issue Oct 30, 2024 · 17 comments · Fixed by #233567
Closed

[Remote SSH] Non-default profile causing connection issues in 1.95 #232602

ruijzhan opened this issue Oct 30, 2024 · 17 comments · Fixed by #233567
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release verified Verification succeeded

Comments

@ruijzhan
Copy link

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.95.0
  • OS Version: Windows 11

Steps to Reproduce:

  1. Upgrade VSCode to 1.95.0
  2. Connect any remote host by Remote-SSH

The output indicated a connection timeout, and an error window popped up. However, the logs continued to print, showing that the connection to the remote host was actually established.

Image
Image
Image

@ruijzhan
Copy link
Author

ruijzhan commented Oct 30, 2024

One more clue is that the VSCode keeps asking the OS of remote host, then I select Linux, after that the error window pops out. Downgrade to 1.94.2 then works well.

@hellcry37
Copy link

hellcry37 commented Oct 30, 2024

I come here to do exactly this post, thanks, UP

SSH connection works if you connect with IP. however it always ask to confirm if it's a linux, windows or mac ...

as example this does not work anymore:

Host server.work
  HostName 192.168.111.4
  User username_here
  ForwardAgent yes

@mlawson27
Copy link

mlawson27 commented Oct 30, 2024

@ruijzhan are you using VSCode profiles by chance? I had this problem in one VSCode instance but not another, and the difference ended up being that the instance that didn't work had an enabled profile. The instance that used a profile also worked if I reverted to 1.94.2. When I opened the settings.json for the profile and my user settings.json and moved over the relevant settings from the user settings to the profile settings (even though they're supposed to be "across all profiles" settings), the failing instance started working as expected.

I think VSCode 1.95 is erroneously applying settings that are supposed to apply across all profiles on a per-profile basis. Since they are supposed to apply to all profiles, you can't set these settings for the profile except through the profile's settings.json (though you really shouldn't need to do so; it's just a workaround that seems to work for me), so they use the default value. Since one of these settings is remote.SSH.remotePlatform, it tries to take the value from a profile (which is empty), so it asks you the platform, and it doesn't save to the profile settings (since it's not supposed to), so your platform selection never takes, and it asks you every time you connect.

@ruijzhan
Copy link
Author

@ruijzhan are you using VSCode profiles by chance? I had this problem in one VSCode instance but not another, and the difference ended up being that the instance that didn't work had an enabled profile. The instance that used a profile also worked if I reverted to 1.94.2. When I opened the settings.json for the profile and my user settings.json and moved over the relevant settings from the user settings to the profile settings (even though they're supposed to be "across all profiles" settings), the failing instance started working as expected.

I think VSCode 1.95 is erroneously applying settings that are supposed to apply across all profiles on a per-profile basis. Since they are supposed to apply to all profiles, you can't set these settings for the profile except through the profile's settings.json (though you really shouldn't need to do so; it's just a workaround that seems to work for me), so they use the default value. Since one of these settings is remote.SSH.remotePlatform, it tries to take the value from a profile (which is empty), so it asks you the platform, and it doesn't save to the profile settings (since it's not supposed to), so your platform selection never takes, and it asks you every time you connect.

Thank you. You are right. When I switched to Default profile, it works.

@joshspicer please refer to this

@williamyizhu
Copy link

Same issue, VSCode 1.95, MacOS.

Error msg:

Setting up SSH Host xxx.xxx.xxx.xxx: Copying VS Code Server to host with scp

@ruijzhan
Copy link
Author

ruijzhan commented Oct 31, 2024

@ruijzhan are you using VSCode profiles by chance? I had this problem in one VSCode instance but not another, and the difference ended up being that the instance that didn't work had an enabled profile. The instance that used a profile also worked if I reverted to 1.94.2. When I opened the settings.json for the profile and my user settings.json and moved over the relevant settings from the user settings to the profile settings (even though they're supposed to be "across all profiles" settings), the failing instance started working as expected.

I think VSCode 1.95 is erroneously applying settings that are supposed to apply across all profiles on a per-profile basis. Since they are supposed to apply to all profiles, you can't set these settings for the profile except through the profile's settings.json (though you really shouldn't need to do so; it's just a workaround that seems to work for me), so they use the default value. Since one of these settings is remote.SSH.remotePlatform, it tries to take the value from a profile (which is empty), so it asks you the platform, and it doesn't save to the profile settings (since it's not supposed to), so your platform selection never takes, and it asks you every time you connect.

Hi,

One more update here:

When I switch to the Default profile, everything works fine. However, if I edit the settings.json of non-default profiles to include the host platform, VSCode no longer prompts for the host platform at startup. Despite this, the error window still appears, although the connection continues running in the background. @joshspicer

@mlawson27
Copy link

mlawson27 commented Oct 31, 2024

Yeah, I did the same. I also had to add dev.containers.dockerPath to my profile-specific settings.json in order to work with podman, and that setting is also supposed to apply to all profiles, so I think the issue affects all applies-to-all-profile settings.

@devaex
Copy link

devaex commented Nov 4, 2024

@mlawson27

Great find. I confirm that this solves the problem and it must certainly be something related to the scope of the settings.

What I did:

  • I didn't change the profile to the default. I continued on my profile.
  • F1 -> Preferences: Open User settings (JSON).
  • Put "dev.containers.dockerPath": "podman" in settings.
  • Vscode warned that this configuration is out of scope but I ignored it.
  • Try to attach to the container, and the connection was made as always.

@joshspicer
Copy link
Member

joshspicer commented Nov 5, 2024

Thank you all for the investigations. I'm looking into if there were any changes to VS Code profiles in the last release that we can handle better in this extension

There was another profiles-related issue opened last month that is now reported to be fixed in the latest VS Code update (microsoft/vscode-remote-release#10376). Folks on this thread, please let us know if you're still able to repro in the latest release - 1.95.1

cc/ @sandy081

@devaex
Copy link

devaex commented Nov 5, 2024

@joshspicer Yes, the issue persist in version 1.95.1 as related here:
microsoft/vscode-remote-release#10426 (comment)

@joshspicer
Copy link
Member

I'm unfortunately not able to repro. I tried creating a new profile (not tweaking any of the settings in the new profile). I then swapped to that profile and ssh'd to a host.

Some asks for anyone that can repro:

  1. Share information on your profile (screenshots of that configuration) and perhaps a video demo'ing the issue to help me catch what I may be missing.
  2. Running https://github.com/microsoft/vscode-bisect to narrow down this behavior to a single VS Code commit, so I can take that back to the core VS Code folks

@ruijzhan
Copy link
Author

ruijzhan commented Nov 6, 2024

I'm unfortunately not able to repro. I tried creating a new profile (not tweaking any of the settings in the new profile). I then swapped to that profile and ssh'd to a host.

Some asks for anyone that can repro:

  1. Share information on your profile (screenshots of that configuration) and perhaps a video demo'ing the issue to help me catch what I may be missing.
  2. Running https://github.com/microsoft/vscode-bisect to narrow down this behavior to a single VS Code commit, so I can take that back to the core VS Code folks

Hello, I'm experiencing issues with Remote-SSH on this particular profile. When using this profile and attempting to connect to a remote host via SSH in VSCode, the issue consistently occurs.

Profile link: https://vscode.dev/profile/github/29935e3ae18f67ccb4e06424003d9578

Currently, I’m using version 1.95.1, where I see errors that weren't present in 1.95.0. Unlike in 1.95.0, where the error message would pop up but SSH connection logs continued, in 1.95.1 the logs stop as soon as the .js errors appear.

Image

Version: 1.95.1 (user setup)
Commit: 65edc49
Date: 2024-10-31T05:14:54.222Z
Electron: 32.2.1
ElectronBuildId: 10427718
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22631

Let me know if you need any more information.

@joshspicer joshspicer changed the title Remote SSH broken after upgrading to 1.95 [Remote SSH] Non-default profile causing connection issues in 1.95 Nov 8, 2024
@joshspicer
Copy link
Member

joshspicer commented Nov 8, 2024

Sorry for the delay and thanks all for the data. I can indeed repro, I just don't see the crash due to the properties of the host I am SSH'ing to. I do get prompted each time for the remote platform on 1.95, which is enough to prove the bug. The Remote - SSH extension did not have a stable release last month, so either this behavior change needs to be handled in this extension, or better fixed in core.

@joshspicer joshspicer added bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release labels Nov 8, 2024
@sandy081 sandy081 self-assigned this Nov 11, 2024
@vs-code-engineering vs-code-engineering bot added the unreleased Patch has not yet been released in VS Code Insiders label Nov 11, 2024
@sandy081 sandy081 reopened this Nov 11, 2024
@vs-code-engineering vs-code-engineering bot removed the unreleased Patch has not yet been released in VS Code Insiders label Nov 11, 2024
@TylerLeonhardt TylerLeonhardt added verified Verification succeeded and removed verified Verification succeeded labels Nov 13, 2024
@sandy081
Copy link
Member

@joshspicer Can you please verify this?

@sandy081
Copy link
Member

sandy081 commented Nov 13, 2024

Can some one please verify if this issue got fixed in the following builds

@joshspicer joshspicer added the verified Verification succeeded label Nov 13, 2024
@joshspicer
Copy link
Member

validated from a windows host to a linux remote host. When using a non-deafult profile I no longer see a prompt on each connection to select the remote platform

@ruijzhan
Copy link
Author

Verified from Win11 to remote Ubuntu host. Problem solved. Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.