OS permission problem when init script is not run from /etc/init.d/

Issue #901 wontfix
Seppi created an issue

Greetings!

We are running RhodeCode 2.1.0 on CentOS release 6.4 (Final). We understand there is a version 2.2.0, and will test this again later this week if it is not reproducible on 2.2.0.

When the init script, /etc/init.d/rhodecode is run from any other folder other than /etc/init.d/ the following error is shown when we try to push via git (not hg);

2013-10-24 16:47:19.584 INFO  [rhodecode.lib.middleware.simplegit] push action on GIT repo "Internal/Products/test_git_repo" by "josef.patoprsty" from 192.168.1.126
2013-10-24 16:47:19.697 INFO  [rhodecode.RequestWrapper] IP: 192.168.1.126 Request to /Internal/Products/test_git_repo/info/refs time: 2.170s
2013-10-24 16:47:20.223 INFO  [rhodecode.lib.base] Access for IP:192.168.1.126 allowed
2013-10-24 16:47:20.483 INFO  [rhodecode.lib.auth_modules] Authenticating user using rhodecode.lib.auth_modules.auth_ldap plugin
2013-10-24 16:47:20.740 INFO  [rhodecode.lib.auth_modules.auth_ldap] user josef.patoprsty authenticated correctly
2013-10-24 16:47:21.535 INFO  [rhodecode.lib.base] Access for IP:192.168.1.126 allowed
2013-10-24 16:47:21.833 INFO  [rhodecode.lib.middleware.simplegit] push action on GIT repo "Internal/Products/test_git_repo" by "josef.patoprsty" from 192.168.1.126
2013-10-24 16:47:21.849 ERROR [rhodecode.lib.middleware.pygrack] Traceback (most recent call last):
  File "/opt/rhodecode-venv/lib/python2.6/site-packages/rhodecode/lib/middleware/pygrack.py", line 136, in backend
    **opts
  File "/opt/rhodecode-venv/lib/python2.6/site-packages/rhodecode/lib/vcs/subprocessio.py", line 356, in __init__
    **kwargs)
  File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.6/subprocess.py", line 1234, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied: '/root'

2013-10-24 16:47:21.849 ERROR [rhodecode.lib.middleware.pygrack] Traceback (most recent call last):
  File "/opt/rhodecode-venv/lib/python2.6/site-packages/rhodecode/lib/middleware/pygrack.py", line 165, in __call__
    resp = app(request, environ)
  File "/opt/rhodecode-venv/lib/python2.6/site-packages/rhodecode/lib/middleware/pygrack.py", line 140, in backend
    raise exc.HTTPExpectationFailed()
HTTPExpectationFailed: Expectation failed.

2013-10-24 16:47:21.922 INFO  [rhodecode.RequestWrapper] IP: 192.168.1.126 Request to /Internal/Products/test_git_repo/git-receive-pack time: 1.972s

Quite specifically, the OSError: [Errno 13] Permission denied: '/root' will show wherever the init script was run from. (in this instance as root, cd root && /etc/init.d/rhodecode restart)

To reproduce, start RhodeCode from any directory other than /etc/init.d/, e.g. cd /home/<username> && /etc/init.d/rhodecode restart

As a workaround, Running RhodeCode from /etc/init.d/, e.g. cd /etc/init/d/ && ./rhodecode restart allows users to push to git repositories.

Comments (3)

  1. Seppi reporter

    Hey! I visited the link you sent me, and it says, This discussion is private If you are "josefnpat", enter your email address to receive the special URL to this discussion.

    I logged in as josefnpat and it informs me; This discussion is private or deleted.

  2. Log in to comment