# Metricbeat: Failed to encode event: unsupported float value: NaN

**URL:** <https://discuss.elastic.co/t/metricbeat-failed-to-encode-event-unsupported-float-value-nan/139093>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [July 9, 2018, 6:57am UTC](https://discuss.elastic.co/t/metricbeat-failed-to-encode-event-unsupported-float-value-nan/139093 "2018-07-09T06:57:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cck](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@cck](https://discuss.elastic.co/u/cck)\
**Post date:** [July 9, 2018, 6:57am UTC](https://discuss.elastic.co/t/metricbeat-failed-to-encode-event-unsupported-float-value-nan/139093/1 "2018-07-09T06:57:09Z")

</div>

I am trying to inspect docker containers with metricbeat:6.3.0 in docker, and post data to elasticsearch: 6.3.0, and my host is `Ubuntu16.04`, the `metricbeat.yml` and `docker.yml` works when I install metricbeat on host directly. I got the `Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock:` , so I put `user: root` in docker-compose.yml, the following is the docker-compose.yml:

```auto
version: '2'
services:
    metricbeat:
        image: 'docker.elastic.co/beats/metricbeat:6.3.0'
        user: root
        volumes:
            - /proc:/hostfs/proc:ro
            - /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
            - /:/hostfs:ro
            - /var/run/docker.sock:/var/run/docker.sock
            - ./metricbeat.yml:/usr/share/metricbeat/metricbeat.yml
            - ./docker.yml:/usr/share/metricbeat/modules.d/docker.yml
        restart: always

```

then, I got the error as following:

```auto
|metricbeat_1 | 2018-07-09T06:50:18.638Z|INFO|cfgfile/reload.go:253|Starting 4 runners ...|
|---|---|---|---|
|metricbeat_1 | 2018-07-09T06:50:18.638Z|INFO|cfgfile/reload.go:214|Loading of config files completed.|
|metricbeat_1 | 2018-07-09T06:50:19.646Z|INFO|elasticsearch/client.go:690|Connected to Elasticsearch version 6.3.0|
|metricbeat_1 | 2018-07-09T06:50:19.651Z|INFO|template/load.go:73|Template already exists and will not be overwritten.|
|metricbeat_1 | 2018-07-09T06:50:24.875Z|ERROR|elasticsearch/client.go:356|Failed to encode event: unsupported float value: NaN|
|metricbeat_1 | 2018-07-09T06:50:24.876Z|ERROR|elasticsearch/client.go:356|Failed to encode event: unsupported float value: NaN|
|metricbeat_1 | 2018-07-09T06:50:24.876Z|ERROR|elasticsearch/client.go:356|Failed to encode event: unsupported float value: NaN|
|metricbeat_1 | 2018-07-09T06:50:26.876Z|ERROR|elasticsearch/client.go:356|Failed to encode event: unsupported float value: NaN|

```

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [July 9, 2018, 6:30pm UTC](https://discuss.elastic.co/t/metricbeat-failed-to-encode-event-unsupported-float-value-nan/139093/2 "2018-07-09T18:30:09Z")

</div>

Can you try enabling debug logging and maybe the logs will provide a bit more information about the event containing the NaN value. In metricbeat.yml you can add

```auto
logging.level: debug

```

---

<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:** [August 6, 2018, 6:30pm UTC](https://discuss.elastic.co/t/metricbeat-failed-to-encode-event-unsupported-float-value-nan/139093/3 "2018-08-06T18:30:17Z")

</div>

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