Ansible Tower Permission denied: '/var/lib/awx/projects' even when has access

6.1k views Asked by At

When I try to log into Ansible Tower or navigate around, I'm getting a 500 error. The /var/log/tower.log shows:

2016-12-20 14:34:59,659 ERROR    django.request Internal Server Error: /api/v1/config/
Traceback (most recent call last):
  File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/utils/decorators.py", line 145, in inner
    return func(*args, **kwargs)
  File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "/var/lib/awx/venv/tower/lib/python2.7/site-packages/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "/lib/python2.7/site-packages/awx/api/views.py", line 234, in get
  File "/lib/python2.7/site-packages/awx/main/models/projects.py", line 57, in get_local_path_choices
OSError: [Errno 13] Permission denied: '/var/lib/awx/projects'

But the /var/lib/awx/projects directory is fully owned by the awx user.

$ ls -la /var/lib/awx/projects/
total 4
drwxr-xr-x. 2 awx awx    6 Dec 19 16:01 .
drwxr-xr-x. 9 awx awx 4096 Dec 20 10:38 ..

Has anyone ever experienced this? What's the way to fix it? Thanks!

1

There are 1 answers

1
techraf On BEST ANSWER

You've got SElinux enabled and blocking access to the file. Notice the dot at the end:

drwxr-xr-x.

Check the details with ls -Z /var/lib/awx/projects/.

Refer to SELinux - Contexts Labeling Files. Also this answer on Unix.SE might be of help.