Flying Sphinx rebuild error - rake aborted! can't dup NilClass

Mark Walker's Avatar

Mark Walker

13 Jan, 2014 05:04 PM

I am running into an error that I don't understand in production, when I do:

heroku run rake fs:rebuild --app myapp --trace

I am getting this error:

rake aborted!
can't dup NilClass

Below is the full trace. Everything works fine in my dev environment.

Can someone offer help on debugging or let me know if you've come across this before?

/app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/configuration.rb:61:in dup' /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/configuration.rb:61:inhost_from_env' /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/configuration.rb:48:in rescue in set_from_server' /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/configuration.rb:38:inset_from_server' /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/configuration.rb:8:in initialize' /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/cli.rb:26:innew' /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/cli.rb:26:in configuration' /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/cli.rb:74:instop' /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/cli.rb:20:in block in run' /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/cli.rb:20:ineach' /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/cli.rb:20:in all?' /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/cli.rb:20:inrun' /app/vendor/bundle/ruby/1.9.1/gems/flying-sphinx-0.8.4/lib/flying_sphinx/tasks.rb:19:in block (2 levels) in ' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:incall' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:236:in block in execute' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:ineach' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:231:in execute' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:175:inblock in invoke_with_call_chain' /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:168:ininvoke_with_call_chain' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/task.rb:161:in invoke' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:149:ininvoke_task' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in block (2 levels) in top_level' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:ineach' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in block in top_level' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:115:inrun_with_threads' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:100:in top_level' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:78:inblock in run' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:165:in standard_exception_handling' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:75:inrun' /app/vendor/bundle/ruby/1.9.1/gems/rake-10.1.0/bin/rake:33:in ' /app/vendor/bundle/ruby/1.9.1/bin/rake:23:inload' /app/vendor/bundle/ruby/1.9.1/bin/rake:23:in `' Tasks: TOP => fs:rebuild

  1. Support Staff 1 Posted by Pat Allan on 13 Jan, 2014 08:49 PM

    Pat Allan's Avatar

    Hi Mark

    Firstly: I'd highly recommend upgrading flying-sphinx to 1.0.0, as it's far more reliable than the earlier releases. The version of Thinking Sphinx you're using may need to be upgraded as well though to ensure things are working smoothly (to at least 2.1.0 if you're using a 2.x release).

    Secondly: I'm pretty sure this bug is dealt with in flying-sphinx 1.0.0, but it's an indication that the expected ENV variables don't seem to exist. Can you run heroku config for your app and confirm that there are four variables with the FLYING_SPHINX_ prefix?

    Thanks

    Pat

  2. 2 Posted by Mark Walker on 13 Jan, 2014 10:05 PM

    Mark Walker's Avatar

    Hi Pat,

    Thanks for the reply.

    I've updated my gemfile to flying sphinx 1.0.0 and thinking sphinx 2.1.0, but now get this new error:

    undefined method match' for nil:NilClass /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/socket.rb:158:inis_private_channel' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/socket.rb:138:in authorize' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/socket.rb:102:insubscribe' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/socket.rb:132:in block in subscribe_all' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/socket.rb:131:ineach' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/socket.rb:131:in subscribe_all' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/socket.rb:36:inblock in initialize' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/channel.rb:30:in call' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/channel.rb:30:inblock in dispatch' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/channel.rb:29:in each' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/channel.rb:29:indispatch' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/channel.rb:22:in dispatch_with_all' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/socket.rb:201:insend_local_event' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/socket.rb:73:in block (2 levels) in connect' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/socket.rb:67:inloop' /app/vendor/bundle/ruby/1.9.1/gems/pusher-client-0.4.0/lib/pusher-client/socket.rb:67:in `block in connect'

  3. Support Staff 3 Posted by Pat Allan on 13 Jan, 2014 10:23 PM

    Pat Allan's Avatar

    Hi Mark

    Just coming back to the second point of my previous message - do the FLYING_SPHINX_* config variables exist in your app?

  4. 4 Posted by Mark Walker on 13 Jan, 2014 10:49 PM

    Mark Walker's Avatar

    Hi Pat,

    No, it doesn't seem those variables do exist right now.

    How can I restore them?

    Thanks

  5. Support Staff 5 Posted by Pat Allan on 13 Jan, 2014 10:50 PM

    Pat Allan's Avatar

    It would seem your app doesn't have the Flying Sphinx add-on added at the moment - I'm not sure how that's the case (I don't have the ability to remove an add-on from a customer's app). You'll need to re-add it, and then run the rebuild task and you should be fine.

  6. 6 Posted by Mark Walker on 13 Jan, 2014 10:58 PM

    Mark Walker's Avatar

    Ok thanks, I'll see why it's been removed and ensure it gets added back in.

  7. Support Staff 7 Posted by Pat Allan on 13 Jan, 2014 11:15 PM

    Pat Allan's Avatar

    Rightio - please do get in touch if there's any issues :)

  8. Pat Allan closed this discussion on 13 Jan, 2014 11:15 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac