# Failed to encode event: unsupported float value: NaN

**URL:** <https://discuss.elastic.co/t/failed-to-encode-event-unsupported-float-value-nan/168666>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [February 16, 2019, 4:26am UTC](https://discuss.elastic.co/t/failed-to-encode-event-unsupported-float-value-nan/168666 "2019-02-16T04:26:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [February 16, 2019, 4:26am UTC](https://discuss.elastic.co/t/failed-to-encode-event-unsupported-float-value-nan/168666/1 "2019-02-16T04:26:10Z")

</div>

Hello World!

I'm using Elastic stack 6.6.0 and I'm seeing following message in: `/var/log/metricbeat/metricbeat`

> 2019-02-16T04:20:27.500Z ERROR elasticsearch/client.go:376 Failed to encode event: unsupported float value: NaN

- configuration block:
  - **type** : output
  - **output type** : elasticsearch
  - **hosts** : localhost:9200
  - **username** : elastic
  - **password** : \*\*\*\*\*\*\*\*

---

<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:** [February 19, 2019, 2:39am UTC](https://discuss.elastic.co/t/failed-to-encode-event-unsupported-float-value-nan/168666/2 "2019-02-19T02:39:39Z")

</div>

Hi @alexus, I actually saw the same error today 😅 What module are you running? If I can reproduce it on my side, that would be very helpful to debug.

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [February 19, 2019, 9:23am UTC](https://discuss.elastic.co/t/failed-to-encode-event-unsupported-float-value-nan/168666/3 "2019-02-19T09:23:03Z")

</div>

Related github issue: [https://github.com/elastic/beats/issues/9212](https://github.com/elastic/beats/issues/9212)

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [February 19, 2019, 5:18pm UTC](https://discuss.elastic.co/t/failed-to-encode-event-unsupported-float-value-nan/168666/4 "2019-02-19T17:18:17Z")

</div>

I believe that's `system` module as I'm trying to get `Infra` going and have `docker`, `system` and `output` modules enabled...

worth to note, without beats management everything works as expected, with however it works for a little bit, then crashes, until one restarts everything and then it works again (for some time).

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [February 20, 2019, 3:39pm UTC](https://discuss.elastic.co/t/failed-to-encode-event-unsupported-float-value-nan/168666/5 "2019-02-20T15:39:00Z")

</div>

> worth to note, without beats management everything works as expected, with however it works for a little bit, then crashes, until one restarts everything and then it works again (for some time).

Hm, that's interesting. Can you share configuration details and logs?

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [February 20, 2019, 4:40pm UTC](https://discuss.elastic.co/t/failed-to-encode-event-unsupported-float-value-nan/168666/6 "2019-02-20T16:40:55Z")

</div>

config: I didn't modified _any_ of these configuration files, as I use central management instead.

```
# grep -v ^# /etc/metricbeat/metricbeat.yml
    management:
      enabled: true
      period: 1m0s
      access_token: ${management.accesstoken}
      kibana:
        protocol: https
        host: X:443
        ssl: null
        timeout: 10s
        ignoreversion: true
      blacklist:
        output: console|file
    # 

&

    # cat /etc/metricbeat/modules.d/system.yml 
    # Module: system
    # Docs: https://www.elastic.co/guide/en/beats/metricbeat/6.6/metricbeat-module-system.html

    - module: system
      period: 10s
      metricsets:
        - cpu
        - load
        - memory
        - network
        - process
        - process_summary
        #- core
        #- diskio
        #- socket
      process.include_top_n:
        by_cpu: 5 # include top 5 processes by CPU
        by_memory: 5 # include top 5 processes by memory

    - module: system
      period: 1m
      metricsets:
        - filesystem
        - fsstat
      processors:
      - drop_event.when.regexp:
          system.filesystem.mount_point: '^/(sys|cgroup|proc|dev|etc|host|lib)($|/)'

    - module: system
      period: 15m
      metricsets:
        - uptime

    #- module: system
    # period: 5m
    # metricsets:
    # - raid
    # raid.mount_point: '/'
    #

```

`/var/log/metricbeat/metricbeat`:

```
2019-02-20T21:16:51.014Z	ERROR	elasticsearch/client.go:376	Failed to encode event: unsupported float value: NaN
INFO	[monitoring]	log/log.go:144	Non-zero metrics in the last 30s

```

a lot of `ERROR`s and now and then `INFO` (monitoring).

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [February 21, 2019, 2:15pm UTC](https://discuss.elastic.co/t/failed-to-encode-event-unsupported-float-value-nan/168666/7 "2019-02-21T14:15:36Z")

</div>

Which modules have you configured via Central Management.

If you enable the debug selector `elasticsearch` metricbeat will print a debug messages with the original event as is right after the error. This might help us in identifying the module the event did originate from.

---

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [February 21, 2019, 6:59pm UTC](https://discuss.elastic.co/t/failed-to-encode-event-unsupported-float-value-nan/168666/8 "2019-02-21T18:59:40Z")

</div>

The end goal is: [Get up and running | Infrastructure Monitoring Guide [6.6] | Elastic](https://www.elastic.co/guide/en/infrastructure/guide/current/install-infrastructure-monitoring.html#_which_modules_and_configuration_options_do_i_enable).

* * *

I followed [Configure logging](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-logging.html#selectors), looks like it's Docker module!

---

<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 21, 2019, 6:59pm UTC](https://discuss.elastic.co/t/failed-to-encode-event-unsupported-float-value-nan/168666/9 "2019-03-21T18:59:42Z")

</div>

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