Errno::EACCES (Permission denied searchd.production.pid)

83 views
Skip to first unread message

Travis

unread,
Jan 2, 2010, 10:52:22 PM1/2/10
to Thinking Sphinx
Hi guys, I've had Sphinx and Thinking Sphinx on my production site for
a few days now and was just alerted to some issues when deleting
records. I think this is probably a simple permissions issue as
indicated below but I can't seem to find much information on what
should be set. Can anyone tell me if they have seen this before and
how the permissions were resolved? Also are there other permissions
settings that should be set now before they crop up in production?

Processing ClassifiedController#delete (for 89.48.159.036 at
2010-01-03 03:29:38) [GET]
Parameters: {"id"=>"64"}

Errno::EACCES (Permission denied - /home/web/public_html/sitefiles/log/
searchd.production.pid):
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.14/lib/
thinking_sphinx.rb:201:in `read'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.14/lib/
thinking_sphinx.rb:201:in `sphinx_pid'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.14/lib/
thinking_sphinx.rb:196:in `sphinx_running_by_pid?'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.14/lib/
thinking_sphinx.rb:189:in `sphinx_running?'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.14/lib/
thinking_sphinx/active_record.rb:248:in `delete_in_index'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.14/lib/
thinking_sphinx/active_record.rb:338:in `toggle_deleted'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.14/lib/
thinking_sphinx/active_record.rb:337:in `each'
/usr/lib/ruby/gems/1.8/gems/thinking-sphinx-1.3.14/lib/
thinking_sphinx/active_record.rb:337:in `toggle_deleted'
app/controllers/classified_controller.rb:612:in `delete'
passenger (2.2.7) lib/phusion_passenger/rack/request_handler.rb:
95:in `process_request'
passenger (2.2.7) lib/phusion_passenger/abstract_request_handler.rb:
207:in `main_loop'
passenger (2.2.7) lib/phusion_passenger/railz/application_spawner.rb:
374:in `start_request_handler'
passenger (2.2.7) lib/phusion_passenger/railz/application_spawner.rb:
332:in `handle_spawn_application'
passenger (2.2.7) lib/phusion_passenger/utils.rb:184:in `safe_fork'
passenger (2.2.7) lib/phusion_passenger/railz/application_spawner.rb:
330:in `handle_spawn_application'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
`__send__'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
`main_loop'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:163:in
`start'
passenger (2.2.7) lib/phusion_passenger/railz/application_spawner.rb:
209:in `start'
passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:262:in
`spawn_rails_application'
passenger (2.2.7) lib/phusion_passenger/
abstract_server_collection.rb:126:in `lookup_or_add'
passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:256:in
`spawn_rails_application'
passenger (2.2.7) lib/phusion_passenger/
abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.7) lib/phusion_passenger/
abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:255:in
`spawn_rails_application'
passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:154:in
`spawn_application'
passenger (2.2.7) lib/phusion_passenger/spawn_manager.rb:287:in
`handle_spawn_application'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
`__send__'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:352:in
`main_loop'
passenger (2.2.7) lib/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'

Rendering /home/web/public_html/sitefiles/public/500.html (500
Internal Server Error)

Pat Allan

unread,
Jan 2, 2010, 11:02:21 PM1/2/10
to thinkin...@googlegroups.com
Hi Travis

This is probably happening because you have invoked the rake tasks that manage Sphinx as one user (perhaps root, via sudo?), but your web app is running as a different user. Everything should be run using the one user (I recommend whatever user your site is run by).

Cheers

--
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.
>
>

Travis Gere

unread,
Jan 2, 2010, 11:38:02 PM1/2/10
to thinkin...@googlegroups.com
Yes... Thanks Pat!  This is exactly what I did.  Looks like Is it best to change ownership of files to the user running the web app?  Looks like the files in sphinx/production also belong to root:

-rw-r--r-- 1 root root  4080 Jan  3 02:29 classified_core.spa
-rw-r--r-- 1 root root 10625 Jan  3 02:29 classified_core.spd
-rw-r--r-- 1 root root   840 Jan  3 02:29 classified_core.sph
-rw-r--r-- 1 root root  6460 Jan  3 02:29 classified_core.spi
-rw-r--r-- 1 root root     0 Jan  3 02:29 classified_core.spk
-rw-r--r-- 1 root root   612 Jan  3 02:29 classified_core.spm
-rw-r--r-- 1 root root 11881 Jan  3 02:29 classified_core.spp
-rw-r--r-- 1 root root     0 Jan  3 02:29 classified_delta.spa
-rw-r--r-- 1 root root     1 Jan  3 02:29 classified_delta.spd
-rw-r--r-- 1 root root   840 Jan  3 02:29 classified_delta.sph
-rw-r--r-- 1 root root     1 Jan  3 02:29 classified_delta.spi
-rw-r--r-- 1 root root     0 Jan  3 02:29 classified_delta.spk
-rw-r--r-- 1 root root     0 Jan  3 02:29 classified_delta.spm
-rw-r--r-- 1 root root     1 Jan  3 02:29 classified_delta.spp

Thanks for your help.

Travis

Travis Gere

unread,
Jan 3, 2010, 12:48:18 AM1/3/10
to thinkin...@googlegroups.com
Thanks again Pat, you were right on, I assigned ownership of the following directories. Happy to say that I am no longer having issues starting or stopping the search dameon or indexing from my web user account.  I'm also not having permission issues creating, deleting, uploading images etc..

db/sphinx
logs/searchd.production.pid
logs/searchd.log
logs/searchd.query.log

Does this look about right to you? Any other permissions that should be granted to my web user account while I am at it?  Also, thanks so much for your efforts supporting all the questions that through this google group, even through the holidays.  Your plugin has made a huge improvement to my site.  Do you have a paypal link for donations?  I would be happy to send you a little holiday cheer ;-) and help support your development.

Thanks,
Travis








Pat Allan

unread,
Jan 3, 2010, 1:36:41 AM1/3/10
to thinkin...@googlegroups.com
Hi Travis

Good to hear you got it all sorted - you might want to ensure the *.sphinx.conf file has the same permissions - which will be the case if you're running the index task with that user anyway.

As for donations, there is a pledgie:
http://pledgie.com/campaigns/1752

Nothing is expected, so any amount is welcome :)

--
Pat

Reply all
Reply to author
Forward
0 new messages