Get an warning: ResponseError: too_long_frame_exception
See original GitHub issueHi all, I encountered with a “too_long_frame_exception” warning when using scroll to fetch data from Elastic.
Issue
Here is the query to get data in 1 month:
"gte": "2019-11-17T17:00:00.000Z",
"lte": "2019-12-17T17:00:00.000Z"
GET band-monitor-*/_search
{
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"match": {
"band_id": 118217
}
},
{
"match": {
"band_id": 118220
}
},
{
"match": {
"band_id": 118221
}
}
]
}
},
{
"range": {
"createdDate": {
"gte": "2019-11-17T17:00:00.000Z",
"lte": "2019-12-17T17:00:00.000Z"
}
}
}
],
"filter": {
"script": {
"script": {
"source": "return doc['scan_id'].value % 10 == 0"
}
}
}
}
},
"sort": [
{
"scan_id": {
"order": "asc"
}
}
],
"aggs": {},
"size": 9999
}
Run in Kibana and It returns 13384 records. I think this amount is not big at all. However when using npm @elastic/elasticsearch in nodejs, it shows an error:
{ ResponseError: too_long_frame_exception
at IncomingMessage.response.on (/home/admin1/Documents/backend_v1/node_modules/@elastic/elasticsearch/lib/Transport.js:287:25)
at IncomingMessage.emit (events.js:203:15)
at IncomingMessage.EventEmitter.emit (domain.js:448:20)
at endReadableNT (_stream_readable.js:1143:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
name: 'ResponseError',
meta:
{ body: { error: [Object], status: 400 },
statusCode: 400,
headers:
{ 'content-type': 'application/json; charset=UTF-8',
'content-length': '211' },
warnings: null,
meta:
{ context: null,
request: [Object],
name: 'elasticsearch-js',
connection: [Object],
attempts: 0,
aborted: false } } }
With a smaller range, it works fine. E.g: “gte”: “2019-11-17T17:00:00.000Z”, “lte”: “2019-11-27T17:00:00.000Z”
Expected behaviour
Just 20k data, this package should be working probably. I even try to use scroll with scroll time: 30s, size: 100. Please help to find any solution for this issue. Thank all.
Your Environment
Node version: 8.10
@elastic/elasticsearch version: ^7.5.0
OS: Ubuntu 16.04
ES cluster version: 6.8
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
p.nettyException - Handling TooLongFrameException
framework, but when I attempt to start the server with activator run , I get the error below. I'm using activator 1.2.12. [warn]...
Read more >Java Examples for org.jboss.netty.handler.codec.http. ...
This java examples will help you to understand the usage of org.jboss.netty.handler.codec.http.HttpResponse. These source code samples are taken from ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In my case, that error happened because the API was trying to set the scroll_id in the queryString as part of the URL, and that has limit.
I solved the problem changing from:
To:
That way you can prevent the API code to try to set the scroll_id in the queryString, using the POST body instead.
very impressive