1

I'm going to setup solr on ubuntu server on production mode. I'm using rails 5.1.1, solr 6.5.1.

I've been running into an error below:

$RAILS_ENV=production bundle exec rake sunspot:solr:reindex
rake aborted!
RSolr::Error::Http: RSolr::Error::Http - 404 Not Found
Error:     Not Found

URI: http://localhost:8983/solr/production/update?wt=json
Request Headers: {"Content-Type"=>"application/json"}
Request Data: "{\"delete\":{\"query\":\"type:Address\"}}"

Backtrace: /home/deployer/apps/fpp/shared/bundle/ruby/2.4.0/gems/rsolr-2.0.2/lib/rsolr/client.rb:195:in `rescue in execute'
/home/deployer/apps/fpp/shared/bundle/ruby/2.4.0/gems/rsolr-2.0.2/lib/rsolr/client.rb:185:in `execute'
/home/deployer/apps/fpp/shared/bundle/ruby/2.4.0/gems/rsolr-2.0.2/lib/rsolr/client.rb:180:in `send_and_receive'
/home/deployer/apps/fpp/shared/bundle/ruby/2.4.0/gems/sunspot_rails-2.2.7/lib/sunspot/rails/solr_instrumentation.rb:16:in `block in send_and_receive_with_as_instrumentation'
/home/deployer/apps/fpp/shared/bundle/ruby/2.4.0/gems/activesupport-5.1.1/lib/active_support/notifications.rb:166:in `block in instrument'
/home/deployer/apps/fpp/shared/bundle/ruby/2.4.0/gems/activesupport-5.1.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/deployer/apps/fpp/shared/bundle/ruby/2.4.0/gems/activesupport-5.1.1/lib/active_support/notifications.rb:166:in `instrument'
/home/deployer/apps/fpp/shared/bundle/ruby/2.4.0/gems/sunspot_rails-2.2.7/lib/sunspot/rails/solr_instrumentation.rb:15:in `send_and_receive_with_as_instrumentation'
(eval):2:in `post'

And my sunspot.yml:

production:
  solr:
    hostname: localhost
    port: 8983
    log_level: WARNING
    path: /solr/production
    #solr_home: solr
    # 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

I've tried numerous other suggestions on SO but nothing seems to be fixing to my issue. I have no experience with sunspot so indepth answers are most welcome.

miken32
  • 42,008
  • 16
  • 111
  • 154
Pooja
  • 45
  • 8

1 Answers1

0

404 error with sunspot-solr is usually a problem of files missing.

check that the file solr/#{ENV}/core.properties was copied properly. Content of the file for each environment should be :

name=YOUR_ENV
configSet=sunspot
dataDir=./data

The data folder should also be present in your solr/#{ENV}/ folders.

Samuel-Zacharie Faure
  • 1,047
  • 11
  • 26