Closed wazoo closed 11 years ago
@wazoo based on the stack trace I don't think this is an issue with sunspot-queue, I would take a look at app/models/account.rb line 66 as that's the first of your code that is being executed.
You might be able to debug with something like this from rails console:
include Sunspot::Queue::Helper
without_proxy do
Account.find([id]).index
end
Thats what I thought, but I wanted to start here since I can index successfully with foreground indexing.
I tried to include that module and I get initialized constant?
gem list | grep sunspot
sunspot (1.3.3)
sunspot-queue (0.10.0)
sunspot_rails (1.3.3)
sunspot_solr (1.3.3)
gem list | grep resque
resque (1.23.0)
resque-loner (1.2.1)
rails (3.2.12)
ruby-1.9.3-p362
The line in that file is:
text :contracts do
contracts.map {|c| c.contractnumber}
end
That is a relationship as defined in account.rb:
has_many :business_units
has_many :contracts, through: :business_units
Thoughts? Again, thanks for the help, I have been pulling my hair out.
Okay, just for your future debugging, I figured it out, solution here:
Glad you figured it out. :metal:
When I try to run a task (in this case via Account.index) every single task fails with this, I have no idea why it is loading the controllers in my app to do this. The methods sort_column, fetch_people, and people that it is trying to run are all involved in fetching json for something else, is it trying to read json from the index action or something?
/Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/activemodel-3.2.12/lib/active_model/attribute_methods.rb:407:in
method_missing' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/activerecord-3.2.12/lib/active_record/attribute_methods.rb:149:in
method_missing' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/util.rb:241:in__proxy_method__' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/util.rb:236:in
method_missing' /Users/wazoo/projects/serenity/app/controllers/people_controller.rb:241:insort_column' /Users/wazoo/projects/serenity/app/controllers/people_controller.rb:222:in
fetch_people' /Users/wazoo/projects/serenity/app/controllers/people_controller.rb:207:inpeople' /Users/wazoo/projects/serenity/app/models/account.rb:66:in
block (2 levels) in class:Account' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/util.rb:208:ininstance_eval' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/util.rb:208:in
instance_eval_with_context' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/util.rb:86:ininstance_eval_or_call' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/data_extractor.rb:33:in
value_for' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/field_factory.rb:58:inpopulate_document' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/indexer.rb:95:in
block in prepare' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/indexer.rb:94:ineach' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/indexer.rb:94:in
prepare' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/indexer.rb:24:inblock in add' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/indexer.rb:24:in
map' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/indexer.rb:24:inadd' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/session.rb:91:in
index' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot/session_proxy/abstract_session_proxy.rb:11:inindex' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-1.3.3/lib/sunspot.rb:184:in
index' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot_rails-1.3.3/lib/sunspot/rails/searchable.rb:372:insolr_index' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-queue-0.10.0/lib/sunspot/queue/resque/index_job.rb:13:in
block in perform' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-queue-0.10.0/lib/sunspot/queue/helpers.rb:15:inwithout_proxy' /Users/wazoo/.rvm/gems/ruby-1.9.3-p362@serenity/gems/sunspot-queue-0.10.0/lib/sunspot/queue/resque/index_job.rb:12:in
perform'I have looked for everything that I could possibly think of to figure this error out but I cant find anything.