# Discover: Cannot read property 'indexOf' of undefined

**URL:** <https://discuss.elastic.co/t/discover-cannot-read-property-indexof-of-undefined/28345>\
**Category:** Kibana\
**Created:** [August 31, 2015, 10:16am UTC](https://discuss.elastic.co/t/discover-cannot-read-property-indexof-of-undefined/28345 "2015-08-31T10:16:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksvagarwal](https://avatars.discourse-cdn.com/v4/letter/k/8baadc/32.png) [@ksvagarwal](https://discuss.elastic.co/u/ksvagarwal)\
**Post date:** [August 31, 2015, 10:16am UTC](https://discuss.elastic.co/t/discover-cannot-read-property-indexof-of-undefined/28345/1 "2015-08-31T10:16:45Z")

</div>

When I go to discover tab, it doesn't show the data. This error occurred just a few hours ago. Before that, it was working perfectly fine. The error traceback is:

```
TypeError: Cannot read property 'indexOf' of undefined
    at Notifier.error (http://localhost/index.js?_b=5930:45607:23)
    at Notifier.bound (http://localhost/index.js?_b=5930:32081:21)
    at http://localhost/index.js?_b=5930:118772:18
    at wrappedCallback (http://localhost/index.js?_b=5930:20873:81)
    at http://localhost/index.js?_b=5930:20959:26
    at Scope.$eval (http://localhost/index.js?_b=5930:22002:28)
    at Scope.$digest (http://localhost/index.js?_b=5930:21814:31)
    at Scope.$apply (http://localhost/index.js?_b=5930:22106:24)
    at done (http://localhost/index.js?_b=5930:17641:45)
    at completeRequest (http://localhost/index.js?_b=5930:17855:7)

```

When I looked in the console of google chrome, the exception thrown was

```
Failed to load resource: the server responded with a status of 502 (Bad Gateway)

```

Here, the resource was:

```
http://localhost/elasticsearch/_msearch?timeout=0&ignore_unavailable=true&preference=1441015531309

```

I thought that instead of `_msearch`, it should be `_search` in the URL and it worked on making this change. Now what I can't understand is that how did kibana suddenly start using the wrong URL, and how can I rectify this error?

---

<div class="post-metadata">

**Author:** ![tbragin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tbragin/32/45166_2.png) [@tbragin](https://discuss.elastic.co/u/tbragin)\
**Post date:** [September 1, 2015, 2:47am UTC](https://discuss.elastic.co/t/discover-cannot-read-property-indexof-of-undefined/28345/2 "2015-09-01T02:47:25Z")

</div>

502 Bad Gateway error in Kibana indicates that it cannot communicate with Elasticsearch. Is Elasticsearch still reachable from the server running Kibana?

---

<div class="post-metadata">

**Author:** ![Nir\_Alfasi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nir_alfasi/32/705_2.png) [@Nir\_Alfasi](https://discuss.elastic.co/u/Nir_Alfasi)\
**Post date:** [January 14, 2016, 11:46pm UTC](https://discuss.elastic.co/t/discover-cannot-read-property-indexof-of-undefined/28345/3 "2016-01-14T23:46:59Z")

</div>

I have the same symptom but maybe a different underlying issue. It happens everytime I click on the "discover" tab (tried with different browsers as well).

 ![](https://us1.discourse-cdn.com/elastic/original/2X/0/00dfb0241f07cb49d72b29000845895bef6b7db1.png)

 ![](https://us1.discourse-cdn.com/elastic/original/2X/2/2228c01c09bb1565438699a1e1f50f3c05741f31.png)

The text of the error in the "console " is pasted below.

I suspect that some data in .kibana index got messed up when I played with the UI (I did _not_ make any calls to ES API to .kibana).

Hope this helps!  
Nir

RequestFailure {message: "Request to Elasticsearch failed: {"error":"SearchP…org/objectweb/asm/commons/GeneratorAdapter]; }]"}", origError: false, resp: Object}  
message: "Request to Elasticsearch failed: {"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[zWuJP4TiSBOsCabJlpWwvw][analytics\_01\_2016][0]: RemoteTransportException[[us-east-1d.i-50ae38e3][inet[/10.143.251.157:7102]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[analytics\_01\_2016][0]: query[ConstantScore(_:_)],from[-1],size[500]: Parse Failure [Failed to parse source [{"size":500,"sort":{"\_score":"desc"},"highlight":{"pre\_tags":["@kibana-highlighted-field@"],"post\_tags":["@/kibana-highlighted-field@"],"fields":{"_":{}}},"query":{"match\_all":{}},"fields":["_","\_source"],"script\_fields":{"execution\_time":{"script":"doc['end\_timestamp'].value","lang":"expression"}},"fielddata\_fields":}]]]; nested: IncompatibleClassChangeError[org/objectweb/asm/commons/GeneratorAdapter]; }{[zWuJP4TiSBOsCabJlpWwvw][analytics\_01\_2016][1]: RemoteTransportException[[us-east-1d.i-50ae38e3][inet[/10.143.251.157:7102]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[analytics\_01\_2016][1]: query[ConstantScore(_:_)],from[-1],size[500]: Parse Failure [Failed to parse source [{"size":500,"sort":{"\_score":"desc"},"highlight":{"pre\_tags":["@kibana-highlighted-field@"],"post\_tags":["@/kibana-highlighted-field@"],"fields":{"_":{}}},"query":{"match\_all":{}},"fields":["_","\_source"],"script\_fields":{"execution\_time":{"script":"doc['end\_timestamp'].value","lang":"expression"}},"fielddata\_fields":}]]]; nested: IncompatibleClassChangeError[org/objectweb/asm/commons/GeneratorAdapter]; }{[i8KEo9p3SEeBS8gnztPung][analytics\_01\_2016][2]: RemoteTransportException[[us-east-1e.i-f83a7179][inet[/10.184.204.145:7102]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[analytics\_01\_2016][2]: query[ConstantScore(_:_)],from[-1],size[500]: Parse Failure [Failed to parse source [{"size":500,"sort":{"\_score":"desc"},"highlight":{"pre\_tags":["@kibana-highlighted-field@"],"post\_tags":["@/kibana-highlighted-field@"],"fields":{"_":{}}},"query":{"match\_all":{}},"fields":["_","\_source"],"script\_fields":{"execution\_time":{"script":"doc['end\_timestamp'].value","lang":"expression"}},"fielddata\_fields":}]]]; nested: IncompatibleClassChangeError[org/objectweb/asm/commons/GeneratorAdapter]; }{[i8KEo9p3SEeBS8gnztPung][analytics\_01\_2016][3]: RemoteTransportException[[us-east-1e.i-f83a7179][inet[/10.184.204.145:7102]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[analytics\_01\_2016][3]: query[ConstantScore(_:_)],from[-1],size[500]: Parse Failure [Failed to parse source [{"size":500,"sort":{"\_score":"desc"},"highlight":{"pre\_tags":["@kibana-highlighted-field@"],"post\_tags":["@/kibana-highlighted-field@"],"fields":{"_":{}}},"query":{"match\_all":{}},"fields":["_","\_source"],"script\_fields":{"execution\_time":{"script":"doc['end\_timestamp'].value","lang":"expression"}},"fielddata\_fields":}]]]; nested: IncompatibleClassChangeError[org/objectweb/asm/commons/GeneratorAdapter]; }{[i8KEo9p3SEeBS8gnztPung][analytics\_01\_2016][4]: RemoteTransportException[[us-east-1e.i-f83a7179][inet[/10.184.204.145:7102]][indices:data/read/search[phase/query]]]; nested: SearchParseException[[analytics\_01\_2016][4]: query[ConstantScore(_:_)],from[-1],size[500]: Parse Failure [Failed to parse source [{"size":500,"sort":{"\_score":"desc"},"highlight":{"pre\_tags":["@kibana-highlighted-field@"],"post\_tags":["@/kibana-highlighted-field@"],"fields":{"_":{}}},"query":{"match\_all":{}},"fields":["_","\_source"],"script\_fields":{"execution\_time":{"script":"doc['end\_timestamp'].value","lang":"expression"}},"fielddata\_fields":}]]]; nested: IncompatibleClassChangeError[org/objectweb/asm/commons/GeneratorAdapter]; }]"}"

---

<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:** [July 6, 2017, 2:04pm UTC](https://discuss.elastic.co/t/discover-cannot-read-property-indexof-of-undefined/28345/4 "2017-07-06T14:04:56Z")

</div>


