Skip to content
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

Che machine exec fails to start if the devfile has a post start event (Che-Code is the editor) #21431

Closed
Tracked by #21438 ...
l0rd opened this issue May 30, 2022 · 13 comments
Labels
area/editor/vscode Issues related to the Code OSS editor of Che kind/bug Outline of a bug - must adhere to the bug report template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P1 Has a major impact to usage or development of the system.

Comments

@l0rd
Copy link
Contributor

l0rd commented May 30, 2022

Describe the bug

Previously it was possible to select in which container we could open a terminal.

But this option is not available anymore:

image

Che version

next (development version)

Steps to reproduce

Start a workspace using Che-Code as the editor and open the command palette to create a terminal.

Expected behavior

Che-code should propose to create the terminal in one of the devfile containers.

In that list the containers that are not in the devfile (gateway, telemetry etc...) should not appear.

The default container should be the container where Che-Code runs.

Runtime

Dogfooding instance

@l0rd l0rd added the kind/bug Outline of a bug - must adhere to the bug report template. label May 30, 2022
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label May 30, 2022
@benoitf
Copy link
Contributor

benoitf commented May 30, 2022

you've this option using With Profile

image

@l0rd l0rd added area/editor/vscode Issues related to the Code OSS editor of Che severity/P1 Has a major impact to usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels May 30, 2022
@l0rd
Copy link
Contributor Author

l0rd commented May 30, 2022

Thanks @benoitf but I cannot see the dropdown list in my case:
image

@benoitf
Copy link
Contributor

benoitf commented May 30, 2022

I've tested on the dogfooding instance using
https://che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com/#https://github.com/che-samples/java-spring-petclinic/tree/devfilev2?che-editor=che-incubator/che-code/insiders

do you have more than one container/component in your devfile ?

@l0rd
Copy link
Contributor Author

l0rd commented May 30, 2022

@benoitf
Copy link
Contributor

benoitf commented May 30, 2022

is it always the case or randomly ?
b/c I have the terminal options with your sample

AIghLIyLQ3.mp4

what is the log of container using che-code ?

@l0rd
Copy link
Contributor Author

l0rd commented May 30, 2022

It's systematic. This is the container log:

total 4
drwxrwsrwx. 5 root user   97 May 30 15:43 .
dr-xr-xr-x. 1 root root  131 May 30 15:44 ..
drwxr-sr-x. 2 user user   26 May 30 15:43 bin
drwxr-sr-x. 7 user user  135 May 30 15:43 checode-linux-libc
drwxr-sr-x. 7 user user  135 May 30 15:43 checode-linux-musl
-rwxr-xr-x. 1 user user 1355 May 30 15:43 entrypoint-volume.sh
time="2022-05-30T15:44:02Z" level=info msg="Default 'info' log level is applied"
time="2022-05-30T15:44:02Z" level=info msg="Exec containers configuration:"
time="2022-05-30T15:44:02Z" level=info msg="==> Debug level info"
time="2022-05-30T15:44:02Z" level=info msg="==> Application url 0.0.0.0:3333"
time="2022-05-30T15:44:02Z" level=info msg="==> Absolute path to folder with static resources "
time="2022-05-30T15:44:02Z" level=info msg="==> Use bearer token: false"
time="2022-05-30T15:44:02Z" level=info msg="==> Pod selector: controller.devfile.io/devworkspace_id=workspaceb5cb54ab51114fa5"
[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/
[15:44:07] Extension host agent started.
[GIN] 2022/05/30 - 15:44:07 | 200 |    1.336894ms |       127.0.0.1 | GET      /connect
Unable to parse result TypeError: Cannot read properties of undefined (reading 'map')
    at WebSocket.<anonymous> (/checode/checode-linux-libc/out/vs/server/node/server.main.js:135:105773)
    at WebSocket.emit (node:events:390:28)
    at Receiver.receiverOnMessage (/checode/checode-linux-libc/node_modules/ws/lib/websocket.js:1022:20)
    at Receiver.emit (node:events:390:28)
    at Receiver.dataMessage (/checode/checode-linux-libc/node_modules/ws/lib/receiver.js:522:14)
    at Receiver.getData (/checode/checode-linux-libc/node_modules/ws/lib/receiver.js:440:17)
    at Receiver.startLoop (/checode/checode-linux-libc/node_modules/ws/lib/receiver.js:148:22)
    at Receiver._write (/checode/checode-linux-libc/node_modules/ws/lib/receiver.js:83:10)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
    at Receiver.Writable.write (node:internal/streams/writable:334:10)
    at Socket.socketOnData (/checode/checode-linux-libc/node_modules/ws/lib/websocket.js:1116:35)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:199:23)
[15:44:16] [127.0.0.1][e358917c][ManagementConnection] New connection established.
[15:44:17] [127.0.0.1][1292f89e][ExtensionHostConnection] New connection established.
[15:44:17] [127.0.0.1][1292f89e][ExtensionHostConnection] <117> Launched Extension Host Process.
[15:44:17] RemoteTerminalChannel: unsupported command/$getTerminalLayoutInfo
[15:44:17] RemoteTerminalChannel: unsupported command/$reduceConnectionGraceTime
[15:44:20] RemoteTerminalChannel: unsupported command/$getEnvironment
[15:44:20] RemoteTerminalChannel: unsupported command/$getEnvironment
[15:44:21] [127.0.0.1][e358917c][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed.
[15:44:21] [127.0.0.1][1292f89e][ExtensionHostConnection] <117> Extension Host Process exited with code: 0, signal: null.
[15:44:22] [127.0.0.1][45b2f3b1][ManagementConnection] New connection established.
[15:44:22] RemoteTerminalChannel: unsupported command/$getTerminalLayoutInfo
[15:44:22] [127.0.0.1][74e26b94][ExtensionHostConnection] New connection established.
[15:44:22] [127.0.0.1][74e26b94][ExtensionHostConnection] <130> Launched Extension Host Process.
[15:44:22] RemoteTerminalChannel: unsupported command/$reduceConnectionGraceTime
[15:44:24] RemoteTerminalChannel: unsupported command/$getEnvironment
[15:44:24] RemoteTerminalChannel: unsupported command/$getEnvironment
[15:44:26] RemoteTerminalChannel: unsupported command/$setTerminalLayoutInfo
[15:44:28] RemoteTerminalChannel: unsupported command/$getEnvironment
[15:44:28] RemoteTerminalChannel: unsupported command/$getEnvironment
[15:44:28] RemoteTerminalChannel: unsupported command/$getEnvironment
time="2022-05-30T15:44:28Z" level=error msg="Unable to initialize terminal. Cause: container with name Terminal was not found."
[GIN] 2022/05/30 - 15:44:28 | 200 |      48.321µs |       127.0.0.1 | GET      /attach/undefined
[15:44:28] Error: Unexpected server response: 200
    at ClientRequest.<anonymous> (/checode/checode-linux-libc/node_modules/ws/lib/websocket.js:753:7)
    at ClientRequest.emit (node:events:390:28)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:623:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
    at Socket.socketOnData (node:_http_client:487:22)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:199:23)
[15:44:28] RemoteTerminalChannel: unsupported command/$resize

@benoitf
Copy link
Contributor

benoitf commented May 30, 2022

Ok could you try to find machine exec process, kill it and restart it ( with the same options)
Get it using ps auxwwww

@l0rd
Copy link
Contributor Author

l0rd commented May 30, 2022

I confirm that restarting machine exec fixes the problem.

@l0rd
Copy link
Contributor Author

l0rd commented Jun 2, 2022

I confirm that if I remove the postStart event everything works fine 😲

@benoitf
Copy link
Contributor

benoitf commented Jun 2, 2022

ok I don't know how it's affecting the process :-/ but at least there is one clue about it

@l0rd l0rd changed the title It's not possible to select the container anymore when opening a terminal in Che-Code Che machine exec fails to start if the devfile has a post start event (Che-Code is the editor) Jun 8, 2022
@l0rd l0rd mentioned this issue Jun 8, 2022
64 tasks
@ibuziuk ibuziuk mentioned this issue Jun 28, 2022
68 tasks
@ibuziuk ibuziuk mentioned this issue Jul 19, 2022
51 tasks
@ibuziuk ibuziuk mentioned this issue Aug 5, 2022
67 tasks
@dkwon17
Copy link
Contributor

dkwon17 commented Aug 24, 2022

Thanks to this comment devfile/devworkspace-operator#659 (review) I noticed that I don't get this issue if the postStart command is a background command like yarn install & instead of yarn install

@che-bot
Copy link
Contributor

che-bot commented Feb 20, 2023

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 20, 2023
@l0rd
Copy link
Contributor Author

l0rd commented Feb 20, 2023

I am not reproducing this issue anymore

@l0rd l0rd closed this as completed Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/editor/vscode Issues related to the Code OSS editor of Che kind/bug Outline of a bug - must adhere to the bug report template. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

4 participants