8000 Users are unable to debug why a workspace is failing to start due to lack of accessible logs. · Issue #23404 · eclipse-che/che · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Users are unable to debug why a workspace is failing to start due to lack of accessible logs. #23404

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

Open
achdmbp opened this issue Apr 8, 2025 · 1 comment
Labels
area/devworkspace-operator kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system. team/B This team is responsible for the Web Terminal, the DevWorkspace Operator and the IDEs.

Comments

@achdmbp
Copy link
achdmbp commented Apr 8, 2025

Describe the bug

When there is a bug in postStart command, that causes a workspace to fail to start, it impossible to retain the errors causing the workspace to help user troubleshoot/understand the root cause of the failure

Che version

7.95

Steps to reproduce

  1. Create an empty workspace.
  2. Create a /projects/devfile.yaml with the following content:
schemaVersion: 2.2.0
metadata:
  name: failing-post-start-ws
components:
  - container:
      image: nexus-docker.enterprise-tools.aws.delta.com/com/delta/dx/udi:latest
      sourceMapping: /projects
    name: tools
commands:
  - id: failing-command
    exec:
      commandLine: "echo 'I fail' && exit 1"
      component: tools
events:
  postStart:
    - failing-command
  1. Run "Restart from local devfile" action and select the devfile.yaml created in the above step.

  2. the workspace restats fails with the following error:

Failed to open the workspace
Error creating DevWorkspace deployment: Detected unrecoverable event FailedPostStartHook: PostStartHook failed.

examining the logs on the main container "tools", there is no information that helps the developer understand why the workspace is failing.

The workspace deployment YAML shows the postStart command as follows. It is noted that stdout and stderr are being redirected to /tmp/poststart-stderr.txt, making it impossible to retain the errors causing the workspace to fail to start.

          lifecycle:
            postStart:
              exec:
                command:
                  - /bin/sh
                  - '-c'
                  - |
                    {
                    echo 'I fail' && exit 1
                    nohup /checode/entrypoint-volume.sh > /checode/entrypoint-logs.txt 2>&1 &
                    } 1>/tmp/poststart-stdout.txt 2>/tmp/poststart-stderr.txt
          name: tools

Expected behavior

Developers should be able to view the stdout and stderr of the postStart command that is failing. This would allow users to see the "I fail" output from the command above, facilitating easier debugging and resolution of the issue.

Runtime

OpenShift

Screenshots

No response

Installation method

OperatorHub

Environment

Linux, macOS

Eclipse Che Logs

Additional context

No response

@achdmbp achdmbp added the kind/bug Outline of a bug - must adhere to the bug report template. label Apr 8, 2025
@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 Apr 8, 2025
@AObuchow
Copy link
AObuchow commented Apr 8, 2025

IIRC this is unfortunately not trivial to do due to recent changes to Kuberentes, unfortunately. See devfile/devworkspace-operator#1324

However, I had an idea to force postStart events to always succeed, though this could lead to weird behaviour where the workspace starts up in an invalid/unexpected state. Something like:

      lifecycle:
        postStart:
          exec:
            command:
              - /bin/sh
              - '-c'
              - |
                {
                  command1
                  command2
                  command3
                } 1> /tmp/poststart-stdout.txt 2> /tmp/poststart-stderr.txt || true # Force postStart event to succeed with || true

IMO if this route were taken, we'd want the editor to display a notification to the user that some postStart events failed.

@tolusha tolusha added severity/P2 Has a minor but important impact to the usage or development of the system. area/devworkspace-operator team/B This team is responsible for the Web Terminal, the DevWorkspace Operator and the IDEs. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devworkspace-operator kind/bug Outline of a bug - must adhere to the bug report template. severity/P2 Has a minor but important impact to the usage or development of the system. team/B This team is responsible for the Web Terminal, the DevWorkspace Operator and the IDEs.
Projects
None yet
Development

No branches or pull requests

4 participants
0