3

I'm trying to use the [Google Cloud Code plugin for VSCode] (https://marketplace.visualstudio.com/items?itemName=GoogleCloudTools.cloudcode) into my WSL containers.

First time it worked, than I modify the default user on WSL, and now I can't use the plugin. Trying to re-install the gcloud, use the script install instead of apt-get. I also tried on a new WSL container (with and without gcloud installed on it), same error. Re-install the plugin, nothing changed:

[8/4/2021, 11:12:29 AM] Dependency check detected gcloud not installed
[8/4/2021, 11:12:29 AM] Dependency installer starting installation
[8/4/2021, 11:12:30 AM] [warn]ApplicationInsights:CorrelationIdManager[{}]
[8/4/2021, 11:12:33 AM] [error]Dependency installer: gcloud architecture check failed request to https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json failed, reason: Failed to establish a socket connection to proxies: ["PROXY 127.0.0.1:9000"].
[8/4/2021, 11:12:33 AM] [error]Failed gcloud installation with Error: request to https://dl.google.com/dl/cloudsdk/channels/rapid/components-2.json failed, reason: Failed to establish a socket connection to proxies: ["PROXY 127.0.0.1:9000"]

First it doesn't found my gcloud installation, can't understand why. Second, VsCode try to connect on a localhost:9000 proxy, what is this for ?

Do you have an idea ?

Thank you.

Serhii Rohoza
  • 4,287
  • 2
  • 16
  • 29
DamDam
  • 119
  • 1
  • 15
  • Thanks for feedback. Seems like changing default user it is trying to figure out that it doesn't have gCloud SDK in cloud-code path and is trying to install but getting internet access issues. i am also confused about the repro steps whether you are using remote vscode setup https://code.visualstudio.com/docs/remote/wsl (or) completely inside WSL. Can you file a Github issue with repro steps(your setup), i can take it from there. https://github.com/GoogleCloudPlatform/cloud-code-vscode/issues – Siva Kalva Aug 04 '21 at 22:26

2 Answers2

4

If you get this error in WSL VSCode:

Failed to establish a socket connection to proxies: ["PROXY 127.0.0.1:9000"]

You need to enable http.proxySupport so your WSL instance can talk over proxy

CTRL+SHIFT+P or CMD+SHIFT+P

Find: Preferences: Open Settings JSON and add the following line to your settings:

"http.proxySupport": "on"

Et Voila!

pasujemito
  • 312
  • 4
  • 16
3

I was trying to repro the issue in my own Windows 10 machine, here's the step that I took:

  1. Install WSL and Remote development in VSCode in my windows Machine
  2. Downloaded ubuntu 20.04 as my WSL image run it, create "foo" user account
  3. Open the terminal in ubuntu, type "code ." this installs VSCode server and opens VSCode instance in my windows machine remote to the ubuntu
  4. Install cloud code, managed dependency seems to be working, gcloud is installed, minikube has installation error.
  5. Open Cloud Run explorer was able to sign into gcp successfully
  6. Quit ubuntu
  7. Create a new user for ubuntu "bar" and set it as default user: https://www.tenforums.com/tutorials/128052-add-user-windows-subsystem-linux-wsl-distro-windows-10-a.html
  8. set it as default user using "ubuntu2004 config --default-user bar"
  9. remote to the ubuntu, run step 3 to 5 successfully. Note that everything seems to be reset with new user so vscode server is installed again and I need to reinstall cloud code + managed dependency download everything else

We will look at the minikube issue separately, but I cannot seem to repro the proxy error or the managed dependency gcloud installation error. Can you confirm/update the repro step to see if I missed any other action? Also as @siva-kalva commented, feel free to report a github issue with repro step and we can take a look further. Thanks!