DeserializationError: Unexpected end of JSON input
See original GitHub issue🐛 Bug Report
We are making Elasticsearch queries in a test file. The test file has multiple tests, each performing a query. We tried reordering the tests in the file and found that the first test in the file will be the only one that fails. Even with a stripped down body for the query, we are still inconsistently getting the following error:
Text: “DeserializationError: Unexpected end of JSON input”
To Reproduce
Run the following test multiple times (it takes a variable number of attempts to get the failure):
import { Client } from '@elastic/elasticsearch
const defaultClient = new Client({
node: host,
sniffOnStart: true
})
describe('elastic test', () => {
test('it should not have deserialization errors', async () => {
await defaultClient.search({
index: 'common',
type: '_doc',
body: {
query: {
match_all: {}
}
}
})
})
})
Expected behavior
The test should be passing consistently.
Your Environment
- node version: 10.11.0
@elastic/elasticsearch
version: ^7.5.1- os: Mac
- Elasticsearch instance version: 7.4.2
Please let me know if you need any additional information!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:33 (8 by maintainers)
Top Results From Across the Web
XSA ODATA V4 POST Error - {code: "400" Deserialization ...
{code: "400", message: "Deserialization Error: Unexpected end of JSON input."}. Using XSA 2.0 SPS05, Backend is NODE (Project Template - SAP ...
Read more >Error : SyntaxError: Unexpected end of JSON input
I am trying to fetch a JSON file from a api website using the below code but i am getting an error saying...
Read more >Unexpected end of JSON input Error in JavaScript - Stack Diary
The "Unexpected end of JSON input" error is a syntax error that occurs when the JSON you're trying to parse is incomplete or...
Read more >DeserializationError: Unexpected end of JSON input
Bug Report. We are making Elasticsearch queries in a test file. The test file has multiple tests, each performing a query.
Read more >Unexpected end of JSON input Error in JavaScript | bobbyhadz
The "Unexpected end of JSON input" error occurs when trying to parse invalid JSON using the JSON.parse or $.parseJSON methods. Trying to parse...
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
I am facing the exact similar issue from some days now, the configuration is exactly identical and the bug is also the same as well. The JSON response is broken inside the _source field from random places.
Hello! #1343 has landed, it will be available in
7.10
soon 😃