# Unable to bring containers down/stop containers whilst metricbeat is running

**URL:** <https://discuss.elastic.co/t/unable-to-bring-containers-down-stop-containers-whilst-metricbeat-is-running/157345>\
**Category:** Beats\
**Tags:** docker, metricbeat\
**Created:** [November 19, 2018, 12:31pm UTC](https://discuss.elastic.co/t/unable-to-bring-containers-down-stop-containers-whilst-metricbeat-is-running/157345 "2018-11-19T12:31:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adaisley](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@adaisley](https://discuss.elastic.co/u/adaisley)\
**Post date:** [November 19, 2018, 12:31pm UTC](https://discuss.elastic.co/t/unable-to-bring-containers-down-stop-containers-whilst-metricbeat-is-running/157345/1 "2018-11-19T12:31:36Z")

</div>

Hi guys.

We have several hosts running metricbeat via docker and sometimes when bringing other containers down with docker-compose/stopping them also using docker-compose, we get the following error:

```
ERROR: for [container_name] driver "devicemapper" failed to remove root filesystem for [ID]: failed to remove device [Another ID]: Device is Busy

```

This is quite irritating as every time we have to bring metricbeat down, then bring the new container down then up again, and then metricbeat up again. I was wondering if there is something we can do to prevent it from happening?

Looked at a few different related posts around and it seems to be an issue not limited to me but there's been no listed resolutions, at least from what I can see.

Thanks,  
Aaron

---

<div class="post-metadata">

**Author:** ![adaisley](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@adaisley](https://discuss.elastic.co/u/adaisley)\
**Post date:** [November 27, 2018, 11:07am UTC](https://discuss.elastic.co/t/unable-to-bring-containers-down-stop-containers-whilst-metricbeat-is-running/157345/2 "2018-11-27T11:07:22Z")

</div>

Wondering if anyone had a solution for this?

bump, i guess

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [November 29, 2018, 4:31pm UTC](https://discuss.elastic.co/t/unable-to-bring-containers-down-stop-containers-whilst-metricbeat-is-running/157345/3 "2018-11-29T16:31:03Z")

</div>

Hi! Can you give us more information on how the containers are setup please?

---

<div class="post-metadata">

**Author:** ![adaisley](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@adaisley](https://discuss.elastic.co/u/adaisley)\
**Post date:** [December 3, 2018, 11:42am UTC](https://discuss.elastic.co/t/unable-to-bring-containers-down-stop-containers-whilst-metricbeat-is-running/157345/4 "2018-12-03T11:42:21Z")

</div>

Set up using docker-compose.

```
---
version: "2.1"
services:
    metricbeat:
        container_name: metricbeat
        hostname: redacted
        user: root
        image: docker.elastic.co/beats/metricbeat:${ELASTIC_VERSION}
        volumes:
          #Mount the metricbeat configuration so users can make edit
          - ./config/beats/metricbeat/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml
          #Mount the modules.d directory into the container. This allows user to potentially make changes to the modules and they will be dynamically loaded.
          - ./config/beats/metricbeat/modules.d/:/usr/share/metricbeat/modules.d/
          # The commented sections below enable Metricbeat to monitor the Docker host rather than the Metricbeat container. These are used by the system module.
          - /proc:/hostfs/proc:ro
          - /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
          #Allows us to report on docker from the hosts information
          - /var/run/docker.sock:/var/run/docker.sock
          #We mount the host filesystem so we can report on disk usage with the system module
          - /:/hostfs:ro
          command: metricbeat -e -system.hostfs=/hostfs -E 
output.elasticsearch.hosts='["elasticsearch_url:9200"]' -E output.elasticsearch.username=elastic -E output.elasticsearch.password=${ES_PASSWORD} -strict.perms=false
        restart: on-failure
        network_mode: host
    networks:
      default:
        ipam:
          driver: redactedipam

```

I start it with docker-compose up -d metricbeat as there's other beats that we don't actually use (we could probably get rid of them).  
I've got metricbeat.yml set up to auto-detect new modules in modules.d with the system and docker modules enabled. Docker seems to be the main issue, and modules.d/docker.yml is set up like so:

```
- module: docker
  metricsets: ["container", "cpu", "diskio", "healthcheck", "info", "memory", "network"]
  hosts: ["unix:///var/run/docker.sock"]
  enabled: true
  period: 60s

```

Do you need anything more?

Thanks

EDIT: we don't have Dockerfiles, in case you were wondering.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 31, 2018, 11:42am UTC](https://discuss.elastic.co/t/unable-to-bring-containers-down-stop-containers-whilst-metricbeat-is-running/157345/5 "2018-12-31T11:42:21Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
