ts:rebuild/ts:stop/ts:start not working on heroku
Hi there,
I am trying to run ts:rebuild after updating some indexes. I get the following error on heroku:
heroku run -s performance-m -a app bundle exec rake ts:rebuild
....
rake aborted!
NoMethodError: undefined method pid' for #<FlyingSphinx::Controller:0x00007fcd0a04a9a0>
/app/vendor/bundle/ruby/2.6.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/commands/stop.rb:8:in
call'
/app/vendor/bundle/ruby/2.6.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/commands/base.rb:9:in call_with_handling'
/app/vendor/bundle/ruby/2.6.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/commands/base.rb:5:in
call'
/app/vendor/bundle/ruby/2.6.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/interfaces/daemon.rb:25:in stop'
/app/vendor/bundle/ruby/2.6.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/tasks.rb:70:in
block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.6.0/gems/bugsnag-5.5.0/lib/bugsnag/rake.rb:12:in execute_with_bugsnag'
/app/vendor/bundle/ruby/2.6.0/gems/rake-13.0.3/exe/rake:27:in
<top (required)>'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in load'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:74:in
kernel_load'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli/exec.rb:28:in run'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:463:in
exec'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in
invoke_command'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor.rb:387:in dispatch'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:27:in
dispatch'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/vendor/thor/lib/thor/base.rb:466:in start'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/cli.rb:18:in
start'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/exe/bundle:30:in block in <top (required)>'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/friendly_errors.rb:124:in
with_friendly_errors'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/exe/bundle:22:in <top (required)>'
/app/bin/bundle:3:in
load'
/app/bin/bundle:3:in `<main>'
Tasks: TOP => ts:rebuild => ts:stop
(See full trace by running task with --trace)
Version :
# Sphinx
gem 'flying-sphinx', '~> 1.3'
gem 'mysql2', '~> 0.5.3'
gem 'thinking-sphinx', '~> 3.4'
Looking at the code I can see this line :
searchd.pid_file = log_root.join("#{environment}.sphinx.pid").to_s
in lib/thinking_sphinx/configuration.rb
It looks like thinking-sphinx is trying to find the pid file in log/production.sphinx.pid
, which doesn't exist on the heroku dyno.
I am not sure what to do here ?? do I need to run the rake task in a specific dyno ??
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
Support Staff 1 Posted by Pat Allan on 20 Jun, 2022 03:51 AM
Hi Gaetan
Because you're using old versions of both the
thinking-sphinx
andflying-sphinx
gems, you can't use the standardts:
rake tasks. Instead, you'll need to use the legacyfs:
equivalents. For example:heroku run -s performance-m -a app bundle exec rake fs:rebuild
.Certainly, upgrading the gems is recommended (and there is documentation specifically for moving thinking-sphinx from v3 to v4, and v4 to v5), but I understand that's perhaps not a priority for you! For what it's worth: upgrading thinking-sphinx to v4 should allow you to use the latest flying-sphinx release and the standard
ts:
rake tasks.Kind regards,
Pat
2 Posted by Gaetan on 20 Jun, 2022 05:10 AM
Thanks for the speedy response Pat!
I believe
fs:regenerate
is what I am after.Upgrading is definitely in the pipeline, you know one day :)