Skip to content

Permission denied in building with docker on local VM #3087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MikeFalowski opened this issue Sep 7, 2017 · 3 comments
Closed

Permission denied in building with docker on local VM #3087

MikeFalowski opened this issue Sep 7, 2017 · 3 comments

Comments

@MikeFalowski
Copy link

Details

I was trying to prepare VM instance of RTD. Finally, when I got finished built, I tried to use Docker.
Unfortunately, some errors, showed below, occur. I thought it is similar to #2658, but I even tried to chmod 777 and it didn't help.

When I created envs directory manually, it shouted that permission denied for envs/latest (and so on).

My only settings.

PRODUCTION_DOMAIN = 'my.vm.lan.ip:8000'
SLUMBER_API_HOST = 'http://my.vm.lan.ip:8000'

SLUMBER_USERNAME = 'admin'
SLUMBER_PASSWORD = 'admin'  # noqa: ignore dodgy check

# Docker
DOCKER_ENABLE = True
DOCKER_IMAGE = 'readthedocs/build:2.0'
DOCKER_VERSION = '1.18'

Machine is CentOS 7

Expected Result

Build with success.

Actual Result

[07/Sep/2017 04:09:34] readthedocs.doc_builder.environments:487[18575]: INFO Creating container
[07/Sep/2017 04:09:34] readthedocs.doc_builder.environments:487[18575]: INFO Creating container
[07/Sep/2017 04:09:35] readthedocs.doc_builder.environments:207[18575]: INFO Running in container build-none-project-3-fandango: 'python2.7 -mvirtualenv --no-site-packages --no-download /home/admin/checkouts/readthedocs.org/user_builds/fandango/envs/latest' [/home/admin/checkouts/readthedocs.org]
[07/Sep/2017 04:09:35] readthedocs.doc_builder.environments:207[18575]: INFO Running in container build-none-project-3-fandango: 'python2.7 -mvirtualenv --no-site-packages --no-download /home/admin/checkouts/readthedocs.org/user_builds/fandango/envs/latest' [/home/admin/checkouts/readthedocs.org]
[07/Sep/2017 04:09:36] readthedocs.vcs_support.utils:100[18575]: INFO Lock (fandango): Releasing
[07/Sep/2017 04:09:36] readthedocs.vcs_support.utils:100[18575]: INFO Lock (fandango): Releasing
[07/Sep/2017 04:09:36] readthedocs.doc_builder.environments:317[18575]: ERROR (Build) [fandango:latest] Command python2.7 -mvirtualenv --no-site-packages --no-download /home/admin/checkouts/readthedocs.org/user_builds/fandango/envs/latest failed:
Traceback (most recent call last):
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 2328, in <module>
    main()
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 713, in main
    symlink=options.symlink)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 925, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 1110, in install_python
    mkdir(lib_dir)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 323, in mkdir
    os.makedirs(path)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/admin/checkouts/readthedocs.org/user_builds/fandango/envs'
Traceback (most recent call last):
  File "/home/admin/checkouts/readthedocs.org/readthedocs/projects/tasks.py", line 208, in run_build
    self.setup_environment()
  File "/home/admin/checkouts/readthedocs.org/readthedocs/projects/tasks.py", line 351, in setup_environment
    self.python_env.setup_base()
  File "/home/admin/checkouts/readthedocs.org/readthedocs/doc_builder/python_environments.py", line 112, in setup_base
    bin_path=None,  # Don't use virtualenv bin that doesn't exist yet
  File "/home/admin/checkouts/readthedocs.org/readthedocs/doc_builder/environments.py", line 324, in run
    return self.run_command_class(cls=self.command_class, cmd=cmd, **kwargs)
  File "/home/admin/checkouts/readthedocs.org/readthedocs/doc_builder/environments.py", line 361, in run_command_class
    raise BuildEnvironmentWarning(msg)
BuildEnvironmentWarning: Command python2.7 -mvirtualenv --no-site-packages --no-download /home/admin/checkouts/readthedocs.org/user_builds/fandango/envs/latest failed:
Traceback (most recent call last):
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 2328, in <module>
    main()
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 713, in main
    symlink=options.symlink)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 925, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 1110, in install_python
    mkdir(lib_dir)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 323, in mkdir
    os.makedirs(path)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/admin/checkouts/readthedocs.org/user_builds/fandango/envs'

[07/Sep/2017 04:09:36] readthedocs.doc_builder.environments:317[18575]: ERROR (Build) [fandango:latest] Command python2.7 -mvirtualenv --no-site-packages --no-download /home/admin/checkouts/readthedocs.org/user_builds/fandango/envs/latest failed:
Traceback (most recent call last):
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 2328, in <module>
    main()
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 713, in main
    symlink=options.symlink)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 925, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 1110, in install_python
    mkdir(lib_dir)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 323, in mkdir
    os.makedirs(path)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/admin/checkouts/readthedocs.org/user_builds/fandango/envs'
Traceback (most recent call last):
  File "/home/admin/checkouts/readthedocs.org/readthedocs/projects/tasks.py", line 208, in run_build
    self.setup_environment()
  File "/home/admin/checkouts/readthedocs.org/readthedocs/projects/tasks.py", line 351, in setup_environment
    self.python_env.setup_base()
  File "/home/admin/checkouts/readthedocs.org/readthedocs/doc_builder/python_environments.py", line 112, in setup_base
    bin_path=None,  # Don't use virtualenv bin that doesn't exist yet
  File "/home/admin/checkouts/readthedocs.org/readthedocs/doc_builder/environments.py", line 324, in run
    return self.run_command_class(cls=self.command_class, cmd=cmd, **kwargs)
  File "/home/admin/checkouts/readthedocs.org/readthedocs/doc_builder/environments.py", line 361, in run_command_class
    raise BuildEnvironmentWarning(msg)
BuildEnvironmentWarning: Command python2.7 -mvirtualenv --no-site-packages --no-download /home/admin/checkouts/readthedocs.org/user_builds/fandango/envs/latest failed:
Traceback (most recent call last):
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 2328, in <module>
    main()
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 713, in main
    symlink=options.symlink)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 925, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 1110, in install_python
    mkdir(lib_dir)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 323, in mkdir
    os.makedirs(path)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/docs/.pyenv/versions/2.7.13/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/admin/checkouts/readthedocs.org/user_builds/fandango/envs'

[07/Sep/2017 04:09:37] readthedocs.doc_builder.environments:538[18575]: INFO Removing container build-none-project-3-fandango
[07/Sep/2017 04:09:37] readthedocs.doc_builder.environments:538[18575]: INFO Removing container build-none-project-3-fandango
[07/Sep/2017 04:09:43] readthedocs.doc_builder.environments:552[18575]: INFO (Build) [fandango:latest] Build finished
[07/Sep/2017 04:09:43] readthedocs.doc_builder.environments:552[18575]: INFO (Build) [fandango:latest] Build finished
safwanrahman added a commit to safwanrahman/readthedocs.org that referenced this issue Oct 6, 2017
@stsewd
Copy link
Member

stsewd commented Dec 26, 2017

I solved this issue by creating a custom Dockerfile with my user id. I followed this steps https://github.com/rtfd/readthedocs.org/pull/2692/files#diff-bbaadadacee305c8e9d6825771319cfbR40

@humitos
Copy link
Member

humitos commented Dec 26, 2017

I'm closing this issue as duplicated. Besides, there are a couple of solutions around there but none of them has marked as "official" yet.

@humitos humitos closed this as completed Dec 26, 2017
@safwanrahman
Copy link
Member

@humitos I believe we have found out the actual reason behind it but need to find out a proper solution for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants