PermissionError: [Errno 13] Permission denied: '/opt/stack/.cache/pip/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd'

Viewed 3951

I am following the instructions from this tutorial to install devstack. When I type ./stack.sh, I am receiving the following error:

Exception:
Traceback (most recent call last):
  File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
    requirement_set.prepare_files(finder)
  File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/req/req_install.py", line 281, in populate_link
    self.link = self._wheel_cache.cached_wheel(self.link, self.name)
  File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/wheel.py", line 68, in cached_wheel
    self._cache_dir, link, self._format_control, package_name)
  File "/opt/stack/requirements/.venv/lib/python3.6/site-packages/pip/wheel.py", line 129, in cached_wheel
    wheel_names = os.listdir(root)
PermissionError: [Errno 13] Permission denied: '/opt/stack/.cache/pip/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd'

What is the problem if the stack user was configured appropriately according to the tutorial?

4 Answers

Searching a bit, I found that we have to associate the stack user with the stack directory:

sudo chown -R stack:stack /opt/stack

From the documentation:

Since this user will be making many changes to your system, it should have sudo privileges

Try running again with sudo ./stack.sh

I had the same error. Besides sudo chown -R stack:stack /opt/devstack you should also include sudo chown -R stack:stack /opt/stack.

That fixed the problem for me.

To resolve permission error while installing openstack,

we have to give the privileges to the stack user.

to give permission to the stack user the commands are as below

$sudo chown -R stack:stack /opt/stack

or if the above command dont work then you should try

$sudo chown stack:stack /opt/stack

Related