# Stats endpoint fails after creating an index

**URL:** <https://discuss.elastic.co/t/stats-endpoint-fails-after-creating-an-index/262562>\
**Category:** Elasticsearch\
**Created:** [January 28, 2021, 8:22pm UTC](https://discuss.elastic.co/t/stats-endpoint-fails-after-creating-an-index/262562 "2021-01-28T20:22:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tommyzli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tommyzli/32/83077_2.png) [@tommyzli](https://discuss.elastic.co/u/tommyzli)\
**Post date:** [January 28, 2021, 8:22pm UTC](https://discuss.elastic.co/t/stats-endpoint-fails-after-creating-an-index/262562/1 "2021-01-28T20:22:35Z")

</div>

Hi  
Elasticsearch version 7.6

I have a cluster with 3 master only nodes, 20 data nodes, and one index with 10 shards and 10 replicas. After I create a new index called profiles\_v1 with 10 shards and 0 replicas, the stats endpoint begins to fail on every cluster member.

```auto
    $ curl localhost:9200/_stats
    {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Values less than -1 bytes are not supported: -9223372034551017657b"}],"type":"illegal_argument_exception","reason":"Values less than -1 bytes are not supported: -9223372034551017657b"},"status":400}

```

When I dropped the new `profiles_v1` index, the \_stats endpoint on every cluster member began responding successfully. When we re-created the `profiles_v1` index, the stats endpoint immediately started to fail with the same error message.

Then we tried dropping the `profiles_v1` index and re-creating it under the name `profiles_v2`. This did not cause the stats endpoint to fail. Dropping `profiles_v2` and re-creating it as `profiles_v1` was also fine.

I have no idea how a new index has any relation to a negative value being passed along in the stats code.

I did see [Node Stats API Failing - "Values less than -1 bytes are not supported: -4b"](https://discuss.elastic.co/t/node-stats-api-failing-values-less-than-1-bytes-are-not-supported-4b/201048), but `free` did not report negative values on any of the nodes so I don't think it's related

Can anyone make sense of this?

---

<div class="post-metadata">

**Author:** ![HenningAndersen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/henningandersen/32/48188_2.png) [@HenningAndersen](https://discuss.elastic.co/u/HenningAndersen)\
**Post date:** [January 29, 2021, 12:58pm UTC](https://discuss.elastic.co/t/stats-endpoint-fails-after-creating-an-index/262562/2 "2021-01-29T12:58:48Z")

</div>

Hi @tommyzli ,

I would think this is related to [#56435](https://github.com/elastic/elasticsearch/pull/56435), and I seem to remember it being caused by a JDK bug. Upgrading to a newer version should fix it I think.

---

<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:** [February 26, 2021, 12:59pm UTC](https://discuss.elastic.co/t/stats-endpoint-fails-after-creating-an-index/262562/3 "2021-02-26T12:59:07Z")

</div>

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