question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using Che Code without Che

See original GitHub issue

Summary

I would like to use a VS Code based DevWorkspace on a cluster where Che routing class hasn’t been deployed yet: Red Hat Developer Sandbox.

For instance I would like to

DW="https://eclipse-che.github.io/che-devfile-registry/main/devfiles/nodejs/devworkspace-che-code-insiders.yaml"
oc apply -f $DW

But when I try that the DevWorkspace is stuck in the “Waiting for editor to start phase”:

bash-4.4 ~ $ oc get --watch dw nodejs-web-app
NAME             DEVWORKSPACE ID             PHASE      INFO
nodejs-web-app   workspace56ee37f5976b4079   Starting   Waiting for workspace deployment
nodejs-web-app   workspace56ee37f5976b4079   Starting   Waiting for editor to start
nodejs-web-app   workspace56ee37f5976b4079   Failing    devworkspace failed to progress past phase 'Starting' for longer than timeout (5m)

Although the DW doesn’t reach the Running phase, Che code is started and that’s the output:

total 24
drwxrwsr-x. 6 root       1031540000 4096 Apr 24 21:58 .
dr-xr-xr-x. 1 root       root         75 Apr 24 22:10 ..
drwxrwsr-x. 2 1031540000 1031540000 4096 Apr 24 21:58 bin
drwxrwsr-x. 7 1031540000 1031540000 4096 Apr 24 21:58 checode-linux-libc
drwxrwsr-x. 7 1031540000 1031540000 4096 Apr 24 21:58 checode-linux-musl
-rwxrwxr-x. 1 1031540000 1031540000 1004 Apr 24 22:10 entrypoint-volume.sh
drwxrws---. 4 1031540000 1031540000 4096 Apr 24 21:58 remote
time="2022-04-24T22:10:34Z" level=info msg="Default 'info' log level is applied"
time="2022-04-24T22:10:34Z" level=info msg="Exec containers configuration:"
time="2022-04-24T22:10:34Z" level=info msg="==> Debug level info"
time="2022-04-24T22:10:34Z" level=info msg="==> Application url 0.0.0.0:3333"
time="2022-04-24T22:10:34Z" level=info msg="==> Absolute path to folder with static resources "
time="2022-04-24T22:10:34Z" level=info msg="==> Use bearer token: false"
time="2022-04-24T22:10:34Z" level=info msg="==> Pod selector: controller.devfile.io/devworkspace_id=workspace56ee37f5976b4079"
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:	export GIN_MODE=release
 - using code:	gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /connect                  --> main.main.func2 (3 handlers)
[GIN-debug] GET    /attach/:id               --> main.main.func3 (3 handlers)
[GIN-debug] POST   /exec/config              --> main.main.func4 (3 handlers)
[GIN-debug] POST   /exec/init                --> main.main.func5 (3 handlers)
[GIN-debug] POST   /activity/tick            --> main.main.func6 (3 handlers)
[GIN-debug] GET    /healthz                  --> main.main.func7 (3 handlers)
⇩ Registered RPCRoutes:

Json-rpc MachineExec Routes:
✓ create
✓ check
✓ resize
✓ listContainers
[GIN-debug] Listening and serving HTTP on 0.0.0.0:3333
Server bound to 127.0.0.1:3100 (IPv4)
Extension host agent listening on 3100

Web UI available at http://localhost:3100/
[22:10:40] Extension host agent started.
[GIN] 2022/04/24 - 22:10:40 | 200 |     281.893µs |       127.0.0.1 | GET      /connect

Relevant information

I can use a Theia based DevWorkspace on the same cluster but I have to change the value of the env variable THEIA_HOST from 127.0.0.1 to 0.0.0.0 so that Theia listens to any network interface, not only on localhost:

bash-4.4 ~ $ DW="https://eclipse-che.github.io/che-devfile-registry/main/devfiles/nodejs/devworkspace-che-theia-next.yaml"
bash-4.4 ~ $ curl -sSL $DW | sed 's/127.0.0.1/0.0.0.0/g' | oc apply -f -
devworkspacetemplate.workspace.devfile.io/theia-ide-nodejs-web-app created
devworkspace.workspace.devfile.io/nodejs-web-app created
bash-4.4 ~ $ oc get --watch dw nodejs-web-app
NAME             DEVWORKSPACE ID             PHASE      INFO
nodejs-web-app   workspace7045017c21ec4407   Starting   Waiting for workspace deployment
nodejs-web-app   workspace7045017c21ec4407   Starting   Waiting for editor to start
nodejs-web-app   workspace7045017c21ec4407   Starting   Waiting for editor to start
nodejs-web-app   workspace7045017c21ec4407   Starting   Waiting for editor to start
nodejs-web-app   workspace7045017c21ec4407   Running    https://workspace7045017c21ec4407.apps.sandbox.x8i5.p1.openshiftapps.com/theia/
image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
benoitfcommented, Apr 25, 2022

It would require an extra arg there https://github.com/che-incubator/che-code/blob/main/build/scripts/entrypoint.sh#L31-L37

Extra arg --host https://github.com/microsoft/vscode/blob/main/src/server-main.js

Default is localhost

So we could have CODE_HOST env variable as well propagated to --host

0reactions
l0rdcommented, Apr 25, 2022

Fantastic! Thanks @azatsarynnyy and @benoitf

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix the restart of che-code based workspaces #21085 - GitHub
Describe the bug Starting a devworkspace with che-code enabled fails to restart or start (if stopped). Code was enabled with url parameter.
Read more >
Introduction to Eclipse Che :: Eclipse Che Documentation
A plugin mechanism compatible with Visual Studio Code extensions. ... Che defines the workspace to be the project code files and all the...
Read more >
Extending Eclipse Che 7 to use VS Code extensions
This article explains the new plugin model in Eclipse Theia and the benefits for Eclipse Che 7 developer workspaces.
Read more >
Pair programming using VS Code | Eclipse Che Blog
This is only possible using Eclipse Che starting with 7.46+ and using Visual Studio Code editor, not Che-Theia. Pair programming using Che ......
Read more >
CHE Management Information System (CHEMIS)
As the state's coordinating board, CHE facilitates institutional data submission from the state's public and independent colleges and university through the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found