Issue #5553
closeddjango-admin collectstatic fails on pulp2-nightly-pulp3-source-centos box
Description
RUNNING HANDLER [pulp : Collect static content] ********************************
fatal: [pulp2-nightly-pulp3-source-centos7]: FAILED! => {
"changed": true,
"cmd": [
"/usr/local/lib/pulp/bin/django-admin",
"collectstatic",
"--noinput",
"--link"
],
"delta": "0:00:01.374874",
"end": "2019-10-08 08:06:29.806216",
"rc": 1,
"start": "2019-10-08 08:06:28.431342"
}
STDERR:
CommandError: [Errno 2] No such file or directory: '/usr/local/lib/pulp/lib64/python3.6/site-packages/django/contrib/admin/static/admin/css/autocomplete.css' -> '/var/lib/pulp/static/admin/css/autocomplete.css'
MSG:
non-zero return code
Updated by fao89 about 5 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 60
Updated by dalley about 5 years ago
The problem is that /var/lib/pulp/static/ has a different owner and different permissions on the pulp2 and pulp3 box than it does on the pulp3-only box. I did a recursive change of the permissions and I was able to get it to provision again.
Here's what they are on a normal Pulp 3 vagrant box:
[vagrant@pulp3-source-fedora30 ~]$ ls -la /var/lib/pulp
total 16
drwxrwxr-x. 4 vagrant pulp 4096 Oct 8 14:54 .
drwxr-xr-x. 30 root root 4096 Oct 8 14:52 ..
drwxrwxr-x. 6 vagrant vagrant 4096 Oct 8 14:54 static
drwxrwxr-x. 5 vagrant pulp 4096 Oct 8 14:54 tmp
[vagrant@pulp3-source-fedora30 ~]$ ls -la /var/lib/pulp/static
total 24
drwxrwxr-x. 6 vagrant vagrant 4096 Oct 8 14:54 .
drwxrwxr-x. 4 vagrant pulp 4096 Oct 8 14:54 ..
drwxrwxr-x. 6 vagrant vagrant 4096 Oct 8 14:54 admin
drwxrwxr-x. 5 vagrant vagrant 4096 Oct 8 14:54 django_extensions
drwxrwxr-x. 5 vagrant vagrant 4096 Oct 8 14:54 drf-yasg
drwxrwxr-x. 7 vagrant vagrant 4096 Oct 8 14:54 rest_framework
I don't have a fresh pulp2-pulp3 box available to test so I can't compare, but the permissions were different, wrong, and things were owned by "apache" that shouldn't be.
Updated by ttereshc about 5 years ago
On a fresh box
$ ls -la /var/lib/pulp
total 7
drwxr-xr-x. 8 apache pulp 163 Oct 8 12:35 .
drwxr-xr-x. 38 root root 4096 Oct 8 08:05 ..
-rw-r--r--. 1 apache apache 2 Oct 8 08:43 0005_puppet_module_name_change.txt
drwxr-xr-x. 3 apache apache 19 Oct 8 08:43 content
-rw-r--r--. 1 root root 0 Oct 8 08:01 db_initialized.flag
drwxr-xr-x. 4 apache apache 33 Oct 8 08:43 published
drwxr-xr-x. 2 apache pulp 25 Oct 8 08:01 static
drwxr-xr-x. 2 apache pulp 6 Sep 25 15:44 uploads
Also because of permissions on the /var/lib/pulp directory, pulp 3 can't create 'artifact' directory.
Updated by dalley about 5 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dalley
It was sufficient to set "chmod 775" on /var/lib/pulp/ and /var/lib/pulp/static/. I got a successful provision afterwards. I think that's the minimum set of changes we need, no recursive permissions setting necessary.
Here is my ansible prototype, but unfortunately it doesn't seem to work. https://github.com/pulp/ansible-pulp/compare/master...dralley:master
None of the permissions actually get changed? I don't understand why... It says it's "ok" when it clearly is not.
TASK [pulp : Create pulp install dir] ******************************************
changed: [pulp2-nightly-pulp3-source-centos7]
TASK [pulp : Set permissions on pulp install dir] ******************************
ok: [pulp2-nightly-pulp3-source-centos7]
TASK [pulp : Create cache dir for Pulp] ****************************************
changed: [pulp2-nightly-pulp3-source-centos7]
TASK [pulp : Create staticfiles dir for Pulp] **********************************
changed: [pulp2-nightly-pulp3-source-centos7]
TASK [pulp : Set permissions on pulp static dir] *******************************
ok: [pulp2-nightly-pulp3-source-centos7]
drwxr-xr-x. 6 apache pulp 132 Oct 15 04:03 .
drwxr-xr-x. 38 root root 4096 Oct 15 04:05 ..
-rw-r--r--. 1 apache apache 2 Oct 15 04:01 0005_puppet_module_name_change.txt
-rw-r--r--. 1 root root 0 Oct 15 04:01 db_initialized.flag
drwxr-xr-x. 7 apache pulp 73 Oct 15 04:00 published
drwxr-xr-x. 2 apache pulp 25 Oct 15 04:01 static
drwxrwxr-x. 5 vagrant pulp 269 Oct 15 04:05 tmp
drwxr-xr-x. 2 apache pulp 6 Sep 25 15:44 uploads
Updated by dalley about 5 years ago
Ha! Sleep fixed the problem :)
Pulp install dir does not refer to /var/lib/pulp/. Pulp user home does. New patch works!
Added by Mike DePaulo almost 5 years ago
Added by Mike DePaulo almost 5 years ago
Revision 522f2e7e | View on GitHub
Set correct permissions on /var/lib/pulp/ if it pre-exists
Updated by dalley almost 5 years ago
- Assignee changed from dalley to mdepaulo@redhat.com
Mike made most of the progress on this issue, so changing assignee
Updated by Anonymous almost 5 years ago
- Status changed from POST to MODIFIED
Applied in changeset ansible-pulp3|522f2e7e758255f038a8c419c5d30b7949171304.
Updated by mdepaulo@redhat.com almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
- Tags deleted (
CI/CD, Pulp 3 installer)
Set correct permissions on /var/lib/pulp/ if it pre-exists
closes #5553 https://pulp.plan.io/issues/5553