jaxxie
jaxxie

Reputation: 141

RSolr::Error::Http: RSolr::Error::Http - 404 Not Found for Rails 4 and Jetty Solr server on Production

I am using Rails 4.0.5 with sunspot_rails 2.1.1. I am having problem with the solr server which I launched with jetty on Production. This is the error I am getting whenever I run rake sunspot:solr:reindex:

rake aborted!
RSolr::Error::Http: RSolr::Error::Http - 404 Not Found
Error:     Not Found

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

Backtrace: /usr/local/rvm/gems/ruby-1.9.3-p484/gems/rsolr-1.0.10/lib/rsolr/client.rb:283:in 'adapt_response'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/rsolr-1.0.10/lib/rsolr/client.rb:190:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/rsolr-1.0.10/lib/rsolr/client.rb:176:in `send_and_receive'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sunspot_rails-2.1.1/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/activesupport-4.0.5/lib/active_support/notifications.rb:159:in `block in instrument'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/activesupport-4.0.5/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/activesupport-4.0.5/lib/active_support/notifications.rb:159:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sunspot_rails-2.1.1/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'`

I have set up my production server following the instruction at http://blogs.pigrider.com/blogs/26.

From the link above, I tried to deploy my solr on jetty which was working well until I upgrade from Rails 3 to Rails 4.

I realise that from the link above, both the 1) solr-jetty server (service solr start) and 2)sunspot_solr server (rake sunspot:solr:start) are started. However, I would want the independent 1) solr-jetty server to run for my rails app.

My config/sunspot.yml file is as such:

production:
  solr:
    hostname: localhost
    port: 8983
    log_level: WARNING
    path: /opt/solr
    solr_home: /opt/solr/solr/collection1

    # read_timeout: 2
    # open_timeout: 0.5

development:
  solr:
    hostname: localhost
    port: 8982
    log_level: INFO
    path: /solr/development

test:
  solr:
    hostname: localhost
    port: 8981
    log_level: WARNING
    path: /solr/test

Notice that I have set both the path and solr_home to what I think works for my configuration when I follow the instruction from the blog.

I have also checked the log fiel under /opt/solr/logs/solr.log. The log does not capture anything when the 404 error is returned from reindex command.

Strangely when I stop my 1) solr-jetty server (service solr stop) and run 2) sunspot_solr, it works (rake sunspot:solr:start). But of course I would not want to use the sunspot_solr server for my production since everytime the service is stop, i would need to reindex again.

My gem list is as such:

sunspot (2.1.1)
sunspot_rails (2.1.1)
sunspot_solr (2.1.1)
rsolr (1.0.10)

I am suspecting that my sunspot.yml file is wrongly configured but I have tried multiple times to change them but the server keep returning 404 error.

The other solution elsewhere in stackoverflow is not working for me. 1 week is spent on this issue but still not solved :( Appreciate any solr/rails expert to help.

Upvotes: 3

Views: 2394

Answers (1)

jaxxie
jaxxie

Reputation: 141

Problem solved! Based on the blog, the solr server would be install under collection1, so the path and solr_home should be 'path: /solr/collection1' and 'solr_home: solr'

Upvotes: 3

Related Questions