Skip to content

VS Code Not Opening #7458

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

Closed
ryan-l-robinson opened this issue Jan 5, 2022 · 28 comments
Closed

VS Code Not Opening #7458

ryan-l-robinson opened this issue Jan 5, 2022 · 28 comments

Comments

@ryan-l-robinson
Copy link

Bug description

When I try to launch desktop VS Code for a workspace, it does not load. I get the prompt in Edge to approve opening VS Code. VS Code launches with whatever the last (local) workspace I had open. There is a notification saying that it is trying to open the workspace, but it will spin on "Connecting to GitPod workspace" for hours until I either cancel or close VS Code.

This used to work until about a month ago.

Knowing how central this is to the GitPod experience, I assume there's something unique to my setup and this isn't widespread for everybody. But I don't have any ideas for what might be causing a conflict.

Steps to reproduce

Start the GitPod workspace in the browser

Click the Open button to launch in VS Code when prompted, or choose the option to open in VS Code from the command palette.

When prompted by browser (Edge), allow this site to open VS Code links.

Look at the VS Code notification to open the GitPod workspace.

Environment:

Browser: Edge (although I don't think it's a browser issue since it can launch Code)

Desktop OS: Windows 10 Professional

VS Code version: 1.63.2 (system setup)

VS Code extensions installed locally:

  • mrmlnc.vscode-apache
  • pranaygp.vscode-css-peek
  • ms-azuretools.vscode-docker
  • marcostazi.vs-code-drupal
  • github.copilot
  • cstuder.gitlab-ci-validator
  • gitlab.gitlab-workflow
  • eamodio.gitlens
  • gitpod.gitpod-desktop
  • gitpod.gitpod-remote-ssh
  • cweijan.vscode-mysql-client2
  • christian-kohler.path-intellisense
  • esbenp.prettier-vscode
  • ms-vscode-remote.remote-containers
  • ms-vscode-remote.remote-ssh
  • ms-vscode-remote.remote-ssh-edit
  • ms-vscode-remote.remote-wsl
  • gruntfuggly.todo-tree
  • whatwedo.twig
  • vscode-icons-team.vscode-icons

Workspace affected

No response

Expected behavior

Launches GitPod workspace in VS Code (after a minute or two).

Example repository

No response

Anything else?

No response

@akosyakov
Copy link
Member

@jeanp413 could you try to reproduce it? It seems to be related to VS Code Desktop.

@ryan-l-robinson
Copy link
Author

FYI: I just tried it on my personal laptop instead of my work laptop, and my personal GitPod account instead of my work GitPod account. That one worked. So that does support that there's something unique about my work laptop that isn't working with it anymore.

@jeanp413
Copy link
Member

jeanp413 commented Jan 6, 2022

Cannot reproduce on Linux.
@ryan-l-robinson does your personal laptop also has Windows? Could you paste the log from the gitpod extension in the ouput panel from your work machine where it doesn't work.

image

@jeanp413 jeanp413 self-assigned this Jan 6, 2022
@ryan-l-robinson
Copy link
Author

ryan-l-robinson commented Jan 6, 2022

The personal laptop is also Windows, but Home instead of Professional and not managed by my organization. There's other variation in what apps are installed, but those are probably the two starting point differences.

Here's the output:

[2022-01-06, 9:02:43 a.m.] open workspace window: vscode://gitpod.gitpod-desktop/workspace/library.wlu.ca-drupal-9?%7B%22instanceId%22%3A%22cd0b6590-9b6a-4cb4-9e0d-c17b9977bfe2%22%2C%22workspaceId%22%3A%22jade-heron-8rv1jd2k%22%2C%22gitpodHost%22%3A%22https%3A%2F%2Fgitpod.io%22%7D
[2022-01-06, 9:02:43 a.m.] acquiring lock: gitpod.io
[2022-01-06, 9:02:44 a.m.] acquired lock: gitpod.io
[2022-01-06, 9:02:44 a.m.] fetching the local app from https://gitpod.io/static/bin/gitpod-local-companion-windows.exe
[2022-01-06, 9:02:49 a.m.] the local app is outdated, upgrading: {
  "installation": {
    "path": "C:\\Users\\RYROBI~1\\AppData\\Local\\Temp\\gitpod-local-companion-20504-PlTS4S0WhpEO-.exe",
    "etag": "\"r55xynae22o\""
  },
  "upgrade": {
    "etag": "\"r5a2y0ae22o\"",
    "url": "https://gitpod.io/static/bin/gitpod-local-companion-windows.exe"
  }
}
[2022-01-06, 9:02:50 a.m.] installing the local app to C:\Users\RYROBI~1\AppData\Local\Temp\gitpod-local-companion-22904-33QFks7obsgc-.exe
[2022-01-06, 9:03:13 a.m.] installing the local app: {
  "path": "C:\\Users\\RYROBI~1\\AppData\\Local\\Temp\\gitpod-local-companion-22904-33QFks7obsgc-.exe",
  "etag": "\"r5a2y0ae22o\""
}
[2022-01-06, 9:03:13 a.m.] starting the local app with the config: {
  "gitpodHost": "https://gitpod.io",
  "configFile": "file:///c%3A/Users/RYROBI~1/AppData/Local/Temp/gitpod_ssh_config-22904-04mP3PnTF6wq",
  "apiPort": 54603
}
[2022-01-06, 9:03:15 a.m.] the local app has been stared: {
  "pid": 13288,
  "log": "file:///c%3A/Users/RYROBI~1/AppData/Local/Temp/gitpod-local-companion-22904-33QFks7obsgc-.log"
}
[2022-01-06, 9:03:15 a.m.] released lock: gitpod.io
[2022-01-06, 9:03:15 a.m.] the local app (pid: 13288) is running, but the api endpoint is not ready: Error: Response closed without headers

And then a new one about the api endpoint not being ready every 1s until I cancel it.

@ryan-l-robinson
Copy link
Author

Quick update: I've spent more time trying to narrow down which variable is making the difference. It seems the most likely culprit is the VPN/work network (I'm currently at home but this problem started when I was in person). In a relatively small sample size, it works if I have not yet connected to the VPN since restarting the computer. It does not work if I am currently connected to the VPN, or sometimes not if I was connected to the VPN but since disconnected.

Are you aware of any network requirements that I could take to our IT team? Or are you aware of anything that changed a couple months ago on the GitPod end that our network doesn't like?

@jeanp413
Copy link
Member

jeanp413 commented Jan 6, 2022

cc @akosyakov ☝️

@akosyakov
Copy link
Member

VS Code Desktop right now relies on https://www.gitpod.io/blog/local-app. Could you try to install it and see whether you can SSH into workspace? Please also investigate log output of the local app bundled with VS Code Destkop, you can see a path to it in the output view, e.g. "log": "file:///c%3A/Users/RYROBI~1/AppData/Local/Temp/gitpod-local-companion-22904-33QFks7obsgc-.log"

VS Code Desktop is still in beta, we are going to rework it next month to use direct SSH access. Maybe it will resolve your issue.

@jeanp413 jeanp413 removed their assignment Jan 7, 2022
@ryan-l-robinson
Copy link
Author

ryan-l-robinson commented Jan 7, 2022

I've installed the local app. I then tried to SSH to a workspace (while on the VPN). This is one of the workspaces which is in the gitpod_ssh_config file, successfully added yesterday.

My command was:

PS C:\Users\ryrobinson> ssh -F C:\Users\ryrobinson\AppData\Local\Temp\gitpod_ssh_config-10900-vYDfcopxxEO9 yellow-boa-szcbz07e

The response after about a minute is:

ssh: Could not resolve hostname yellow-boa-szcbz07e: No such host is known.

I also tried the same thing with another workspace that is not yet in the gitpod_ssh_config. Same result.

The gitpod-local-companion log file gives me a series of "failed to connect":

time="2022-01-07T09:23:33-05:00" level=info msg="writing workspace ssh_config file" ssh_config="C:\\Users\\RYROBI~1\\AppData\\Local\\Temp\\gitpod_ssh_config-12800-YKRlTlWfNhHf"
time="2022-01-07T09:23:35-05:00" level=info msg="websocket handshake" url="wss://gitpod.io/api/v1"
time="2022-01-07T09:23:35-05:00" level=error msg="failed to connect, trying again in 2 seconds..." badHandshakeCount=0/15 error="read tcp [private_network_ip]:51249->34.120.231.152:443: i/o timeout" statusCode=0 url="wss://gitpod.io/api/v1"

(There's more but with different ports and going up to 30 seconds between tries)

@akosyakov
Copy link
Member

@ryan-l-robinson Could you try from the scratch and share entire log of the local app with us by sending to [email protected]? Please mention that it is for Anton and Jean Pierre.

You can also run the local app in debug mode with --verbose.

time="2022-01-07T09:23:35-05:00" level=error msg="failed to connect, trying again in 2 seconds..." badHandshakeCount=0/15 error="read tcp [private_network_ip]:51249->34.120.231.152:443: i/o timeout" statusCode=0 url="wss://gitpod.io/api/v1"

It happens when the local app cannot access Gitpod Server for some reason. It could be temporary, but it never stops and you don't see that it is connected when it is bad. You can try to use other tools then to connect to the same host or ip address to see whether you have general issues with network.

@ryan-l-robinson
Copy link
Author

Done. Log is sent.

@akosyakov
Copy link
Member

From logs indeed it looks like the local companion cannot reach gitpod.io host. Can you ping it?

@ryan-l-robinson
Copy link
Author

Yes, I can ping gitpod.io even when I'm on the VPN.

Pinging gitpod.io [34.120.231.152] with 32 bytes of data:
Reply from 34.120.231.152: bytes=32 time=18ms TTL=121
Reply from 34.120.231.152: bytes=32 time=17ms TTL=121
Reply from 34.120.231.152: bytes=32 time=17ms TTL=121
Reply from 34.120.231.152: bytes=32 time=19ms TTL=121

Ping statistics for 34.120.231.152:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 17ms, Maximum = 19ms, Average = 17ms

I can also browse gitpod.io with no issues.

@axonasif
Copy link
Member

I feel this is more like a clientside issue which is hard to reproduce and also debug 😬, more like this one at discord: https://discord.com/channels/816244985187008514/839379835662368768/932334019583017040

@ryan-l-robinson
Copy link
Author

Understood. Our network is blocking something that this particular function needs. If you have any suggestions for what I could ask our IT department (e.g. a port to unblock), that would be great. If not, go ahead and close this ticket and we'll accept that if we stick with GitPod we'll have to do it in a browser.

@axonasif
Copy link
Member

@ryan-l-robinson we will try to help until we run out of ideas, closing this issue is the last resort 😅 . Can you try connecting to some other server via SSH on your terminal? Does that work?

@ryan-l-robinson
Copy link
Author

Yes, I can SSH to other servers, including some within our network (staging servers) and some unrelated (my personal website).

@axonasif
Copy link
Member

axonasif commented Jan 17, 2022

Okay thanks for testing that. Another thing that you can try is ssh'ing into the Gitpod generated config file with -vvv verbose flag. ssh -vvv I mean.
Kindly copy paste the terminal logs here if there aren't any sensitive information in that 👍

@ryan-l-robinson
Copy link
Author

To generate the ssh config file, I have to go off the VPN. If I try to launch VS Code from GitPod while on the VPN, it will create the file but with nothing in it.

So I went off the VPN, launched VS Code from GitPod, which generated the file. I then tried to SSH to the host name that was showing in that file, with verbose logging, and got this response:

OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Reading configuration data .\\gitpod_ssh_config-23728-A6mtB3mEdPvI
debug1: .\\gitpod_ssh_config-23728-A6mtB3mEdPvI line 1: Applying options for wlulibdevapps-librarywlu-5rejsknretk
debug2: resolve_canonicalize: hostname 127.0.0.1 is address
debug2: ssh_connect_direct
debug1: Connecting to wlulibdevapps-librarywlu-5rejsknretk [127.0.0.1] port 62828.
debug1: Connection established.
debug1: identity file C:\\Users\\RYROBI~1\\AppData\\Local\\Temp\\gitpod_990e7520-22c2-4556-aed6-d08d03c50a4e_id_rsa type 0
debug3: Failed to open file:C:/Users/RYROBI~1/AppData/Local/Temp/gitpod_990e7520-22c2-4556-aed6-d08d03c50a4e_id_rsa-cert error:2
debug3: Failed to open file:C:/Users/RYROBI~1/AppData/Local/Temp/gitpod_990e7520-22c2-4556-aed6-d08d03c50a4e_id_rsa-cert.pub error:2
debug1: identity file C:\\Users\\RYROBI~1\\AppData\\Local\\Temp\\gitpod_990e7520-22c2-4556-aed6-d08d03c50a4e_id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1

A couple of those files that it says fail to open do not exist: the ones ending with -cert.

@axonasif
Copy link
Member

Now those logs might be helpful for @akosyakov to debug. Let's wait for him 🙂

@axonasif
Copy link
Member

axonasif commented Jan 18, 2022

I'm not sure if this is helpful but sometimes antiviruses on windows can automatically delete files. I have not used windows for a long time now, so not sure how it's like today.

@stale
Copy link

stale bot commented Apr 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Apr 19, 2022
@eran-or
Copy link

eran-or commented Apr 19, 2022

It happened to me too on mac 2013. After some tries, I opened the log and tried again: 1. open the workspace on the browser , from there click on on open with vscode and then look on the log file (which was a good decision to make). Then the log says trying to fetch url...
I clicked the url and it downloaded gitpod-local... file and then it asked for ssh permissions tnat it didn't asked before and confirming them opened the project. I don't know why it's not asked the SSH and download the file automatically from the first time I confirmed to open in vs code , which is petty.

@stale stale bot removed the meta: stale This issue/PR is stale and will be closed soon label Apr 19, 2022
@soshimee
Copy link

soshimee commented Jul 3, 2022

Can reproduce on MBA 2019.

@RafidMuhymin
Copy link

Can reproduce on Windows 10

@jeanp413
Copy link
Member

jeanp413 commented Jul 16, 2022

@soshimee @RafidMuhymin could you install the pre-release version of gitpod-desktop extension and configuring your ssh keys in Gitpod before trying to connect again and let me know if that works or not 🙏

image

@RafidMuhymin
Copy link

@jeanp413 yup! It's working now 🚀! I had to configure nothing! Thank you so much!

@mustard-mh
Copy link
Contributor

Feel free to reopen it if the new feature #7458 (comment) not works for you

@akosyakov
Copy link
Member

For stable version you can configure "gitpod.remote.useLocalApp": false in your settings.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants