3

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?

Dalton Cézane
  • 3,672
  • 2
  • 35
  • 60

4 Answers4

5

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

sudo chown -R stack:stack /opt/stack
Dalton Cézane
  • 3,672
  • 2
  • 35
  • 60
0

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

vulpxn
  • 731
  • 1
  • 6
  • 14
  • I had tried run the command with sudo before, but it did not work and I got this another message: `DevStack should be run as a user with sudo permissions, not root. A "stack" user configured correctly can be created with: /opt/stack/devstack/tools/create-stack-user.sh`. – Dalton Cézane May 08 '20 at 21:29
  • 1
    I see, and you are in fact running with the `stack` user? I have had issues before where users modified permissions did not fully go into effect without logging out & back in again. Granted this was in the context of Docker, but it is the same idea. Maybe give the machine a reboot, or at least start a new terminal session and see if that helps? – vulpxn May 08 '20 at 21:35
  • 2
    I found the solution. It is in an answer (`sudo chown -R stack:stack /opt/stack`). – Dalton Cézane May 08 '20 at 21:37
0

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.

adcoder
  • 31
  • 5
0

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

Akshay Mewada
  • 181
  • 2
  • 9