rashidkpc / kibana2

Kibana was acquired by Elastic in 2013. See elastic/kibana. More info at http://kibana.org
Other
1.19k stars 245 forks source link

NoMethodError - undefined method `first' for "_all":String #177

Open s3u opened 12 years ago

s3u commented 12 years ago

I see the following in the logs whenever I select "All" and hit "Search".

NoMethodError - undefined method first' for "_all":String: /usr/share/kibana/rashidkpc-Kibana-41a1298/lib/kelastic.rb:247:ininitialize' kibana.rb:66:in new' kibana.rb:66:inblock in

' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:in call' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1265:inblock in compile!' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in []' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:inblock (3 levels) in route!' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:851:in route_eval' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:inblock (2 levels) in route!' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:872:in block in process_route' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:incatch' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in process_route' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:834:inblock in route!' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in each' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:inroute!' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:936:in dispatch!' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:inblock in call!' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in block in invoke' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:incatch' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in invoke' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:incall!' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:755:in call' /var/lib/gems/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:incall' /var/lib/gems/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:in call' /var/lib/gems/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:incall' /var/lib/gems/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb:16:in call' /var/lib/gems/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb:17:incall' /var/lib/gems/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:in call' /var/lib/gems/1.9.1/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:incall' /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in context' /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:incall' /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/logger.rb:15:in call' /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/commonlogger.rb:20:incall' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:136:in call' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:129:incall' /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/head.rb:9:in call' /var/lib/gems/1.9.1/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:incall' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/showexceptions.rb:21:in call' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:99:incall' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1389:in block in call' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1471:insynchronize' /var/lib/gems/1.9.1/gems/sinatra-1.3.3/lib/sinatra/base.rb:1389:in call' /var/lib/gems/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:81:inblock in pre_process' /var/lib/gems/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:79:in catch' /var/lib/gems/1.9.1/gems/thin-1.5.0/lib/thin/connection.rb:79:inpre_process' /var/lib/gems/1.9.1/gems/eventmachine-1.0.0/lib/eventmachine.rb:1037:in call' /var/lib/gems/1.9.1/gems/eventmachine-1.0.0/lib/eventmachine.rb:1037:inblock in spawn_threadpool'

s3u commented 12 years ago

The offending line is

index = indices.first

Looks like an array check is missing.