-
Notifications
You must be signed in to change notification settings - Fork 175
docs: add workspace debug mode documentation #3111
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
snecklifter
wants to merge
1
commit into
eclipse-che:main
Choose a base branch
from
snecklifter:docs/debug-workspace-mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| :_content-type: PROCEDURE | ||
| :description: Debugging a failing {prod-short} workspace by starting it in debug mode | ||
| :keywords: user-guide, debug, workspace, troubleshooting | ||
| :navtitle: Debugging a workspace | ||
| :page-aliases: | ||
|
|
||
| [id="debugging-a-workspace"] | ||
| = Debugging a {prod-short} workspace | ||
|
|
||
| To diagnose workspace startup failures and inspect failing `postStart` commands, start the workspace in debug mode to keep containers running after failure. | ||
|
|
||
| When debug mode is enabled: | ||
|
|
||
| * If a `postStart` lifecycle command fails, the container sleeps instead of terminating, giving you time to connect and inspect the failure. | ||
| * Logs from `postStart` commands are written to `/tmp/poststart-stdout.txt` and `/tmp/poststart-stderr.txt` inside the workspace container. | ||
| * The workspace deployment remains available for the duration of the configured `progressTimeout` (default: 5 minutes) before scaling down. | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * A running {prod-short} instance. | ||
| * Access to the {prod-short} dashboard. | ||
|
|
||
| .Procedure | ||
|
|
||
| Start a stopped workspace in debug mode: | ||
|
|
||
| . In the {prod-short} dashboard, go to the *Workspaces* page. | ||
| . Click the kebab menu (*⋮*) for the workspace you want to debug. | ||
| . Select *Open in Debug mode*. | ||
| + | ||
| The workspace starts with the `controller.devfile.io/debug-start` annotation set to `true`, and the *Logs* tab opens. | ||
|
|
||
| Restart a running workspace in debug mode: | ||
|
|
||
| . In the {prod-short} dashboard, go to the *Workspaces* page. | ||
| . Click the kebab menu (*⋮*) for the running workspace. | ||
| . Select *Restart in Debug mode*. | ||
| + | ||
| The workspace restarts with debug mode enabled, and the *Logs* tab opens. | ||
|
|
||
| Inspect a failing workspace: | ||
|
|
||
| . Wait for the workspace to report a failure in the *Logs* tab. Look for error messages or status conditions indicating startup problems. If no failure occurs within the `progressTimeout` period (default: 5 minutes), the workspace will scale down automatically. | ||
| . Use `{orch-cli}` to exec into the workspace container: | ||
| + | ||
| [source,bash,subs="+attributes,+quotes"] | ||
| ---- | ||
| $ {orch-cli} exec --namespace='__<workspace_namespace>__' \ | ||
| deploy/workspace__<workspace_id>__ -- /bin/bash | ||
| ---- | ||
|
|
||
| . Review the `postStart` command logs: | ||
| + | ||
| [source,bash] | ||
| ---- | ||
| $ cat /tmp/poststart-stderr.txt | ||
| $ cat /tmp/poststart-stdout.txt | ||
| ---- | ||
|
|
||
| .Verification | ||
|
|
||
| * In the *Logs* tab, verify that the workspace status conditions include the message `DevWorkspace is starting in debug mode`. | ||
| * If a `postStart` command fails, verify that the container remains running and that `/tmp/poststart-stderr.txt` contains the failure details. | ||
|
|
||
| [IMPORTANT] | ||
| ==== | ||
| The `controller.devfile.io/debug-start` annotation is managed by the {prod-short} dashboard. Manually patching this annotation on a DevWorkspace resource using `{orch-cli}` will not persist, because the dashboard reconciles the annotation on every start or restart operation. | ||
|
|
||
| Always use the dashboard actions described above to enable debug mode. | ||
| ==== | ||
|
|
||
| .Additional resources | ||
| * xref:viewing-che-workspaces-logs.adoc[] | ||
| * xref:viewing-workspace-logs-in-cli.adoc[] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.