In production mode looking for development.sphinx.conf file

265 views
Skip to first unread message

Rahul Chaudhari

unread,
Dec 17, 2009, 12:37:43 AM12/17/09
to Thinking Sphinx, jagdish....@gmail.com
Hi All,

I am running into a trouble since last two days. When I run my rails
application into production mode using nginx+passenger, delta indexing
is not working.
When I add any record into my table I found a following error into
error.log of nginx

FATAL: config file '<my application path>/config/
development.sphinx.conf' does not exist or is not readable

Actually it should look for production.sphinx.conf.

And if I search for any record which are indexed at server start time
(rake ts:in RAILS_ENV=production), it shows those records but not
newly added record since above error.

If I run same application into development mode mode using nginx
+passenger or into mongrel using development or production mode it
works perfectly.

Is I missed some thing that I have to in production mode.


Regards,
Rahul P. Chaudhari

Pat Allan

unread,
Dec 25, 2009, 10:53:38 PM12/25/09
to thinkin...@googlegroups.com
Hi Rahul

I don't suppose you've figured this out since you posted the issue? It's definitely an odd problem - are you certain your Rails app is running using the right environment? Are you explicitly setting the Rails environment in your nginx conf file?

I'm assuming you're using the default delta approach, not delayed job or a datetime column.

--
Pat

> --
>
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
>
>

rahul100885

unread,
Dec 29, 2009, 4:26:11 AM12/29/09
to Thinking Sphinx
Hi Pat

I am using default delta approach and I am sure that my rails
application is running in production mode as it wrote production.log
file.

As I told if I start application and sphinx server in development
mode, all works fine. But If I start same application in production it
won't since when I fire search query it looks for a development port
which specified into sphinx.conf.

If I remove development tag from sphinx.conf then search works fine.
But when I insert any record or update any record it give error as

FATAL: config file '<my application path>/config/

development.sphinx.conf' does not exist or is not readable]

Regards,
Rahul P. Chaudhari


On Dec 26, 8:53 am, Pat Allan <p...@freelancing-gods.com> wrote:
> Hi Rahul
>
> I don't suppose you've figured this out since you posted the issue? It's definitely an odd problem - are you certain your Rails app is running using the right environment? Are you explicitly setting the Rails environment in your nginx conf file?
>
> I'm assuming you're using the default delta approach, not delayed job or a datetime column.
>
> --
> Pat
>
> On 17/12/2009, at 4:37 PM, Rahul Chaudhari wrote:
>
> > Hi All,
>
> > I am running into a trouble since last two days. When I run my rails

> > application intoproductionmodeusing nginx+passenger, delta indexing


> > is not working.
> > When I add any record into my table I found a following error into
> > error.log of nginx
>
> > FATAL: config file '<my application path>/config/
> > development.sphinx.conf' does not exist or is not readable
>
> > Actually it should look forproduction.sphinx.conf.
>
> > And if I search for any record which are indexed at server start time
> > (rake ts:in RAILS_ENV=production), it shows those records but not
> > newly added record since above error.
>

> > If I run same application into developmentmodemodeusing nginx

Pat Allan

unread,
Dec 29, 2009, 7:36:17 AM12/29/09
to thinkin...@googlegroups.com
What happens if you try editing or creating a new object via script/console in production? Does the delta index work properly then?

--
Pat

Gaspard Bucher

unread,
Jan 15, 2010, 4:46:35 PM1/15/10
to thinkin...@googlegroups.com
I think I nailed this problem down: if you set RAILS_ENV instead of
ENV['RAILS_ENV'], you get 'development' environment.

A simple fix would be (lib/thinking-sphinx/configuration.rb)

def self.environment
Thread.current[:thinking_sphinx_environment] ||= (
defined?(Merb) ? Merb.environment : ENV['RAILS_ENV'] || RAILS_ENV
) || "development"
end

Gaspard

Pat Allan

unread,
Jan 15, 2010, 7:11:31 PM1/15/10
to thinkin...@googlegroups.com
Ah... thanks for pointing that out Gaspard, I'll get it fixed soon.

--
Pat

rahul100885

unread,
Jan 20, 2010, 4:26:41 AM1/20/10
to Thinking Sphinx
Thanks Gaspard, I will try this solution and let you know.
Reply all
Reply to author
Forward
0 new messages