Issue #8872
closedUpgrade path broken when assets files are versioned
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
Added by spredzy over 3 years ago
Added by spredzy over 3 years ago
Revision 604d178b | View on GitHub
Ensure we clean static dir before collectstatic is run
fixes: #8872
Updated by spredzy over 3 years ago
- Status changed from NEW to MODIFIED
Applied in changeset ansible-pulp|604d178bbb626045ebc7283fd09d2639a0dc4372.
Updated by dkliban@redhat.com over 3 years ago
- Has duplicate Issue #7954: pulpcore-api can't start after upgrade added
Added by spredzy over 3 years ago
Revision 1fd87299 | View on GitHub
Ensure we clean static dir before collectstatic is run
fixes: #8872
Added by spredzy over 3 years ago
Revision 1fd87299 | View on GitHub
Ensure we clean static dir before collectstatic is run
fixes: #8872
Updated by pulpbot over 3 years ago
Updated by bmbouter over 3 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Ensure we clean static dir before collectstatic is run
fixes: #8872