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 Explorer for Container shows no container only when no folder opened in VSCode over Remote SSH #4913

Closed
ghost opened this issue Apr 20, 2021 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded

Comments

@ghost
Copy link

ghost commented Apr 20, 2021

I'm using Remote SSH extension to access the linux server where docker is running.
Just after the Remote SSH session is started, the file explorer of VSCode will typically be in a no folder opened state.
At this moment, Remote Container extension is not able to show the docker containers running on the server.
However, after opening some (server's) folder, it will appear properly.
This is a strange behavior.

  • VSCode Version:
    Version: 1.55.2 (user setup)
    Commit: 3c4e3df9e89829dce27b7b5c24508306b151f30d
    Date: 2021-04-13T09:35:57.887Z
    Electron: 11.3.0
    Chrome: 87.0.4280.141
    Node.js: 12.18.3
    V8: 8.7.220.31-electron.0
    OS: Windows_NT x64 10.0.19042
    
  • Local OS Version:
    Edition	Windows 10 Pro
    Version	20H2
    Installed Date	‎2021/‎01/‎23
    OS Build 19042.928
    Experience	Windows Feature Experience Pack 120.2212.551.0
    
  • Remote OS Version:
    $ uname -a
    Linux myserver 5.4.0-72-generic #80-Ubuntu SMP Mon Apr 12 17:35:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
    
  • Remote Extension/Connection Type: SSH
  • List of extensions that you have installed:
    • Remote Development v0.20.0 (WSL v0.54.6, SSH v0.65.4, SSH Editing v0.65.4 Container v0.166.1)
    • Note: I usually use the Docker extension, but in order to check this issue, I have installed a new VSCode. I did not install the Docker extension at this time. That is, this issue does not seem to be related to Docker extensions at least.
  • settings.json:
    {
      "remote.containers.logLevel": "trace",
      "remote.SSH.logLevel": "trace"
    }

Steps to Reproduce:

  1. Open new VSCode window in my Local PC.
  2. Go to Remote Explorer tab, then select SSH Targets view.
  3. Select myserver and do Connect to Host in Current Window.
  4. VSCode on the server will be opened. Now Explorer tab indicates NO FOLDER OPENED.
  5. Verify that some docker container is running. Open the integrated terminal, then run:
    $ docker ps
    CONTAINER ID   IMAGE    COMMAND   CREATED          STATUS          PORTS     NAMES
    66871b696f33   xxxx     yyyy      13 minutes ago   Up 13 minutes             zzzzz
    
  6. Go to Remote Explorer tab, then select Container view.
  7. No container will be shown. Instead, there is Get started with containers by installing and staring Docker or by visiting the help view.
  8. Back to Explorer tab, click Open Folder, and open some folder.
  9. Go to Remote Explorer tab, then select Container view.
  10. The running container 66871b696f33 is shown in Other Containers.

What you expected to see, versus what you actually saw:
I think it is better that the container is shown in the Remote Explorer even if no folder is opened.

Errors from the Dev Tools Console (open from the menu: Help > Toggle Developer Tools):
Please see the attachment file. -1618923443736.log

I guess that the key of this issue is in the error of docker version --format {{.Server.APIVersion}} command:

> (new TextDecoder).decode(Uint8Array.from(errorobject.stdout.data))
error during connect: This error may indicate that the docker daemon is not running.: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version: open //./pipe/docker_engine: The system cannot find the file specified.

From this error, it is assumed that Remote Container extension is in Windows mode when no folder is opened even if VSCode is connected via Remote SSH to the linux server.

My additional experiments:

  • Local PC -> VSCode: New Window -> No folder opened -> OK (it shows the docker containers working on the local PC).
  • Local PC -> VSCode: New Window -> Connect to WSL using Remote WSL -> No folder opened -> OK (it shows the docker containers working on the local PC).
  • Local PC -> VSCode: New Window -> Connect to the server using Remote SSH -> No foldedr opend -> NG.
  • Local PC -> VSCode: New Window -> Connect to the server using Remote SSH -> No foldedr opend -> open some folder -> OK (it shows the docker containers working on the server).
  • Install Docker Extension into VSCode on the server, Docker tab shows the running container.
    Although Attach Visual Studio Code command also fails with the dialog message:
    Docker returned an error. Make sure the Docker daemon is running.
    

screenshot

Thanks.

@ghost
Copy link
Author

ghost commented Apr 20, 2021

I will try to debug the extensions. Does anyone know where the source repository is?

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Apr 20, 2021
@chrmarti
Copy link
Contributor

This requires microsoft/vscode#111371.

@TylerLeonhardt
Copy link
Member

@limerhyme can you give VS Code Insiders a try and let us know if this is working for you now?

@rzhao271 rzhao271 added the verified Verification succeeded label Oct 1, 2021
@ghost
Copy link
Author

ghost commented Oct 2, 2021

Hello, @TylerLeonhardt.
Today I tried insiders and verify that the reported problem was solved!
The container appears correctly and there is no problem when attaching to it.
Thank you all 😄

screenshot

@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2021
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 containers Issue in vscode-remote containers verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants