Remote Debugging

You can open a remote console to a running task by setting a breakpoint.

To set a breakpoint, run rwx-breakpoint anywhere in your task. It's a binary, so you can run it directly from your run script or from inside another bash script.

Flags

rwx-breakpoint supports the following flags:

FlagDefaultDescription
--attachment-timeout30mHow long to wait for a debugger to attach before continuing
--session-timeout30mMaximum duration of the debugging session once attached

Timeouts are specified as durations like 5m or 1h.

When RWX encounters a breakpoint, it will pause execution and make a private SSH connection available to the running task.

tasks:
  - key: demo-breakpoint
    run: |
      echo "hello world" | tee greeting.txt
      rwx-breakpoint
    env:
      SOME_ENV: the value

To customize the timeouts:

tasks:
  - key: long-debug-session
    run: |
      rwx-breakpoint --attachment-timeout=1h --session-timeout=2h

Once the breakpoint has been hit, use the rwx debug command in the RWX CLI to open a shell.

The UI will show the command to run. It'll look like this:

rwx debug c2ba55ecd392583f4446323156d0e8bd

RWX uses dtach to drop you into a bash shell in the context which the breakpoint was set.

In the above task definition, you can echo $SOME_ENV and cat greeting.txt

When you're done debugging, run exit or press ctrl+d to end your session.

You'll see output in your task logs in the UI indicating that your debugging session has finished.