Project

Profile

Help

Issue #8872

closed

Upgrade path broken when assets files are versioned

Added by spredzy almost 3 years ago. Updated over 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
-
Category:
Installer - Moved to GitHub issues
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

When assets files are versioned, the upgrade path is broken, because it leaves broken symlinks behind.

I was on a version that had /var/lib/pulp/assets/rest_framework/js/jquery-3.4.1.min.js (pointing to a valid link), upon upgrade restframework is now providing jquery-3.5.1.min.js, so the new link is now created, but the old link is now broken.

At some point the whitenoise package runs a scantree and fails because of the broken link

Jun 07 09:08:19 ip-10-0-10-9.ec2.internal gunicorn[42750]:   File "/usr/lib/python3.6/site-packages/whitenoise/base.py", line 271, in scantree
Jun 07 09:08:19 ip-10-0-10-9.ec2.internal gunicorn[42750]:     yield from scantree(entry.path)                                                                                                  
Jun 07 09:08:19 ip-10-0-10-9.ec2.internal gunicorn[42750]:   File "/usr/lib/python3.6/site-packages/whitenoise/base.py", line 271, in scantree                          
Jun 07 09:08:19 ip-10-0-10-9.ec2.internal gunicorn[42750]:     yield from scantree(entry.path)                                                                                                  
Jun 07 09:08:19 ip-10-0-10-9.ec2.internal gunicorn[42750]:   File "/usr/lib/python3.6/site-packages/whitenoise/base.py", line 273, in scantree
Jun 07 09:08:19 ip-10-0-10-9.ec2.internal gunicorn[42750]:     yield entry.path, entry.stat()                                                                                                   
Jun 07 09:08:19 ip-10-0-10-9.ec2.internal gunicorn[42750]: FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/pulp/assets/rest_framework/js/jquery-3.4.1.min.js'

The root cause of the issue (based on my understanding) is that when we are running collectstatic we don't clean before ourselves, leading to this situation.?

At collectstatic time a --clear option is available to avoid that. https://docs.djangoproject.com/fr/3.2/ref/contrib/staticfiles/#cmdoption-collectstatic-clear


Related issues

Has duplicate Pulp - Issue #7954: pulpcore-api can't start after upgradeCLOSED - DUPLICATEActions

Added by spredzy almost 3 years ago

Revision 604d178b | View on GitHub

Ensure we clean static dir before collectstatic is run

fixes: #8872

Added by spredzy almost 3 years ago

Revision 604d178b | View on GitHub

Ensure we clean static dir before collectstatic is run

fixes: #8872

Actions #1

Updated by spredzy almost 3 years ago

  • Status changed from NEW to MODIFIED
Actions #2

Updated by dkliban@redhat.com almost 3 years ago

  • Has duplicate Issue #7954: pulpcore-api can't start after upgrade added

Added by spredzy almost 3 years ago

Revision 1fd87299 | View on GitHub

Ensure we clean static dir before collectstatic is run

fixes: #8872

Added by spredzy almost 3 years ago

Revision 1fd87299 | View on GitHub

Ensure we clean static dir before collectstatic is run

fixes: #8872

Actions #4

Updated by bmbouter over 2 years ago

  • Sprint/Milestone set to 3.14.0
Actions #5

Updated by bmbouter over 2 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF