pat / thinking-sphinx

Sphinx/Manticore plugin for ActiveRecord/Rails
http://freelancing-gods.com/thinking-sphinx
MIT License
1.63k stars 468 forks source link

Need help with ( Sphinx command failed to execute ) #1180

Closed Azzawie closed 3 years ago

Azzawie commented 4 years ago

Hello, I'm receiving this error after upgrading to rails 5.0 and ruby 2.5

  1) Contacts header has a count
     Failure/Error: ThinkingSphinx::Test.index 'contact_core', 'contact_delta'

     Riddle::CommandFailedError:
       Sphinx command failed to execute

This is my spec_helper

 config.before(:suite) do
    # Ensure sphinx directories exist for the test environment
    ThinkingSphinx::Test.init
    # Configure and start Sphinx, and automatically
    # stop Sphinx at the end of the test suite.
    ThinkingSphinx::Test.start_with_autostop
  rescue Riddle::CommandFailedError => e
    puts "\n=====>: #{e.inspect}\n"
  end

And this is the result for the above puts

=====>: #<Riddle::CommandFailedError: Sphinx command failed to execute>

currently thinking-sphinx is 5.0.0.

Any idea what is wrong !?

Thanks

pat commented 4 years ago

Hmm… not sure what this problem is. What version of Sphinx do you have installed? Does it work in the development environment? Also: what's the output when you set the verbose option to true in the index call?

ThinkingSphinx::Test.index 'contact_core', 'contact_delta', :verbose => true
Azzawie commented 4 years ago

Sphinx 2.2.11-id64-release (95ae9a6)


=====>: #<Riddle::CommandFailedError: Sphinx command failed to execute>

Contacts
  header
Sphinx 2.2.11-id64-release (95ae9a6)
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file 'config/test.sphinx.conf'...
FATAL: no indexes found in config file 'config/test.sphinx.conf'
Sphinx 2.2.11-id64-release (95ae9a6)
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file 'config/test.sphinx.conf'...
FATAL: no indexes found in config file 'config/test.sphinx.conf'
Sphinx 2.2.11-id64-release (95ae9a6)
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file 'config/test.sphinx.conf'...
FATAL: no indexes found in config file 'config/test.sphinx.conf'
    has a count (FAILED - 1)
      1st Try error in ./spec/features/contacts_spec.rb:17:
 Sphinx command failed to execute 

RSpec::Retry: 2nd try ./spec/features/contacts_spec.rb:17
      2nd Try error in ./spec/features/contacts_spec.rb:17:
 Sphinx command failed to execute 
      RSpec::Retry: 3rd try ./spec/features/contacts_spec.rb:17

Failures:

  1) Contacts header has a count
     Failure/Error: ThinkingSphinx::Test.index 'contact_core', 'contact_delta', verbose: true

     Riddle::CommandFailedError:
       Sphinx command failed to execute
pat commented 4 years ago

I wonder if this is related to #1167… was this working before Ruby/Rails was upgraded? And I'm guessing there are files in app/indices.

Can you tell me what the output of ThinkingSphinx::Configuration.instance.index_paths is?

Azzawie commented 3 years ago

@pat Thank you for your responses. we have this call in the initializer

ThinkingSphinx::Configuration.instance.preload_indices

by disabling it while running rspec test solved the issue.

pat commented 3 years ago

Ah, great to hear that you've got things working… I don't suppose you remember the reason for that line in your initialiser?