heroku run rake fs:index is not working

Ghulam Jilani's Avatar

Ghulam Jilani

09 Feb, 2018 10:26 AM

I have executed both "heroku run rake fs:index" and "heroku run flying-sphinx index" and both hang-up and do not give me any response.

  1. Support Staff 1 Posted by Pat Allan on 09 Feb, 2018 11:49 AM

    Pat Allan's Avatar

    Hi Ghulam,

    Sorry to hear this is happening. Can you let me know what app this is? Also, what versions of thinking-sphinx and flying-sphinx are you using?

    Regards,

    Pat

  2. 2 Posted by Ghulam Jilani on 09 Feb, 2018 11:55 AM

    Ghulam Jilani's Avatar

    I have deployed web application over Heroku.
    Versions:
    thinking-sphinx ~> 3.4.2
    lying-sphinx ~> 1.3

  3. Support Staff 3 Posted by Pat Allan on 09 Feb, 2018 12:35 PM

    Pat Allan's Avatar

    Thanks for those details Ghulam. If you can let me know what the name of the Heroku app is, that’d be great. I’m not aware of any broad issues impacting all customers, so this may be something that’s specific to your app, and I’d like to debug further.

    Cheers,

    Pat

  4. 4 Posted by Ghulam Jilani on 09 Feb, 2018 01:17 PM

    Ghulam Jilani's Avatar

    Name of app is: mama-fu

    here is it's url: http://mama-fu.herokuapp.com

  5. Support Staff 5 Posted by Pat Allan on 09 Feb, 2018 01:27 PM

    Pat Allan's Avatar

    Ah. So, I’m not sure why the indexing calls are hanging, but you don’t need to call that task - it’s only for SQL-backed indices.

    You are using real-time indices, so you should use `heroku run rake fs:regenerate` to rebuild your setup, or `heroku run rake ts:generate` just to update the data in your indices. (I am working on a more consistent interface, so in the next releases of both thinking-sphinx and flying-sphinx you can just call the TS tasks and they’ll perform the appropriate behaviour in the correct environments - locally, or with Flying Sphinx/Heroku - these changes aren’t quite ready though!)

    In the indexed models (Build and Prep, it seems?), you’ll also want to have the real-time callbacks to ensure data is kept up-to-date:
    https://freelancing-gods.com/thinking-sphinx/real_time.html#model-callbacks <https://freelancing-gods.com/thinking-sphinx/real_time.html#model-callbacks>

    I would still recommend having a daily scheduled task calling the `ts:generate` task - just to catch any data alterations that may skip model callbacks.

    If anything’s still confusing, do let me know! Though it’s worth noting - it’s just after midnight here, so my responses may be later in my morning.

    Regards,


    Pat

  6. 6 Posted by Ghulam Jilani on 09 Feb, 2018 03:21 PM

    Ghulam Jilani's Avatar

    I have executed this command . "heroku run rake fs:regenerate" but it throws me this exception:

    ThinkingSphinx::SyntaxError: syntax error, unexpected $undefined, expecting IDENT or ID near '`allergens`, `name`, `procedure`, `estimated_time`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `name_sort`, `procedure_sort`) VALUES (5, '', 'Scallion Garnish 1/16"', 'Get some green onions and slice the green top part into 1/16" little circles', '5 min', 1, 'Prep', 0, 'Scallion Garnish 1/16"', 'Get some green onions and slice the green top part into 1/16" little circles'), (9, '', 'Crab Rangoon Filling', 'Put all that s - REPLACE INTO prep_core (id, `allergens`, `name`, `procedure`, `estimated_time`, `sphinx_internal_id`, `sphinx_internal_class`, `sphinx_deleted`, `name_sort`, `procedure_sort`) VALUES (5, '', 'Scallion Garnish 1/16"', 'Get some green onions and slice the green top part into 1/16" little circles', '5 min', 1, 'Prep', 0, 'Scallion Garnish 1/16"', 'Get some green onions and slice the green top part into 1/16" little circles'), (9, '', 'Crab Rangoon Filling', 'Put all that stuff in a bowl and smoosh it together.', '15 minutes', 2, 'Prep', 0, 'Crab Rangoon Filling', 'Put all that stuff in a bowl and smoosh it together.'), (13, '', 'Lettuce Romaine Shredded', 'After you make the lettuce cups, take the rest of the lettuce that didnt make pretty cups and slice it up', '5 min', 3, 'Prep', 0, 'Lettuce Romaine Shredded', 'After you make the lettuce cups, take the rest of the lettuce that didnt make pretty cups and slice it up')

    Remaining trace:

    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/connection/client.rb:44:in `rescue in perform'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/connection/client.rb:47:in `perform'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/connection/client.rb:30:in `check_and_perform'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/connection/client.rb:11:in `execute'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/real_time/transcriber.rb:21:in `block (2 levels) in copy'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/connection.rb:39:in `block in take'
    /app/vendor/bundle/ruby/2.4.0/gems/innertube-1.1.0/lib/innertube.rb:138:in `take'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/connection.rb:37:in `take'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/real_time/transcriber.rb:20:in `block in copy'
    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:in `block in instrument'
    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
    /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.4/lib/active_support/notifications.rb:166:in `instrument'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/logger.rb:3:in `log'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/real_time/transcriber.rb:19:in `copy'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/real_time/populator.rb:14:in `block in populate'
    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/relation/batches.rb:129:in `block in find_in_batches'
    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/relation/batches.rb:230:in `block in in_batches'
    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/relation/batches.rb:214:in `loop'
    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/relation/batches.rb:214:in `in_batches'
    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/relation/batches.rb:128:in `find_in_batches'
    /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.1.4/lib/active_record/querying.rb:9:in `find_in_batches'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/real_time/populator.rb:13:in `populate'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/real_time/populator.rb:3:in `populate'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/interfaces/real_time.rb:25:in `block in index'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/interfaces/real_time.rb:25:in `each'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/interfaces/real_time.rb:25:in `index'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/tasks.rb:101:in `block (3 levels) in <top (required)>'
    /app/vendor/bundle/ruby/2.4.0/gems/thinking-sphinx-3.4.2/lib/thinking_sphinx/tasks.rb:38:in `block (2 levels) in <top (required)>'
    /app/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
    /app/vendor/bundle/ruby/2.4.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
    /app/bin/bundle:3:in `load'
    /app/bin/bundle:3:in `<main>'

    Caused by:
    Innertube::Pool::BadResource: Innertube::Pool::BadResource

  7. 7 Posted by Ghulam Jilani on 09 Feb, 2018 04:13 PM

    Ghulam Jilani's Avatar

    Do I need to set these values in thinking_sphinx.yml:

    configuration_file: "RAILS_ROOT/config/ENVIRONMENT.sphinx.conf"
      log: "RAILS_ROOT/log/searchd.log"
      query_log: "RAILS_ROOT/log/searchd.query.log"
      pid_file: "RAILS_ROOT/log/searchd.ENVIRONMENT.pid"

    if yes then do let me know how can I generate these files as right now production environment will not have these files. plus how to take path of those files. Thanks

  8. Support Staff 8 Posted by Pat Allan on 10 Feb, 2018 01:04 AM

    Pat Allan's Avatar

    Hi Ghulam,

    I’m not sure what’s happening with the `fs:regenerate` call - does `ts: regenerate`/`ts:rebuild` work fine locally?

    And you don’t need to worry about those configuration settings - Flying Sphinx sets those automatically.


    Pat

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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