# Feature Preview: Debug Mode

**URL:** <https://drone.discourse.group/t/feature-preview-debug-mode/11474>\
**Category:** Announcements & Events\
**Created:** [November 12, 2020, 5:00pm UTC](https://drone.discourse.group/t/feature-preview-debug-mode/11474 "2020-11-12T17:00:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [November 12, 2020, 5:00pm UTC](https://drone.discourse.group/t/feature-preview-debug-mode/11474/1 "2020-11-12T17:00:29Z")

</div>

I am excited to introduce a new feature that is available for preview called **debug mode**. When you execute a pipeline in debug mode, and a pipeline step fails, a remote tunnel is created that allows you to remotely ssh into the pipeline step’s container for debugging purposes. _Note that this only works for steps with shell commands; it does not work with plugin steps._

This feature requires the latest version of the drone server and the latest version of the docker runner (drone/drone-runner-docker:1). You must then pass DRONE\_TMATE\_ENABLED=true to the docker runner. This feature is not yet available to the kubernetes runner.

_If you are upgrading the runner on an existing machine, we recommend you manually force pull drone/drone-runner-docker:1 to ensure you do not have a stale release in your local docker cache._

* * *

When a pipeline fails you can restart the pipeline in debug mode by clicking the debug button. _This option is available to users with write or admin access to the repository only._

 ![step1](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/d/da04a316fd71eae17014953724fa7ffed12d0b00.jpeg)

When the pipeline runs in debug mode, and a pipeline step fails, a tmate session is created that allows you to remotely ssh into the container to debug. _This is only available to steps with commands; this cannot be used with plugin steps._

 ![step2](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/a/a1d0e45a62cc2e5e8d672a670f748feea297db11.jpeg)

Copy the tmate session link to start your remote session and gain remote access to the pipeline step. _Once you complete the debugging process you need to cancel the build, otherwise it will remain in a paused state until the pipeline timeout is reached._

 ![step3](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/6/673c6ab1f296060e3735e1ab1c528bbc927c5f3e.jpeg)

This feature is experimental and is opt-in. We expect to eventually enable this feature by default ~~once we have support for self-hosted tmate instances~~ **(done)** and once we have support for tmate on kubernetes. We will make a formal announcement before enabling this feature by default.

Please join our [gitter channel](https://gitter.im/drone/drone) to discuss this feature and provide feedback.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [November 12, 2020, 5:00pm UTC](https://drone.discourse.group/t/feature-preview-debug-mode/11474/2 "2020-11-12T17:00:50Z")

</div>

Closed on November 12, 2020, 5:00pm UTC



---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [November 20, 2020, 11:06pm UTC](https://drone.discourse.group/t/feature-preview-debug-mode/11474/3 "2020-11-20T23:06:21Z")

</div>

We pushed an update today to `drone/drone-runner-docker:latest` that allows enabling and configuring a self-hosted tmate server. This is ideal for teams that want to leverage the live debug feature, but for security or data privacy reasons, do not want to use the [tmate.io](http://tmate.io) service.

Here is an example configuration to pass to the runner:

```auto
DRONE_TMATE_ENABLED=true
DRONE_TMATE_HOST=tmate.company.com
DRONE_TMATE_PORT=2200
DRONE_TMATE_FINGERPRINT_RSA=SHA256:iL3StSCmPU+7p2IoD8y0huMXRVFIZyGFZa8r+lO3U5I
DRONE_TMATE_FINGERPRINT_ED25519=SHA256:gXLaN8IUxUMmlm/xu7M2NEFMlbUr5UORUgMi86Kh+tI

```

You can follow the instructions for installing tmate at [tmate.io/#host](https://tmate.io/#host).
