Debug a failing workspace
Debug a failing workspace by starting it in debug mode. Debug mode keeps containers running after postStart command failures, giving you time to inspect logs and diagnose the issue.
Before you begin
- You have a running OpenShift Dev Spaces instance.
- You have access to the OpenShift Dev Spaces dashboard.
About this task
When debug mode is enabled:
- If a
postStartlifecycle command fails, the container sleeps instead of terminating, giving you time to connect and inspect the failure. - Logs from
postStartcommands are written to/tmp/poststart-stdout.txtand/tmp/poststart-stderr.txtinside the workspace container. - The workspace deployment remains available for the duration of the configured
progressTimeout(default: 5 minutes) before scaling down.
Procedure
Results
- In the Logs tab, verify that the workspace status conditions include the message
DevWorkspace is starting in debug mode. - If a
postStartcommand fails, verify that the container remains running and that/tmp/poststart-stderr.txtcontains the failure details.
The controller.devfile.io/debug-start annotation is managed by the OpenShift Dev Spaces dashboard. Manually patching this annotation on a DevWorkspace resource using oc 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.