Sphinx "unknown index" errors

ruby
rspec
circle.yml

#1

We are trying to migrate a repo over from TravisCI. The specs all pass in Travis and locally. But on CircleCI we get three specs that fail with an error message:

ThinkingSphinx::SphinxError:
   unknown index 'lesson_core' in update request

These all have to do with destroying a Lesson model. Any ideas of what we should be doing different in our configuration to get this properly ported over from TravisCI?

We are using Ruby 2.1.6 with the default Sphinx (2.0.4) and ThinkingShpinx 3.0.6, rails 3.2.21.


#2

Is this project open source? If so can we get a link to it? Thanks!


#3

No, it isn’t.


#4

Ok no problem, can you share your teardown method?


#5

Do you mean for our specs? The only thing we have there is to run DatabaseCleaner.clean.

That is run after each.


#6

@levlaz any ideas on this?


#7

@gdevore

Looks two instances of sphinx are running in a build (one is by CircleCI and other spawned by Rails). Can you add the following to your circle.yml to stop the one started by Circle?

dependencies:
  pre:
    -  sudo service sphinxsearch stop

#8

@kimh That worked. Thanks!


#9

Could you please explain why there are two instances running? I’m running into the same problem and your solution works, but I wanna understand why I have two instances.

In my case I was using thinking-sphinx 3.0.2 and It was working just fine. After I upgraded it to 3.1.0 I started getting those errors. I tested both versions and it doesn’t really seem that the problem is because there are two instances running. Based on my tests seem like CircleCI always starts a sphinx process with the default configuration (pointing to /etc/sphinxsearch/sphinx.conf).

Thanks!


#10