# RangeError: Invalid string length

**URL:** https://discuss.elastic.co/t/rangeerror-invalid-string-length/201628
**Category:** Kibana
**Created:** [September 30, 2019, 11:59am UTC](https://discuss.elastic.co/t/rangeerror-invalid-string-length/201628 "2019-09-30T11:59:23Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [September 30, 2019, 11:59am UTC](https://discuss.elastic.co/t/rangeerror-invalid-string-length/201628/1 "2019-09-30T11:59:23Z")

</div>

Hi,

when i search for on an index pattern for data through discover tab, the browser waits for some time and then just crashes with 'Aw snap!' message. No error in either Kibana or Elasticsearch logs.

This is happening when i increased node js heap to 4GB to solve 'javaScript heap out of memory' error in Kibana logs.

Version: 7.3.1

The search on other index pattern seems to go through fine.

---

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [September 30, 2019, 12:11pm UTC](https://discuss.elastic.co/t/rangeerror-invalid-string-length/201628/2 "2019-09-30T12:11:02Z")

</div>

And sometimes Kibana just restarts with following error in logs:

```
tusCode":200,"responseTime":130,"contentLength":9},"message":"POST /api/monitoring/v1/clusters/B80d8UrYSbypYhtxP38vBg/kibana 200 130ms - 9.0B"}
2019-09-30T12:07:45.555505118Z /usr/share/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:188
2019-09-30T12:07:45.555600816Z response += d;
2019-09-30T12:07:45.555616313Z ^
2019-09-30T12:07:45.555629390Z
2019-09-30T12:07:45.555642906Z RangeError: Invalid string length
2019-09-30T12:07:45.555656095Z at IncomingMessage.<anonymous> (/usr/share/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:188:19)
2019-09-30T12:07:45.555672786Z at IncomingMessage.emit (events.js:189:13)
2019-09-30T12:07:45.555688128Z at addChunk (_stream_readable.js:284:12)
2019-09-30T12:07:45.555701346Z at readableAddChunk (_stream_readable.js:261:13)
2019-09-30T12:07:45.555715619Z at IncomingMessage.Readable.push (_stream_readable.js:220:10)
2019-09-30T12:07:45.555729647Z at HTTPParser.parserOnBody (_http_common.js:122:22)
2019-09-30T12:07:45.555852506Z at Socket.socketOnData (_http_client.js:442:20)
2019-09-30T12:07:45.555953753Z at Socket.emit (events.js:189:13)
2019-09-30T12:07:45.555969007Z at addChunk (_stream_readable.js:284:12)
2019-09-30T12:07:45.555983538Z at readableAddChunk (_stream_readable.js:265:11)
2019-09-30T12:07:45.555997629Z at Socket.Readable.push (_stream_readable.js:220:10)
2019-09-30T12:07:45.556011820Z at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

```

I'm confused. it shows 'timeout error' when this happends in Kibana UI.

---

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [September 30, 2019, 12:25pm UTC](https://discuss.elastic.co/t/rangeerror-invalid-string-length/201628/3 "2019-09-30T12:25:18Z")

</div>

The above mentioned 'RangeError: Invalid string length' error is consistently occurring for a index pattern.

I have 'NODE\_OPTIONS=--max\_old\_space\_size=4096'

---

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [September 30, 2019, 1:08pm UTC](https://discuss.elastic.co/t/rangeerror-invalid-string-length/201628/4 "2019-09-30T13:08:15Z")

</div>

I increased heap to 8GB. Still getting same error.

---

<div class="post-metadata">

### Author: ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)
#### Post date: [September 30, 2019, 10:12pm UTC](https://discuss.elastic.co/t/rangeerror-invalid-string-length/201628/5 "2019-09-30T22:12:08Z")

</div>

Do you have any fields with extremely long strings? The discover page is fairly sensitive to rendering large amounts of data.

If that is the case we can truncate these or exclude them on the index patterns page.

---

<div class="post-metadata">

### Author: ![elk11](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@elk11](https://discuss.elastic.co/u/elk11)
#### Post date: [October 1, 2019, 4:29pm UTC](https://discuss.elastic.co/t/rangeerror-invalid-string-length/201628/6 "2019-10-01T16:29:42Z")

</div>

I did have a extremely long field. I added it to source filter in that index pattern. It seems to have fixed the issue. Thanks!

---

<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: [October 29, 2019, 4:29pm UTC](https://discuss.elastic.co/t/rangeerror-invalid-string-length/201628/7 "2019-10-29T16:29:49Z")

</div>

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