# Run command on pipeline container for debugging

**URL:** <https://drone.discourse.group/t/run-command-on-pipeline-container-for-debugging/9898>\
**Category:** Drone Support\
**Created:** [September 27, 2019, 6:25pm UTC](https://drone.discourse.group/t/run-command-on-pipeline-container-for-debugging/9898 "2019-09-27T18:25:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fbongiovanni29](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/fbongiovanni29/32/5862_2.png) [@fbongiovanni29](https://drone.discourse.group/u/fbongiovanni29)\
**Post date:** [September 27, 2019, 6:25pm UTC](https://drone.discourse.group/t/run-command-on-pipeline-container-for-debugging/9898/1 "2019-09-27T18:25:50Z")

</div>

When debugging with `drone exec`, I often set a sleep like so:

```auto
  commands:
  - sleep 600

```

Run `docker ps`, grab the container id and run:  
`docker exec -it container_id /bin/sh`  
for quicker, interactive debugging.

This is extremely useful and would be even more awesome if I could achieve this remote? (Note: I’m using helm chart but would consider switching)

---

<div class="post-metadata">

**Author:** ![danihodovic](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/danihodovic/32/3024_2.png) [@danihodovic](https://drone.discourse.group/u/danihodovic)\
**Post date:** [November 5, 2020, 9:21pm UTC](https://drone.discourse.group/t/run-command-on-pipeline-container-for-debugging/9898/2 "2020-11-05T21:21:57Z")

</div>

> [@Possible to deploy broken builds?](https://drone.discourse.group/t/possible-to-deploy-broken-builds/5790/1):
>
> ` - sleep 600`

The sleep is a clever workaround, but I’d love to see SSH debug functionality built in similar to what Travis CI has.

---

<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 5, 2020, 9:34pm UTC](https://drone.discourse.group/t/run-command-on-pipeline-container-for-debugging/9898/3 "2020-11-05T21:34:21Z")

</div>

as an aside, you can run pipeline locally in an emulated Drone environment which can also be very useful for debugging. [https://docs.drone.io/quickstart/cli/](https://docs.drone.io/quickstart/cli/)

---

<div class="post-metadata">

**Author:** ![danihodovic](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/danihodovic/32/3024_2.png) [@danihodovic](https://drone.discourse.group/u/danihodovic)\
**Post date:** [November 6, 2020, 7:55pm UTC](https://drone.discourse.group/t/run-command-on-pipeline-container-for-debugging/9898/4 "2020-11-06T19:55:08Z")

</div>

If you know what step might fail you can use bash operators to sleep if a failure occurs

```auto
- # step before
- pytest || sleep 100000
- # step after

```
