1. Denis Darii
  2. django-fagungis
  3. Issues
Issue #7 resolved

Permissions problem

Marco Cellarosi
created an issue

This is the log:

{{{ [cellarosi@78.47.254.149] sudo: mkdir -p /opt/cellarosi/projects [cellarosi@78.47.254.149] out: sudo password: [cellarosi@78.47.254.149] sudo: mkdir -p /opt/cellarosi/logs/nginx [cellarosi@78.47.254.149] out: sudo password: [cellarosi@78.47.254.149] sudo: mkdir -p /opt/cellarosi/logs/projects [cellarosi@78.47.254.149] out: sudo password: [cellarosi@78.47.254.149] sudo: mkdir -p /opt/cellarosi/configs/nginx [cellarosi@78.47.254.149] out: sudo password: [cellarosi@78.47.254.149] sudo: mkdir -p /opt/cellarosi/configs/supervisord [cellarosi@78.47.254.149] out: sudo password: [cellarosi@78.47.254.149] sudo: mkdir -p /opt/cellarosi/scripts [cellarosi@78.47.254.149] out: sudo password: [cellarosi@78.47.254.149] sudo: mkdir -p /opt/cellarosi/htdocs [cellarosi@78.47.254.149] out: sudo password: [cellarosi@78.47.254.149] sudo: mkdir -p /opt/cellarosi/tmp [cellarosi@78.47.254.149] out: sudo password: [cellarosi@78.47.254.149] sudo: mkdir -p /opt/cellarosi/envs/easytasking [cellarosi@78.47.254.149] out: sudo password: [cellarosi@78.47.254.149] sudo: echo "<html><body>nothing here</body></html> " > /opt/cellarosi/htdocs/index.html [cellarosi@78.47.254.149] out: sudo password: [cellarosi@78.47.254.149] run: hg clone ssh://hg@bitbucket.org/cellarosi/easytasking /opt/cellarosi/projects/easytasking [cellarosi@78.47.254.149] out: abort: Permission denied: /opt/cellarosi/projects/easytasking [cellarosi@78.47.254.149] out: remote: Warning: Permanently added the RSA host key for IP address '207.223.240.181' to the list of known hosts.

Fatal error: run() encountered an error (return code 255) while executing 'hg clone ssh://hg@bitbucket.org/cellarosi/easytasking /opt/cellarosi/projects/easytasking'

}}}

Comments (4)

  1. Marco Cellarosi reporter

    Yes, it is. And i discovered that even if i set manually the permission in projects, it is not enough, because it reports also this permission error:

    [cellarosi@78.47.254.149] out: Installing pip...............done.
    
    [cellarosi@78.47.254.149] run: source /opt/cellarosi/envs/easytasking/bin/activate && pip install -I gunicorn
    [cellarosi@78.47.254.149] out: Downloading/unpacking gunicorn
    [cellarosi@78.47.254.149] out: Exception:
    [cellarosi@78.47.254.149] out: Traceback (most recent call last):
    [cellarosi@78.47.254.149] out:   File "/opt/cellarosi/envs/easytasking/local/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/basecommand.py", line 126, in main
    [cellarosi@78.47.254.149] out:     self.run(options, args)
    [cellarosi@78.47.254.149] out:   File "/opt/cellarosi/envs/easytasking/local/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/commands/install.py", line 223, in run
    [cellarosi@78.47.254.149] out:     requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
    [cellarosi@78.47.254.149] out:   File "/opt/cellarosi/envs/easytasking/local/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/req.py", line 948, in prepare_files
    [cellarosi@78.47.254.149] out:     location = req_to_install.build_location(self.build_dir, not self.is_download)
    [cellarosi@78.47.254.149] out:   File "/opt/cellarosi/envs/easytasking/local/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/req.py", line 150, in build_location
    [cellarosi@78.47.254.149] out:     _make_build_dir(build_dir)
    [cellarosi@78.47.254.149] out:   File "/opt/cellarosi/envs/easytasking/local/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/req.py", line 1192, in _make_build_dir
    [cellarosi@78.47.254.149] out:     os.makedirs(build_dir)
    [cellarosi@78.47.254.149] out:   File "/opt/cellarosi/envs/easytasking/lib/python2.7/os.py", line 157, in makedirs
    [cellarosi@78.47.254.149] out:     mkdir(name, mode)
    [cellarosi@78.47.254.149] out: OSError: [Errno 13] Permission denied: '/opt/cellarosi/envs/easytasking/build'
    
    [cellarosi@78.47.254.149] out: Storing complete log in /home/cellarosi/.pip/pip.log
    [cellarosi@78.47.254.149] out: Traceback (most recent call last):
    [cellarosi@78.47.254.149] out:   File "/opt/cellarosi/envs/easytasking/bin/pip", line 9, in <module>
    [cellarosi@78.47.254.149] out:     load_entry_point('pip==1.0.2', 'console_scripts', 'pip')()
    [cellarosi@78.47.254.149] out:   File "/opt/cellarosi/envs/easytasking/local/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/__init__.py", line 116, in main
    [cellarosi@78.47.254.149] out:     return command.main(initial_args, args[1:], options)
    [cellarosi@78.47.254.149] out:   File "/opt/cellarosi/envs/easytasking/local/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/basecommand.py", line 151, in main
    [cellarosi@78.47.254.149] out:     log_fp = open_logfile(log_fn, 'w')
    [cellarosi@78.47.254.149] out:   File "/opt/cellarosi/envs/easytasking/local/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg/pip/basecommand.py", line 180, in open_logfile
    [cellarosi@78.47.254.149] out:     log_fp = open(filename, mode)
    [cellarosi@78.47.254.149] out: IOError: [Errno 13] Permission denied: '/home/cellarosi/.pip/pip.log'
    
    
    Fatal error: run() encountered an error (return code 1) while executing 'source /opt/cellarosi/envs/easytasking/bin/activate && pip install -I gunicorn'
    
    
    
    
  2. Anonymous

    Hi,

    thanks for the script, it looks quite promissing.

    However I am also having problems with permissions, the same as Marco. I tried to fix this by chown-ing the project directories to my non-root but sudoer user which I use to login in env.hosts, but that did not help. I didn't want to chmod 777 them so I replaced all the run() calls with sudo() calls in tasks.py.

    Unfortunatelly this fails now when the nginx config is uploaded.

    Is there any proper way of fixing these?

    Thanks, Daniel

  3. Log in to comment