14

Everytime i try to reindex using...

rake sunspot:solr:reindex

These error messages always show:

Error - RSolr::Error::Http - 500 Internal Server Error - retrying... Error - RSolr::Error::Http - 500 Internal Server Error - ignoring... Error - RSolr::Error::Http - 500 Internal Server Error - retrying... Error - RSolr::Error::Http - 500 Internal Server Error - ignoring...

I tried to stop then start using...

rake sunspot:solr:stop
rake sunspot:solr:start

But nothing happened.

And now everytime I try to run my app in localhost...

This is the error:

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:Trip</query></delete>"

A more detailed error message than the one I had in terminal.

I tried plenty of solutions from the net like setting Abort Configuration to false, but nothing happened.

The error still persists.

Any work around will be appreciated.

xirukitepe
  • 1,575
  • 7
  • 26
  • 54
  • 1
    there is a problem in your configuration file. You would need to check for error during Solr startup to be able to get it working. – Jayendra Nov 12 '12 at 10:48
  • By the way, this was solved already. Thanks for the idea. I restarted my pc and it worked fine – xirukitepe Dec 27 '12 at 06:54

9 Answers9

34

The solution:

  1. rake sunspot:solr:stop
  2. rm -rvf solr (Delete your /solr directory)
  3. rake sunspot:solr:start
  4. rake sunspot:solr:reindex

Enjoy

professormeowingtons
  • 3,504
  • 7
  • 36
  • 50
6

Based on the answer provided by @professormeowingtons, what worked for me in production is the following:

  1. $ rake sunspot:solr:stop RAILS_ENV=production
  2. $ rm -rvf solr # delete your /solr directory
  3. $ sudo reboot # reboot the machine RAILS_ENV=production
  4. $ rake sunspot:solr:start RAILS_ENV=production
  5. $ rake sunspot:solr:reindex RAILS_ENV=production
Damian Kozlak
  • 7,065
  • 10
  • 45
  • 51
Mingming
  • 2,189
  • 20
  • 21
  • $ ps aux | grep solr ec2-user 1617 12.6 4.4 1618868 76328 ? Ssl 08:00 0:13 java -Djetty.port=8983 -Dsolr.data.dir=/home/ec2-user/app_name/releases/20150613071155/solr/data/production -Dsolr.solr.home=/home/ec2-user/app_name/releases/20150613071155/solr -Djava.util.logging.config.file=/tmp/logging.properties20150613-1617-1q3demw -Djava.awt.headless=true -jar start.jar ec2-user 1738 0.0 0.0 110268 840 pts/0 S+ 08:02 0:00 grep solr I am getting 404. I tried all possible path in sunspot.yml – sagar junnarkar Jun 13 '15 at 08:05
4

With reference to @professormeowingtons, you don't have to delete entire solr directory as you might not want to delete your solr configurations like schema.xml and solrconfig.xml. The reason you are getting error might be because of corrupted indexes, what you can do is delete 'solr/env' i.e. solr/development or/and solr/data/development and restart solr server.

 1. rake sunspot:solr:stop

 2. rm -rf solr/development (Delete your solr/development directory)

 3. rm -rf solr/data/development

 4. rake sunspot:solr:start

 5. rake sunspot:solr:reindex

If problem still persists, rollback your recent changes because you might have added some wrong configurations.

Datt
  • 851
  • 9
  • 21
1

I've got this working by restarting my PC. I guess there was a solr instance incorrectly stopped :-?

vladCovaliov
  • 4,333
  • 2
  • 43
  • 58
0

This means there is a problem in your config file and solr couldn't start. Check the sunspot logs.

s01ipsist
  • 3,022
  • 2
  • 32
  • 36
0

Check your sunspot server by localhost:8982 (depelopment). if you get same error like console. try again by localhost:8983 (production). for my case, port 8983 is work fine and I change sunspot config at rails/config/sunspot.yml to port :8983. and solved.

0

Upgrade Rsolr gem to latest version, 1.0.10.pre1, that worked for me.

Now I was able to reindex my models, and everything seems fine, in production that is.

znowm4n
  • 21
  • 3
0

For those of you that are using Websolr in Heroku production and getting this error when reindexing:

Remember that you have to upload your schema.xml manually in the Websolr admin GUI, under the "Advanced Configuration" tab when viewing your index. Here's the direct link: https://websolr.com/slices/<index_uri>/schema

You can get the <index_uri> from running heroku config and getting it from the last part of your WEBSOLR_URL that looks like this: http://index.websolr.com/solr/<index_uri>

I ran into this error because I mistakenly assumed that Websolr would just use the schema.xml that I committed to git and pushed to heroku together with all the other <appname>/solr/conf files.

Magne
  • 16,401
  • 10
  • 68
  • 88
0

The essence is to reset every sunspot solr part, that may occur problems.

Delete the complete solr directory. This deletes the complete solr directory for sure - double check!

rm -rf solr

Delete the sunspot solr configuration file config/sunspot.yml.

rm config/sunspot.yml

Stop sunspot solr.

bundle exec rake sunspot:solr:stop

Check if sunspot solr is no longer running. If there are solr processes running note there PID

ps aux | grep solr

Manually kill the solr processes by PID. This command is only needed if bundle exec rake sunspot:solr:stop wasn't successful.

kill -9 PID # (fully turns off solr - double check `ps aux|grep solr`)

Delete your database, double check if you really sure! Then recreate the database and restore the schema from the migration files.

bundle exec rake db:drop
bundle exec rake db:create
bundle exec rake db:migrate

creates a new sunspot configuration config/sunspot.yml.

rails generate sunspot_rails:install

recreates the solr directory

bundle exec rake sunspot:solr:start

create a new solr index

bundle exec rake sunspot:reindex

Finally refill the empty database with your seed data.

bundle exec rake db:seed
zzeroo
  • 5,466
  • 4
  • 33
  • 49
이종원
  • 9
  • 2
  • 1
    Add some explanation with answer for how this answer help OP in fixing current issue – ρяσѕρєя K Jan 22 '17 at 13:22
  • dropping the database should not be a recommended step for a process like this. Users may accidently drop production databases if they follow these steps. – Gary Jul 02 '19 at 21:58