Troubleshooting error: "FATAL: no sources found in config file"

13 views
Skip to first unread message

Ethan

unread,
Nov 8, 2009, 2:18:42 PM11/8/09
to Thinking Sphinx
Hi. I built Sphinx on my OS X (Snow Leopard) system and installed
Thinking Sphinx 1.3.2.

When I try to index my model I get this error:

------------------------------------------------------------------------------------------------------------

$ sudo rake thinking_sphinx:index
Password:
(in /Users/joe/project/forumproject)
Generating Configuration to /Users/joe/project/forumproject/config/
development.sphinx.conf
Sphinx 0.9.8.1-release (r1533)
Copyright (c) 2001-2008, Andrew Aksyonoff

using config file '/Users/joe/project/forumproject/config/
development.sphinx.conf'...
FATAL: no sources found in config file.
rake aborted!
The following command failed:
/usr/local/bin/indexer --config "/Users/joe/project/forumproject/
config/development.sphinx.conf" --all

This could be caused by a PATH issue in the environment of cron/
passenger/etc. Your current PATH:
/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/local/
bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/mysql/bin:/
Users/joe/bin:/opt/local/bin:/usr/local/pgsql/bin:/usr/local/oracle/
instantclient_10_2:/opt/local/bin/:/usr/local/git/bin
You can set the path to your indexer and searchd binaries using the
bin_path property in config/sphinx.yml:
production:
bin_path: '/usr/local/bin'

(See full trace by running task with --trace)

------------------------------------------------------------------------------------------------------------

I confirmed that the indexer and searchd binaries are installed in /
usr/local/bin. And I set up config/sphinx.yml like this:

development:
enable_star: 1
min_infix_len: 1
bin_path: /usr/local/bin

test:
enable_star: 1
min_infix_len: 1
bin_path: /usr/local/bin

production:
enable_star: 1
min_infix_len: 1
bin_path: /usr/local/bin


My models are in RAILS_ROOT/app/models.

I'm only trying to index one model. I have it set up like this:

class Entry < ActiveRecord::Base
belongs_to :user

define_index do
indexes(title)
indexes(entry)

has CAST(user_id AS INT), :type => :integer, :as => :user_id
has created_at
has updated_at
end
end




My development.sphinx.conf...

indexer
{
}

searchd
{
address = 127.0.0.1
port = 3312
log = /Users/joe/project/forumproject/log/searchd.log
query_log = /Users/joe/project/forumproject/log/searchd.query.log
pid_file = /Users/joe/project/forumproject/log/
searchd.development.pid
}


Any troubleshooting suggestions?

Thanks,

Ethan

James Healy

unread,
Nov 8, 2009, 5:09:52 PM11/8/09
to thinkin...@googlegroups.com
Ethan wrote:

The problem is that the generated sphinc config file is incomplete, it
doesn't look like a path issue at all.

> I'm only trying to index one model. I have it set up like this:
>
> class Entry < ActiveRecord::Base
> belongs_to :user
>
> define_index do
> indexes(title)
> indexes(entry)
>
> has CAST(user_id AS INT), :type => :integer, :as => :user_id
> has created_at
> has updated_at
> end
> end

Why are you casting user_id to an int? Is it stored as a string in your
database?

I'd remove the cast if at all possible, or wrap it in quotes. Thinking
Sphinx is pretty good at detecting the database type.

has user_id

or

has "CAST(user_id AS INT)", :type => :integer, :as => :user_id

-- James Healy <ji...@deefa.com> Mon, 09 Nov 2009 09:08:08 +1100

Pat Allan

unread,
Nov 8, 2009, 11:46:03 PM11/8/09
to thinkin...@googlegroups.com
Ethan figured this problem out before moderation of his message had
happened - so it's all fixed now :)

--
Pat
Reply all
Reply to author
Forward
0 new messages