← Back to Upcase

Cannot connect to Solr from Rails Console


(Hunt Norment) #1
#sunspot.yml
production:
  solr:
    hostname: localhost
    port: 8983
    log_level: WARNING
    path: /solr/production
    # 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

Command line: bundle exec rake sunspot:solr:start #seemed to work ok

In Rails Console with the error messages:

TextShout.reindex
RSolr::Error::ConnectionRefused: Connection refused - {:data=>"{“delete”:{“query”:“type:TextShout”}}", :headers=>{“Content-Type”=>“application/json”}, :method=>:post, :params=>{:wt=>:json}, :query=>“wt=json”, :path=>“update”, :uri=>#<URI::HTTP http://localhost:8982/solr/development/update?wt=json>}
from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rsolr-2.1.0/lib/rsolr/client.rb:194:in rescue in execute' from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rsolr-2.1.0/lib/rsolr/client.rb:186:inexecute’
from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rsolr-2.1.0/lib/rsolr/client.rb:181:in send_and_receive' D, [2018-01-07T16:46:40.459915 #11707] DEBUG -- : from /Users/rhnorment/.rbenv/versions/SOLR Request (42.5ms)2.3. [ path=1update/lib/ruby/gems/2.3 parameters={} ] .0/gems/sunspot_rails-2.2.7/lib/sunspot/rails/solr_instrumentation.rb:16:inblock in send_and_receive_with_as_instrumentation’
from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.6/lib/active_support/notifications.rb:164:in block in instrument' from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.6/lib/active_support/notifications/instrumenter.rb:21:ininstrument’
from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-5.0.6/lib/active_support/notifications.rb:164:in instrument' from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sunspot_rails-2.2.7/lib/sunspot/rails/solr_instrumentation.rb:15:insend_and_receive_with_as_instrumentation’
from (eval):2:in post' from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rsolr-2.1.0/lib/rsolr/client.rb:84:inupdate’
from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rsolr-2.1.0/lib/rsolr/client.rb:147:in delete_by_query' from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sunspot-2.2.7/lib/sunspot/indexer.rb:68:inremove_all’
from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sunspot-2.2.7/lib/sunspot/session.rb:197:in block in remove_all' from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sunspot-2.2.7/lib/sunspot/session.rb:197:ineach’
from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sunspot-2.2.7/lib/sunspot/session.rb:197:in remove_all' from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sunspot-2.2.7/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:inremove_all’
from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sunspot-2.2.7/lib/sunspot.rb:502:in remove_all' from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sunspot_rails-2.2.7/lib/sunspot/rails/searchable.rb:190:insolr_remove_all_from_index’
from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sunspot_rails-2.2.7/lib/sunspot/rails/searchable.rb:209:in solr_reindex' from (irb):1 from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.6/lib/rails/commands/console.rb:65:instart’
from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.6/lib/rails/commands/console_helper.rb:9:in start' from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.6/lib/rails/commands/commands_tasks.rb:78:inconsole’
from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.6/lib/rails/commands/commands_tasks.rb:49:in run_command!' from /Users/rhnorment/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-5.0.6/lib/rails/commands.rb:18:in<top (required)>'
from /Users/rhnorment/Documents/projects/shoutr/bin/rails:4:in require' from /Users/rhnorment/Documents/projects/shoutr/bin/rails:4:in<top (required)>'
from -e:1:in load' from -e:1:in