Issue after upgrading to 7.5.2 - SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse (<anonymous>) at server.route.handler

Hello,

Today we have performed an upgrate to Kiana 7.5.2 (ES at 7.5) and we have noticed an issue with one of our indices which was working fine. It seems like this particular index pattern is returning an error. Other seems to be working fine.

{ 
   "type":"error",
   "@timestamp":"2020-01-27T08:58:44Z",
   "tags":[ 

   ],
   "pid":23965,
   "level":"error",
   "error":{ 
      "message":"Unexpected token u in JSON at position 0",
      "name":"SyntaxError",
      "stack":"SyntaxError: Unexpected token u in JSON at position 0\n    at JSON.parse (<anonymous>)\n    at server.route.handler (/usr/share/kibana/src/legacy/core_plugins/elasticsearch/lib/create_proxy.js:85:21)\n    at process._tickCallback (internal/process/next_tick.js:68:7)"
   },
   "url":{ 
      "protocol":null,
      "slashes":null,
      "auth":null,
      "host":null,
      "port":null,
      "hostname":null,
      "hash":null,
      "search":"?rest_total_hits_as_int=true&ignore_unavailable=true&ignore_throttled=true&preference=1580115513256&timeout=30000ms",
      "query":{ 
         "rest_total_hits_as_int":"true",
         "ignore_unavailable":"true",
         "ignore_throttled":"true",
         "preference":"1580115513256",
         "timeout":"30000ms"
      },
      "pathname":"/elasticsearch/production*/_search",
      "path":"/elasticsearch/production*/_search?rest_total_hits_as_int=true&ignore_unavailable=true&ignore_throttled=true&preference=1580115513256&timeout=30000ms",
      "href":"/elasticsearch/production*/_search?rest_total_hits_as_int=true&ignore_unavailable=true&ignore_throttled=true&preference=1580115513256&timeout=30000ms"
   },
   "message":"Unexpected token u in JSON at position 0"
}

Hello,

When does this error occur? Also, are there any errors in the Kibana or ES logs?

happens also to me (exact error), when i try to create index pattern.
"pid": 9,
"level": "error",
"error": {
"message": "Unexpected token u in JSON at position 0",
"name": "SyntaxError",
"stack": "SyntaxError: Unexpected token u in JSON at position 0\n at JSON.parse ()\n at server.route.handler (/usr/share/kibana/src/legacy/core_plugins/elasticsearch/lib/create_proxy.js:85:21)\n at process._tickCallback (internal/process/next_tick.js:68:7)"
},
"url": {
"protocol": null,
"slashes": null,
"auth": null,
"host": null,
"port": null,
"hostname": null,
"hash": null,
"search": "?ignore_unavailable=true",
"query": {
"ignore_unavailable": "true"
},
"pathname": "/elasticsearch//_search",
"path": "/elasticsearch/
/_search?ignore_unavailable=true",
"href": "/elasticsearch/*/_search?ignore_unavailable=true"
},
"message": "Unexpected token u in JSON at position 0"

If you do a GET /_cat/indices in the Dev Tools console, does it work?

turns out it is timeout problem in the kibana/elastic. when i changed the timeout, the errors dissapeared.

Seems like my issue is tied to elasticsearch error enclosed below. It appears that i have to alter one of my visualizations and reduce the number of buckets.

Caused by: org.elasticsearch.search.aggregations.MultiBucketConsumerService$TooManyBucketsException: Trying to create too many buckets. Must be less than or equal to: [10000] but was [10001]. This limit can be set by changing the [search.max_buckets] cluster level setting.

When I decrease the size of first bucket to 9999, i got the below error. This time there is nothing in Kibana/Elastic log, only this error in Kibana's UI.

image

Hello,

Any idea how to fix it? It appears that my visualization remains blank with above errors that pops up. As a result I see the error message in Kibana log from first post in this topic. I tried to alter the max bucket settings for both elasticsearch cluster setting and in kibana advanced settings but no luck so far.

Even I am facing the same issue. Have you got a fix to this problem yet?

No, this errors still pops up from time to time. Can't find out why though.

HI,

same issue happens here as well.

Please fix! Or advise a work arround.

thx,!

I am also facing the same issue.

Also, seeing the same error after an upgrade from 7.5.1 to 7.6.1.

It doesn't seem consistent, and comes and goes.

Look for the timeout workaround in kibana. It worked for me.

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