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

Installing certain extensions on first attach causes VSCode to hang forever #1081

Closed
alexsirbu opened this issue Jul 31, 2019 · 9 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers *duplicate Issue identified as a duplicate of another issue(s)

Comments

@alexsirbu
Copy link

alexsirbu commented Jul 31, 2019

  • VSCode Version: 1.36.1
  • Local OS Version: macOS Mojave 10.14.5
  • Remote OS Version: Ubuntu 14.04.6 LTS
  • Remote Extension/Connection Type: Docker/Attach to running container

Steps to Reproduce:

  1. Putting at least one of the following extensions in the user settings remote.containers.defaultExtensions: "esbenp.prettier-vscode", "shinnn.stylelint", "ms-python.python", "zxh404.vscode-proto3"
  2. Attach to a running container
  3. VSCode hangs forever with opening remote in the status bar

When having at least one of the mentioned extensions (the full list of extensions for this example being "dbaeumer.vscode-eslint", "wk-j.save-and-run", "ms-vscode.go", "visualstudioexptteam.vscodeintellicode", "esbenp.prettier-vscode"), the output is:

Run: docker exec -w /root/.vscode-server/bin/2213894ea0415ee8c85c5eea0d0ff81ecc191529 -e VSCODE_AGENT_FOLDER=/root/.vscode-server 79edf89c6d1f949a4c3a3d7beeb01d681cb42bdf1ed5586372d3ddfa7ca4a8f4 /root/.vscode-server/bin/2213894ea0415ee8c85c5eea0d0ff81ecc191529/server.sh --install-extension visualstudioexptteam.vscodeintellicode --install-extension wk-j.save-and-run --install-extension dbaeumer.vscode-eslint --install-extension ms-vscode.go --install-extension zxh404.vscode-proto3 --force
Installing extensions...
Installing extension 'visualstudioexptteam.vscodeintellicode' v1.1.8...
Extension 'visualstudioexptteam.vscodeintellicode' v1.1.8 was successfully installed.
Installing extension 'wk-j.save-and-run' v0.0.21...
Extension 'wk-j.save-and-run' v0.0.21 was successfully installed.
Installing extension 'dbaeumer.vscode-eslint' v1.9.0...
Extension 'dbaeumer.vscode-eslint' v1.9.0 was successfully installed.
Installing extension 'ms-vscode.go' v0.11.4...
Extension host agent is already running.
Run: docker exec -w /root/.vscode-server/bin/2213894ea0415ee8c85c5eea0d0ff81ecc191529 79edf89c6d1f949a4c3a3d7beeb01d681cb42bdf1ed5586372d3ddfa7ca4a8f4 /bin/sh -c cat .devport 2>/dev/null

When having other default extension (the previous list without "zxh404.vscode-proto3"), attach works and output is:

Installing extensions...
Installing extension 'visualstudioexptteam.vscodeintellicode' v1.1.8...
Extension 'visualstudioexptteam.vscodeintellicode' v1.1.8 was successfully installed.
Installing extension 'wk-j.save-and-run' v0.0.21...
Extension 'wk-j.save-and-run' v0.0.21 was successfully installed.
Installing extension 'dbaeumer.vscode-eslint' v1.9.0...
Extension 'dbaeumer.vscode-eslint' v1.9.0 was successfully installed.
Installing extension 'ms-vscode.go' v0.11.4...
Run: docker exec -w / -u 0 a9d75f38529b3c26ef524a31fb0b6bb12ffae2024ff7299da0fbc828fe2c6a4e /bin/sh -c command -v git >/dev/null 2>&1 && git config --system credential.helper '!f() { command -v code >/dev/null 2>&1 && code --gitCredential $*; }; f' || true
Run: docker exec -w /root/.vscode-server/bin/2213894ea0415ee8c85c5eea0d0ff81ecc191529 -e SHELL=/bin/bash -e VSCODE_AGENT_FOLDER=/root/.vscode-server a9d75f38529b3c26ef524a31fb0b6bb12ffae2024ff7299da0fbc828fe2c6a4e /root/.vscode-server/bin/2213894ea0415ee8c85c5eea0d0ff81ecc191529/server.sh --disable-user-env-probe --port 0

*
* Visual Studio Code Server
*
* Reminder: You may only use this software with Visual Studio family products,
* as described in the license https://aka.ms/vscode-remote/license
*

IP Address: 172.17.0.22
webview server listening on 37966
Extension host agent listening on 46543
Run: docker exec -w /root/.vscode-server/bin/2213894ea0415ee8c85c5eea0d0ff81ecc191529 a9d75f38529b3c26ef524a31fb0b6bb12ffae2024ff7299da0fbc828fe2c6a4e /bin/sh -c echo 46543 >.devport

Observations:

  1. If I close the window and open it again, attaching to the same container works and all the extensions have already been installed - no further install is executed, based on the output for this connection.
  2. The install extensions output when using one of the stated extensions seems to be truncated, as not all output from the install command gets to be printed out (can be seen above). Also, comparing output from a failed run and a successful run, it seems that the next command after install seems to be different.
  3. The install script seems to be still running on the container for a short while, even thought the next step gets executed, based on the output. This, together with 2 and with a bit of research might indicate that this issue is linked with Doesn't Always Display the Whole Output  node-pty#85 .
  4. The fact that the output when hanging says that Extension host agent is already running. might indicate that the script identifies the still running server.sh --install-extensions ... script as an actual running extension host agent, even though it isn't and, based on that, changes the install flow from a normal install, which bricks the system.
@egamma egamma added the containers Issue in vscode-remote containers label Aug 13, 2019
@chrmarti
Copy link
Contributor

It takes a while to install, e.g., the Prettier extension, but it then continues for me. How long did you wait before reloading?

I can reproduce the issue of the installing process being mistaken for the actual agent.

@chrmarti chrmarti added the info-needed Issue requires more information from poster label Aug 13, 2019
@alexsirbu
Copy link
Author

alexsirbu commented Aug 13, 2019

I waited up to 15 minutes. The output was the same consistently, for every run (of course, with a new container) - it went from installing to the Extension host agent is already running. message pretty quickly once it started, while skipping to show information about some of the extensions.

I've tested again today, as I had redeployed the machine which hosted the containers in the meanwhile and, surprisingly, I don't get the same issue anymore (all the installs are done fully and then the agent is started properly).

However, the potential issue which you can also reproduce remains :)

@chrmarti chrmarti added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Aug 14, 2019
@jasonwilliams
Copy link

jasonwilliams commented Jun 5, 2020

I have the same problem.
It's a network issue (for me), if i turn off my VPN it finishes instantly.

My guess is something hangs trying to connect to the outside world and fails, but rather than timing out it just hangs forever. Maybe some extensions download something on install, it would be good to get more verbose logging in this area

@chrmarti
Copy link
Contributor

chrmarti commented Jun 5, 2020

@jasonwilliams Could you append the log (click on the link in the progress in the lower right of the window)?

@jasonwilliams
Copy link

jasonwilliams commented Jun 5, 2020

@chrmarti https://gist.github.com/jasonwilliams/dbdd74c297e7fc2fe38923dd3c2e4e45

line 85 is where i switch off the VPN.
Sometimes this works, sometimes it leads to a broken install.
Either way you can see it's hanging on trying to connect to something.

Whats weird is i can usually download extensions fine behind the VPN normally, so i don't know why this hangs when i try to reopen in the container.

Also you can see on line 59 it downloads the VSCode server no problem

@chrmarti
Copy link
Contributor

chrmarti commented Jun 8, 2020

@jasonwilliams Do you have a network proxy configured?

@chrmarti
Copy link
Contributor

chrmarti commented Jun 8, 2020

Could you launch VS Code with code --log-net-log=netlog.json, install a local extension (not using Remote-Containers at all) and then upload the netlog.json while being connected to the VPN? That will tell us if a proxy is configured and how the marketplace is being accessed.

@chrmarti
Copy link
Contributor

chrmarti commented Jun 9, 2020

@jasonwilliams Yes, please send it to chrmarti at microsoft.com. 👍

@chrmarti
Copy link
Contributor

@jasonwilliams Thanks, the log shows that there is a proxy automatically configured. We are tracking proxy support for extension installs as #986. Closing as duplicate of that.

@chrmarti chrmarti added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 25, 2020
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 *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

4 participants