gitpod-io / gitpod-io/gitpod

Running `code` command early - results in an error

Open
#8,826 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

meta: never-stale team: IDE type: improvement
Dominant language
TypeScript
Stars
13.8k
Forks
1.4k
Avg merge
17h 58m
Merged PRs (30d)
5

Description

Bug description

Running code README.md early - results in an error

.gitpod.yml

tasks:
  - command: |
      code README.md

image

HISTFILE=/workspace/.gitpod/cmd-0 history -r; {
> code README.md
> 
> }
Unable to connect to VS Code server: Error in request.
Error: connect ECONNREFUSED 127.0.0.1:23000
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 23000
}
Steps to reproduce

Open the example repo in Gitpod -
https://gitpod.io/#https://github.com/shaal/gitpod-test--port-23000
You'll see the error about port 23000

vs.

The same repo, but in a branch that adds sleep 10:
https://gitpod.io/#https://github.com/shaal/gitpod-test--port-23000/tree/sleep-10-seconds

Workspace affected

No response

Expected behavior

Commands should run flawlessly.

Example repository

https://github.com/shaal/gitpod-test--port-23000

Anything else?

This bug seems to be worse on slower machines (and perhaps slower internet?)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue from the example repository and compare the .gitpod.yml task that runs code README.md with the branch that adds sleep 10. Trace the startup path for the VS Code server and the code command around port 23000; done means the command succeeds without requiring a manual delay, including on slower machines.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.