1. Marcin Kuzminski
  2. RhodeCode
  3. Issues


Issue #666 resolved

makelock error: "Permission denied" when reindexing from the web admin page

created an issue

When I try to update the whoosh index from the admin page, I get a 500 Internal Server Error and the following backtrace in the server logfile:

 File '/usr/lib/python2.7/dist-packages/rhodecode/lib/pidlock.py', line 131 in makelock
  pidfile = open(self.pidfile, "wb")
IOError: [Errno 13] Permission denied: '/etc/task_42c2da77081ac972d025ef0d346bf430.lock'

This is because my configuration file is /etc/rhodecode.ini and rhodecode is not run as root.

I finally found a workaround. I don't know if it is the right way to fix this so I'm not making a pull request. Instead, I give the patch that I applied to have it work on my config:

--- rhodecode/lib/celerylib/__init__.py     2012-11-30 17:44:11.000000000 +0100
+++ rhodecode/lib/celerylib/__init__.py     2012-11-30 18:35:49.000000000 +0100
@@ -93,7 +93,7 @@
 def locked_task(func):
     def __wrapper(func, *fargs, **fkwargs):
         lockkey = __get_lockkey(func, *fargs, **fkwargs)
-        lockkey_path = config['here']
+        lockkey_path = config['app_conf']['cache_dir']

         log.info('running task with lockkey %s' % lockkey)

I decided to use the cache_dir configuration variable because I'm sure that rhodecode will have write access to this directory.

Comments (3)

  1. Marcin Kuzminski repo owner

    That makes totally sense. RhodeCode will always have write access to cache_dir, while as in your example not always to the where config is located. I'll apply this patch to beta branch, or you can send me a pull request. Thanks !

  2. Log in to comment