Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't reindex with sunspot / solr in rails app - Error: Severe errors in solr configuration

Ok, so I have a simple rails application and now i'm trying to implement sunspot for search capabilities. However, after I've generated the config file with rails g sunspot_rails:install and after I've started the server and it has made the solr-dir in my rails app-dir and i run bundle exec rake sunspot:solr:reindex I get the following trace:

cakism@saraswati:~/railscode/calendar$ bundle exec rake sunspot:solr:reindex --trace
** Invoke sunspot:solr:reindex (first_time)
** Invoke sunspot:reindex (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute sunspot:reindex
Skipping progress bar: for progress reporting, add gem 'progress_bar' to your Gemfile
rake aborted!
RSolr::Error::Http - 500 Internal Server Error
Error: 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:

 <abortOnConfigurationError>false</abortOnConfigurationError>

in null

-------------------------------------------------------------

Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><delete><query>type:Event</query></delete>"

Backtrace: /var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:230:in `adapt_response'
/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:167:in `execute'
/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:161:in `send_and_receive'
(eval):2:in `post'
/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:67:in `update'
/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:131:in `delete_by_query'
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/indexer.rb:55:in `remove_all'
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session.rb:181:in `remove_all'
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session.rb:181:in `each'
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session.rb:181:in `remove_all'
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'
/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:230:in `adapt_response'
/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:167:in `execute'
/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:161:in `send_and_receive'
(eval):2:in `post'
/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:67:in `update'
/var/lib/gems/1.8/gems/rsolr-1.0.7/lib/rsolr/client.rb:131:in `delete_by_query'
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/indexer.rb:55:in `remove_all'
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session.rb:181:in `remove_all'
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session.rb:181:in `each'
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session.rb:181:in `remove_all'
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:in `remove_all'
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot.rb:464:in `remove_all'
/var/lib/gems/1.8/gems/sunspot_rails-1.3.0/lib/sunspot/rails/searchable.rb:178:in `solr_remove_all_from_index'
/var/lib/gems/1.8/gems/sunspot_rails-1.3.0/lib/sunspot/rails/searchable.rb:197:in `solr_reindex'
/var/lib/gems/1.8/gems/sunspot_rails-1.3.0/lib/sunspot/rails/tasks.rb:54
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/class_set.rb:16:in `each'
/var/lib/gems/1.8/gems/sunspot-1.3.0/lib/sunspot/class_set.rb:16:in `each'
/var/lib/gems/1.8/gems/sunspot_rails-1.3.0/lib/sunspot/rails/tasks.rb:53
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `execute'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `invoke_prerequisites'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `top_level'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `run'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/var/lib/gems/1.8/gems/rake-0.9.2.2/bin/rake:33
/var/lib/gems/1.8/bin/rake:19:in `load'
/var/lib/gems/1.8/bin/rake:19
Tasks: TOP => sunspot:solr:reindex => sunspot:reindex

I am specially curious about this:

If you want solr to continue after configuration errors, change:

 <abortOnConfigurationError>false</abortOnConfigurationError>

in null

Why would it say in null? Other posts with the same problem as I have has specified the solr/conf/solrconfig.xml, and also, when I change it to false, nothing else happens.

If I remove the searchable block from my model, I don't get any error (but I suppose that's because it doesn't try to do anything then)

I've run the config file through an XML validator, and it says it's bad start-tag name at 2<-1 5<-2 6<90%. However, even if I remove the lines which then gives a valid XML, restart solr, and try to reindex, I still get the same error.

I'm starting to get desperate here, so any help is greatly appriciated!

like image 819
cakism Avatar asked Mar 14 '12 09:03

cakism


2 Answers

I was having a very similar problem and solved it by

  • stopping all running solr processes
  • removing the solr folder
  • turn off/restart the computer
  • gem uninstall all related gems
  • bundle install
  • start solr
  • reindex solr
like image 152
Austin Wang Avatar answered Oct 16 '22 00:10

Austin Wang


it happened to me occasionally.. in my case it was solr (not sunspot) issue

try to go to

http://localhost:8982/solr/admin

or http://localhost:8983/solr/admin

or http://[your.domain]:8983/solr/admin

(depending on what environment you use)

to see what error you have under solr web server

i saw the java error message and fixed it with just deleting index directory and restarting solr

and it began to behave as expected

hope it helped

like image 39
okliv Avatar answered Oct 15 '22 22:10

okliv