Project

Profile

Help

Issue #5553

django-admin collectstatic fails on pulp2-nightly-pulp3-source-centos box

Added by ttereshc about 1 year ago. Updated 8 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 63
Quarter:

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

Associated revisions

Revision 522f2e7e View on GitHub
Added by Mike DePaulo 11 months ago

Set correct permissions on /var/lib/pulp/ if it pre-exists

closes #5553 https://pulp.plan.io/issues/5553

Revision 522f2e7e View on GitHub
Added by Mike DePaulo 11 months ago

Set correct permissions on /var/lib/pulp/ if it pre-exists

closes #5553 https://pulp.plan.io/issues/5553

History

#1 Updated by fao89 about 1 year ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 60

#2 Updated by dalley about 1 year 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.

#3 Updated by ttereshc about 1 year 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.

#4 Updated by dalley about 1 year 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

#5 Updated by dalley about 1 year ago

Ha! Sleep fixed the problem :)

Pulp install dir does not refer to /var/lib/pulp/. Pulp user home does. New patch works!

https://github.com/pulp/ansible-pulp/pull/178/

#6 Updated by dalley about 1 year ago

  • Status changed from ASSIGNED to POST

#7 Updated by rchan 12 months ago

  • Sprint changed from Sprint 60 to Sprint 61

#8 Updated by rchan 11 months ago

  • Sprint changed from Sprint 61 to Sprint 62

#9 Updated by rchan 11 months ago

  • Sprint changed from Sprint 62 to Sprint 63

#10 Updated by dalley 11 months ago

  • Assignee changed from dalley to mdepaulo@redhat.com

Mike made most of the progress on this issue, so changing assignee

#11 Updated by fao89 10 months ago

  • Tags CI/CD added

#12 Updated by Anonymous 10 months ago

  • Status changed from POST to MODIFIED

#13 Updated by mdepaulo@redhat.com 8 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE
  • Tags deleted (CI/CD, Pulp 3 installer)

Please register to edit this issue

Also available in: Atom PDF