# Startup Docker race condition

**URL:** https://discuss.elastic.co/t/startup-docker-race-condition/264365
**Category:** Beats
**Tags:** docker, filebeat
**Created:** [February 15, 2021, 9:52pm UTC](https://discuss.elastic.co/t/startup-docker-race-condition/264365 "2021-02-15T21:52:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![tman5](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tman5/32/83950_2.png) [@tman5](https://discuss.elastic.co/u/tman5)
#### Post date: [February 15, 2021, 9:52pm UTC](https://discuss.elastic.co/t/startup-docker-race-condition/264365/1 "2021-02-15T21:52:57Z")

</div>

Facing an issue when a server reboots with Filebeat 7.10 and Docker. Filebeat will start slightly before Docker and not pick up Docker container logs. If you restart Filebeat, it will then pick them up. I could set startup delays/dependencies at the system level, but I feel like there should be a better solution for this. Here is my filebeat.yml config

```auto
filebeat.autodiscover:
  providers:
    - type: docker
      hints.enabled: true
      templates:
        - condition:
            contains:
              docker.container.id: '*'
          config:
            - type: docker
              containers.ids:
                - "${data.docker.container.id}"

```

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [February 16, 2021, 3:24am UTC](https://discuss.elastic.co/t/startup-docker-race-condition/264365/2 "2021-02-16T03:24:13Z")

</div>

> [@tman5](#):
>
> Filebeat will start slightly before Docker and not pick up Docker container logs

What do the Filebeat logs show when this happens? Can you enable debug and then restart things to capture what's happening?

---

<div class="post-metadata">

### Author: ![tman5](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tman5/32/83950_2.png) [@tman5](https://discuss.elastic.co/u/tman5)
#### Post date: [February 16, 2021, 3:27pm UTC](https://discuss.elastic.co/t/startup-docker-race-condition/264365/3 "2021-02-16T15:27:48Z")

</div>

Turning on debug and disabling all logging except Docker, this is the only mention of Docker I see when filebeats starts:

```auto
DEBUG	[docker]	docker/client.go:48	Docker client will negotiate the API version on the first request.

```

---

<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: [March 16, 2021, 5:28pm UTC](https://discuss.elastic.co/t/startup-docker-race-condition/264365/4 "2021-03-16T17:28:49Z")

</div>

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