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

"Failed to connect. Is Docker running?" in all docker views using a remote docker context #3590

Closed
beirtipol opened this issue Jul 26, 2022 · 10 comments · Fixed by #3586
Closed
Milestone

Comments

@beirtipol
Copy link

Issue: All Docker views except "Contexts" display the message "Failed to connect. Is Docker running?". This issue has presented after running VSCode for multiple months over multiple projects, both local and remote, without issue.

My remote docker context is to a linux machine, defined as: "ssh://myusername@myremotedockerhost". Passwordless ssh is set up between my local machine and myremotedockerhost.

Troubleshooting steps:

  • Verified that the local docker context works in VSCode
  • Verified that command line docker works on the local docker context
  • Verified that command line docker works on the remote docker context
  • Verified that other IDEs (e.g. IntelliJ) can use the remote docker context
  • Verified that I can passwordless ssh from my command line to the machine which the remote docker context points to
  • Verified that I can create a remote SSH development session to the same machine
  • Verified that the old and deprecated "Docker Explorer" extension does work
  • Check all VSCode logs. The only error is a vague one reported in the 'Window' log every few seconds:
    [2022-07-25 18:12:20.031] [renderer1] [error] read ECONNRESET: Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:220:20)
  • Verified that rebooting my PC has no effect
  • Uninstalled and reinstalled Docker extension: same issue persists
  • Installed an earlier version of the Docker extension: same issue persists
  • Uninstalled VSCode completely, using Revo Uninstaller to find all registry entries and folders left behind. Then reinstalled and just added the Docker extension - same error persists.

Other people in my organisation have not reported this issue, suggesting there is something different about my remote docker context or SSH configuration which is causing issue.

Version: 1.22.0
OS: win32
OS Release: 10.0.17763
Product: Visual Studio Code
Product Version: 1.69.0
Language: en
Extensions installed:

  • Docker (Official Microsoft)
@beirtipol
Copy link
Author

Further to above:

  • Remote SSH docker contexts work when I run VSCode on a different Windows machine
  • Restarting the remote SSH machine running the remote docker context had no effect
  • Completely deleting my local windows profile on my local machine and reinstalling all software and reconfiguring Docker, I still get a request timeout in VS Code!

@beirtipol
Copy link
Author

Stopping the OpenSSH Authentication Agent service and restarting VSCode causes it to pop up with the message

In order to use an SSH DOCKER_HOST, you must configure an ssh-agent.

The OpenSSH executables on this machine are identical to another machine I have tested on.

@bwateratmsft
Copy link
Collaborator

Thank you for the very thorough investigation! It sounds like you do indeed have the OpenSSH Authentication Agent service configured to start automatically. I'm guessing you have, but did you do ssh-add <keyfile> to add the correct private key?

Another potential possibility is that the remote host has changed, and the fingerprint is not recognized. If you do ssh ssh://myusername@myremotedockerhost in a terminal window, does it prompt you to trust the server's fingerprint?

For what it's worth, we're working on #3263 which should hopefully be released soon, which will change the extension to only ever use the Docker CLI--so if the CLI is working (which it is, in your case), then the extension should work too. No more dockerode which has this ssh-agent requirement.

@beirtipol
Copy link
Author

Hi, Yes I added the private key after regenerating my keypair but still hit the same issue. It doesn't prompt me to recognise the fingerprint as it's already in the known_hosts file.

Something strange that I am seeing when sshing is this warning. However, I do get the same warning message when ssh'ing from a VM where VSCode works correctly on the remote docker context

C:\Users\myusername>ssh myusername@myremotedockerhost
warning: agent returned different signature type ssh-rsa (expected rsa-sha2-512)

FYI, The SSH key was generated on both the broken and working machines with ssh-keygen -t rsa-sha2-512

Using the docker cli would be a massive help. Hopefully that will come soon! Thanks

@beirtipol
Copy link
Author

Following up to previous, I've gone the whole hog and splatted all of my keypairs on all machines which has sorted the 'signature' warning above but still VSCode refuses to connect.

@bwateratmsft
Copy link
Collaborator

Good to know, thanks. I'll keep this issue open but hopefully #3263 will solve it.

@bwateratmsft bwateratmsft added this to the 1.23.0 milestone Jul 27, 2022
@bwateratmsft bwateratmsft linked a pull request Aug 31, 2022 that will close this issue
64 tasks
@VerdonTrigance
Copy link

VerdonTrigance commented Oct 3, 2022

Same problem here. I have two windows users. One works fine. Second can not connect. Using console like powershell for connecting works fine.

@beirtipol
Copy link
Author

I don't think this fix has actually been released yet?

@bwateratmsft
Copy link
Collaborator

That's correct, the release is tentatively planned for 28 November.

@bwateratmsft
Copy link
Collaborator

This has now been released in Docker extension version 1.23.0.

@microsoft microsoft locked and limited conversation to collaborators Dec 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@beirtipol @VerdonTrigance @bwateratmsft and others