1

When starting /etc/init.d/celeryd I get the following error below. I made sure all the directories are read and writable with the user that I am starting it as. I even did touch file to make sure in all the places that there is a directive for a file to write to.

(community)community@community:~$ /etc/init.d/celeryd  start
bot_server.settings.production
celery multi v3.1.11 (Cipater)
> Starting nodes...
    > w1.bot_server@community.net: Traceback (most recent call last):
  File "/home/community/community-forums/bot_server/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/djcelery/management/commands/celeryd_detach.py", line 26, in run_from_argv
    detached().execute_from_commandline(argv)
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/celery/bin/celeryd_detach.py", line 160, in execute_from_commandline
    **vars(options)
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/celery/bin/celeryd_detach.py", line 42, in detach
    with detached(logfile, pidfile, uid, gid, umask, working_directory, fake):
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/celery/platforms.py", line 383, in detached
    maybe_drop_privileges(uid=uid, gid=gid)
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/celery/platforms.py", line 520, in maybe_drop_privileges
    initgroups(uid, gid)
  File "/home/community/.virtualenvs/community/local/lib/python2.7/site-packages/celery/platforms.py", line 473, in initgroups
    return os.initgroups(username, gid)
OSError: [Errno 1] Operation not permitted
* Child terminated with errorcode 1
FAILED

I am using:

Django==1.6.3
celery==3.1.11
celerymon==1.0.3
django-celery==3.1.10
django-celery-with-redis==3.0
dman
  • 10,406
  • 18
  • 102
  • 201

1 Answers1

2

OSError errno 1 looks like a permissions issue: OSError: [Error 1] Operation not permitted

Looks like the issue is on os.initgroups, which calls initgroups on the system -- see man initgroups

From your prompt it looks like you're using some sort of role account, I'd guess there is some issue with how your role/group permissions are set up with respect to the files django is accessing.

Edit: From man initgroups:

DESCRIPTION
   The initgroups() function initializes the group access list by reading
   the group database /etc/group and using all groups of which user is a member.
   The additional group group is also added to the list.

Can community read /etc/group?

Community
  • 1
  • 1
metaperture
  • 2,393
  • 1
  • 18
  • 19
  • `community` is the user and owner of that python environment. that user has total access to all the django files. – dman May 28 '14 at 21:09
  • Can community read /etc/group? `ls -l /etc/group` If not, would likely cause initgroups to fail. You can further debug by trying to run `initgroups` in the command line; what fails/succeeds there should be the same as in python, but you'll get more verbose error messages. – metaperture May 28 '14 at 22:24