Discover: Cannot read property 'indexOf' of undefined

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?

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

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).

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]; }]"}"