RSolr RequestError Solr响应solr配置中的严重错误

时间:2010-09-11 12:09:01

标签: ruby-on-rails ruby solr sunspot

当我突然关闭我的mac时,我正在重新索引我的模型, 当我尝试在脚本/控制台中使用(Model_name).reindex再次重新索引时,我遇到了一个我之前没有遇到过的错误。

RSolr::RequestError: Solr Response: Severe_errors_in_solr_configuration__Check_your_log_files_for_more_detailed_information_on_what_may_be_wrong__If_you_want_solr_to_continue_after_configuration_errors_change____abortOnConfigurationErrorfalseabortOnConfigurationError__in_null___javalangRuntimeException_javaioIOException_read_past_EOF__at_orgapachesolrcoreSolrCoregetSearcherSolrCorejava1068__at_orgapachesolrcoreSolrCoreinitSolrCorejava579__at_orgapachesolrcoreCoreContainer$InitializerinitializeCoreContainerjava137__at_orgapachesolrservletSolrDispatchFilterinitSolrDispatchFilterjava83__at_orgmortbayjettyservletFilterHolderdoStartFilterHolderjava99__at_orgmortbaycomponentAbstractLifeCyclestartAbstractLifeCyclejava40__at_orgmortbayjettyservletServletHandlerinitializeServletHandlerjava594__at_orgmortbayjettyservletContextstartContextContextjava139__at_orgmortbayjettywebappWebAppContextstartContextWebAppContextjava1218__at_orgmortbayjettyhandlerContextHandlerdoStartContextHandlerjava500__at_orgmortbayjettywebappWebAppContextdoStartWebAppContextjava448__at_orgmortbaycomponentAbstractLifeCyclestartAbstractLifeCyclejava40__at_orgmortbayjettyhandlerHandlerCollectiondoStartHandlerCollectionjava147__at_orgmortbayjettyhandlerContextHandlerCollectiondoStartContextHandlerCollectionjava161__at_orgmortbaycomponentAbstractLifeCyclestartAbstractLifeCyclejava40__at_orgmortbayjettyhandlerHandlerCollectiondoStartHandlerCollectionjava147__at_orgmortbaycomponentAbstractLifeCyclestartAbstractLifeCyclejava40__at_orgmortbayjettyhandlerHandlerWrapperdoStartHandlerWrapperjava117__at_orgmortbayjettyServerdoStartServerjava210__at_orgmortbaycomponentAbstractLifeCyclestartAbstractLifeCyclejava40__at_orgmortbayxmlXmlConfigurationmainXmlConfigurationjava929__at_sunreflectNativeMethodAccessorImplinvoke0Native_Method__at_sun
        from /usr/local/lib/ruby/gems/1.8/gems/rsolr-0.12.1/lib/rsolr/connection/requestable.rb:39:in `request'
        from /usr/local/lib/ruby/gems/1.8/gems/rsolr-0.12.1/lib/rsolr/client.rb:34:in `request'
        from /usr/local/lib/ruby/gems/1.8/gems/rsolr-0.12.1/lib/rsolr/client.rb:22:in `update'
        from /usr/local/lib/ruby/gems/1.8/gems/rsolr-0.12.1/lib/rsolr/client.rb:76:in `delete_by_query'
        from /usr/local/lib/ruby/gems/1.8/gems/sunspot-1.1.0/lib/sunspot/indexer.rb:55:in `remove_all'
        from /usr/local/lib/ruby/gems/1.8/gems/sunspot-1.1.0/lib/sunspot/session.rb:173:in `remove_all'
        from /usr/local/lib/ruby/gems/1.8/gems/sunspot-1.1.0/lib/sunspot/session.rb:173:in `each'
        from /usr/local/lib/ruby/gems/1.8/gems/sunspot-1.1.0/lib/sunspot/session.rb:173:in `remove_all'
        from /usr/local/lib/ruby/gems/1.8/gems/sunspot-1.1.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'
        from /usr/local/lib/ruby/gems/1.8/gems/sunspot-1.1.0/lib/sunspot.rb:414:in `remove_all'
        from /Users/cecilleann/Projects/dhire2/vendor/plugins/sunspot_rails-1.1.0/lib/sunspot/rails/searchable.rb:164:in `solr_remove_all_from_index'
        from /Users/cecilleann/Projects/dhire2/vendor/plugins/sunspot_rails-1.1.0/lib/sunspot/rails/searchable.rb:183:in `reindex'
        from (irb):6

现在我无法解决错误。请帮我。我不能动一个。 非常感谢提前

2 个答案:

答案 0 :(得分:5)

检查运行进程以验证tmp文件指向的位置,然后停止sunspot-solr进程并最终删除该tmp文件。

例如:

ps -ef | grep sunspot
ps -ef | grep solr
501 53845     1   0   0:00.42 ??         0:02.99 /usr/bin/java 
-Dsolr.data.dir=/var/folders/QJ/QJJ4EWSXEpOEtXE8SN7iS++++TI/-Tmp- 
-Dsolr.solr.home=/Users/aldonievas/.rvm/gems/ruby-1.9.2-p0/gems/sunspot-1.1.0/solr/solr 
-jar start.jar

所以你应该删除文件/var/folders/QJ/QJJ4EWSXEpOEtXE8SN7iS++++TI/-Tmp-

然后再次启动该过程。它应该工作。

答案 1 :(得分:5)

索引文件夹可能已损坏且solr达到“死锁”状态,solr配置没有任何问题。 这就是我所做的:

  • 我删除了solr索引文件夹。
  • 将solrconfig.xml中的以下属性更改为false:

      <abortOnConfigurationError>false</abortOnConfigurationError>
    
  • 运行时重新启动solr
  • reindexed solr;
  • 将abortOnConfigurationError属性设置为原始值;
  • 再次重新索引,以确保让abortOnConfigurationError=false没有让我得到错误的索引。