DamDam
DamDam

Reputation: 169

Can't launch VScode Cloud Run plugin on WSL

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.

Upvotes: 3

Views: 2256

Answers (3)

Athanasios Kataras
Athanasios Kataras

Reputation: 26372

Had the same issue with GitHub pull requests and solved it this way: Application proxy settings

It is a bit counter intuitive but it applies on both WSL as well. Override was the default, I would first try it with on value and then switch it off entirely.

Upvotes: 0

pasujemito
pasujemito

Reputation: 332

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!

Upvotes: 5

louis chandra
louis chandra

Reputation: 76

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!

Upvotes: 3

Related Questions