Newbie problem on production server

Hi,
I just installed ferret for the first time and integrated it with my
app. On my dev machine it’s fine but on my production server I get this
when I call find_by_contents():

Processing LinksController#results (for 24.185.105.59 at 2007-03-28
05:28:36) [POST]
Session ID: 3f2dc7c17147c0e52178ba697a119833
Parameters: {“commit”=>“Search”, “action”=>“results”,
“controller”=>“links”, “link”=>{“search”=>“test”}}

IOError (IO Error occured at <except.c>:93 in xraise
Error occured in index.c:886 - sis_find_segments_file
Error reading the segment infos. Store listing was

):
/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.3/lib/ferret/index.rb:706:in
initialize' /usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.3/lib/ferret/index.rb:706:innew’
/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.3/lib/ferret/index.rb:706:in
ensure_reader_open' /usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.3/lib/ferret/index.rb:713:inensure_searcher_open’
/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.3/lib/ferret/index.rb:658:in
process_query' /usr/local/lib/ruby/1.8/monitor.rb:238:insynchronize’
/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.3/lib/ferret/index.rb:657:in
process_query' /vendor/plugins/acts_as_ferret/lib/local_index.rb:87:infind_id_by_contents’
/vendor/plugins/acts_as_ferret/lib/class_methods.rb:82:in
find_id_by_contents' /vendor/plugins/acts_as_ferret/lib/class_methods.rb:134:inar_find_by_contents’
/vendor/plugins/acts_as_ferret/lib/class_methods.rb:128:in
find_records_lazy_or_not' /vendor/plugins/acts_as_ferret/lib/class_methods.rb:54:infind_by_contents’
/app/controllers/links_controller.rb:11:in `results’

On Wed, Mar 28, 2007 at 12:31:12PM +0200, Alex Kane wrote:

IOError (IO Error occured at <except.c>:93 in xraise
Error occured in index.c:886 - sis_find_segments_file
Error reading the segment infos. Store listing was

):

Looks like the index can’t be created.

a typical problem is that the user your application is running as does
not have the privileges to create the index directory
(RAILS_ROOT/index/production/model_name) and/or write to this directory.

Jens

–
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

I checked the permissions and I’m able to write to this path, so it must
be something else.

~ Alex

Jens K. wrote:

On Wed, Mar 28, 2007 at 12:31:12PM +0200, Alex Kane wrote:

IOError (IO Error occured at <except.c>:93 in xraise
Error occured in index.c:886 - sis_find_segments_file
Error reading the segment infos. Store listing was

):

Looks like the index can’t be created.

a typical problem is that the user your application is running as does
not have the privileges to create the index directory
(RAILS_ROOT/index/production/model_name) and/or write to this directory.

Jens

–
Jens Kr�mer
webit! Gesellschaft f�r neue Medien mbH
Schnorrstra�e 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

On Wed, Mar 28, 2007 at 05:16:23PM +0200, Alex Kane wrote:

I checked the permissions and I’m able to write to this path, so it must
be something else.

what happens if you run Model.rebuild_index on the console?

Jens

–
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

I also can’t run model.rebuild_index in the list action
report io exception

Jens K. wrote:

On Wed, Mar 28, 2007 at 05:16:23PM +0200, Alex Kane wrote:

I checked the permissions and I’m able to write to this path, so it must
be something else.

what happens if you run Model.rebuild_index on the console?

Jens

what happens if you run Model.rebuild_index on the console?

This is what I get:

[alex@alexkane current]$ ./script/runner -e production
Link.rebuild_index
./script/…/config/…/vendor/rails/railties/lib/commands/runner.rb:27:
/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.3/lib/ferret/index.rb:285:in
`delete’: File Not Found Error occured at <except.c>:93 in xraise
(FileNotFoundError)
Error occured in fs_store.c:329 - fs_open_input
tried to open
“script/…/config/…/index/production/link/_h8.frq” but it doesn’t
exist:

    from 

/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.3/lib/ferret/index.rb:285:in
<<' from /usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.3/lib/ferret/index.rb:8:insynchrolock’
from /usr/local/lib/ruby/1.8/monitor.rb:238:in synchronize' from /usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.3/lib/ferret/index.rb:8:insynchrolock’
from
/usr/local/lib/ruby/gems/1.8/gems/ferret-0.11.3/lib/ferret/index.rb:267:in
<<' from ./script/../config/../vendor/plugins/acts_as_ferret/lib/local_index.rb:220:inreindex_model’
from
./script/…/config/…/vendor/plugins/acts_as_ferret/lib/local_index.rb:219:in
each' from ./script/../config/../vendor/plugins/acts_as_ferret/lib/local_index.rb:219:inreindex_model’
… 10 levels…
from ./script/runner:3:in eval' from ./script/../config/../vendor/rails/railties/lib/commands/runner.rb:27 from ./script/runner:3:inrequire’
from ./script/runner:3

On Sun, Apr 01, 2007 at 12:49:29AM +0200, Alex Kane wrote:

Error occured in fs_store.c:329 - fs_open_input
tried to open
“script/…/config/…/index/production/link/_h8.frq” but it doesn’t
exist:

Are you sure your app has not been trying to write to the index while
rebuilding? Does deleting the index dir before reindexing help?

–
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

You’re right, that seems to be the problem and it’s indexing now…