question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FetchError in request to ES: FetchError: invalid json response body

See original GitHub issue

Current behavior

Sometimes (completely random) the API will just return a blank page when it’s supposed to return an elasticsearch response. This will cause an error page and the error to be logged to our loggin software. In the last 3 weeks this has happened about 23.5k times so it happens quite often.

I saw that a new API project (storefront-api) will be used for a future release of VSF but I can’t test if it also happens there because putting that API on a production environment and changing all our api extensions is just too much work.

Expected behavior

It should get a valid response or request it again if the data was invalid.

Steps to reproduce the issue

This only happens on a production API and it doesn’t output any errors to the logs. It just returns a 200 response with a blank page. The most occurrences have happened on this API endpoint:

api/catalog/vue_storefront_magento_1/attribute/_search

Can you handle fixing this bug by yourself?

  • YES
  • NO

Which Release Cycle state this refers to? Info for developer.

Pick one option.

  • This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Environment details

  • Browser: Chrome 81.0.4044.129
  • OS: Mac OS 10.15.1
  • Node: V10.19.0
  • Code Version: V1.11.1

Additional information

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
pkarwcommented, Jun 18, 2020

This could be related to #393

0reactions
ResuBakacommented, Jun 25, 2020

Sry, I miss read it then. So thanks for the Info that is gone.

But you may still want to look into the fix, as it fixes a memory leak as creating a new ES clients for every request 😄.

Read more comments on GitHub >

github_iconTop Results From Across the Web

invalid json response body at...reason: Unexpected token < in ...
Is there any solution for this error? FetchError: invalid json response body at http://mydomain.com/graphql reason: Unexpected token < in JSON ...
Read more >
FetchError: invalid json response body - Stack Overflow
I'm using node-fetch to send some json data to an IFTTT restpoint. The data is successfully sent to the endpoint, but I'm getting...
Read more >
fetcherror: invalid response body while trying to fetch - You.com
The error is triggered because you are getting a HTML response instead of JSON. If you make the request from the browser you...
Read more >
Npm Err Invalid Json Response Body Unexpected End of ...
While trying to setup a new Laravel 8.x projects, We encountered problem while doing NPM install. Npm Err Invalid Json Response Body Unexpected...
Read more >
node-fetch - npm
Use native Node streams for body, on both request and response. ... and operational errors which are instances of FetchError.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found