[Django] #34679: Cannot run collectstatic with existing unsupported manifest file

111 views
Skip to first unread message

Django

unread,
Jun 26, 2023, 11:59:07 AM6/26/23
to django-...@googlegroups.com
#34679: Cannot run collectstatic with existing unsupported manifest file
-----------------------------------------------+------------------------
Reporter: Jarosław Wygoda | Owner: nobody
Type: Bug | Status: new
Component: contrib.staticfiles | Version: 4.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------------+------------------------
I tried to run collectstatic with ManifestStaticFilesStorage on django 4.1
with existing staticfiles generated by django 4.2. Django 4.2 introduced
manifest version 1.1 which is not supported by Django 4.1. I've found out
that I can't run collectstatic when unsupported manifest already exists.

--
Ticket URL: <https://code.djangoproject.com/ticket/34679>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 26, 2023, 11:59:23 AM6/26/23
to django-...@googlegroups.com
#34679: Cannot run collectstatic with existing unsupported manifest file
-------------------------------------+-------------------------------------
Reporter: Jarosław Wygoda | Owner: Jarosław
| Wygoda
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: 4.1
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jarosław Wygoda):

* owner: nobody => Jarosław Wygoda
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/34679#comment:1>

Django

unread,
Jun 26, 2023, 12:45:36 PM6/26/23
to django-...@googlegroups.com
#34679: Cannot run collectstatic with existing unsupported manifest file
-------------------------------------+-------------------------------------
Reporter: Jarosław Wygoda | Owner: Jarosław
| Wygoda
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 4.1
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* status: assigned => closed
* resolution: => needsinfo


Comment:

Hello!

I'll be closing this ticket as `needsinfo` since there is no traceback nor
a reproducer was provided, but please re-open if you have more concrete
information (traceback, detailed steps to reproduce the bug, sample
project to exercise this issue, etc.).

You can also seek more help in the user forum. The best place to get
answers to your issue is using any of the user support channels from
[https://docs.djangoproject.com/en/dev/faq/help/#how-do-i-do-x-why-
doesn-t-y-work-where-can-i-go-to-get-help this link].


Thank you!

--
Ticket URL: <https://code.djangoproject.com/ticket/34679#comment:2>

Django

unread,
Jun 26, 2023, 1:05:01 PM6/26/23
to django-...@googlegroups.com
#34679: Cannot run collectstatic with existing unsupported manifest file
-------------------------------------+-------------------------------------
Reporter: Jarosław Wygoda | Owner: Jarosław
| Wygoda
Type: Bug | Status: new

Component: contrib.staticfiles | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jarosław Wygoda):

* cc: Jarosław Wygoda (added)
* status: closed => new
* resolution: needsinfo =>


Comment:

Hi Natalia,

I've already figured out this issue. Please take a look at my pr:
https://github.com/django/django/pull/17015/files
You can reproduce it either by reverting my changes in
`django/contrib/staticfiles/storage.py` and running
`TestManifestStaticFilesStorageRollback` or by running `./manage.py
collectstatic` with `ManifestStaticFilesStorage` on Django 4.1 and then on
Django 4.2.

Please find the traceback below.

{{{
Traceback (most recent call last):
File "/tests/django/tests/staticfiles_tests/test_storage.py", line 912,
in test_collectstatic_with_unsupported_version
self.run_collectstatic()
File "/tests/django/tests/staticfiles_tests/cases.py", line 89, in
run_collectstatic
call_command(
File "/tests/django/django/core/management/__init__.py", line 194, in
call_command
return command.execute(*args, **defaults)
File "/tests/django/django/core/management/base.py", line 458, in
execute
output = self.handle(*args, **options)
File
"/tests/django/django/contrib/staticfiles/management/commands/collectstatic.py",
line 184, in handle
if self.is_local_storage() and self.storage.location:
File
"/tests/django/django/contrib/staticfiles/management/commands/collectstatic.py",
line 245, in is_local_storage
return isinstance(self.storage, FileSystemStorage)
File "/tests/django/django/utils/functional.py", line 280, in
__getattribute__
value = super().__getattribute__(name)
File "/tests/django/django/utils/functional.py", line 251, in inner
self._setup()
File "/tests/django/django/contrib/staticfiles/storage.py", line 540, in
_setup
self._wrapped = storages[STATICFILES_STORAGE_ALIAS]
File "/tests/django/django/core/files/storage/handler.py", line 43, in
__getitem__
storage = self.create_storage(params)
File "/tests/django/django/core/files/storage/handler.py", line 55, in
create_storage
return storage_cls(**options)
File "/tests/django/django/contrib/staticfiles/storage.py", line 463, in
__init__
self.hashed_files, self.manifest_hash = self.load_manifest()
File "/tests/django/django/contrib/staticfiles/storage.py", line 484, in
load_manifest
raise ValueError(
ValueError: Couldn't load manifest 'staticfiles.json' (version 1.0)
}}}

Regards,
Jarek

--
Ticket URL: <https://code.djangoproject.com/ticket/34679#comment:3>

Django

unread,
Jun 26, 2023, 1:43:43 PM6/26/23
to django-...@googlegroups.com
#34679: Cannot run collectstatic with existing unsupported manifest file
-------------------------------------+-------------------------------------
Reporter: Jarosław Wygoda | Owner: Jarosław
| Wygoda
Type: Bug | Status: new
Component: contrib.staticfiles | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

In general, we don't support downgrade paths, e.g. sessions created in
Django X may not work with Django < X etc.

--
Ticket URL: <https://code.djangoproject.com/ticket/34679#comment:4>

Django

unread,
Jun 26, 2023, 1:53:53 PM6/26/23
to django-...@googlegroups.com
#34679: Cannot run collectstatic with existing unsupported manifest file
-------------------------------------+-------------------------------------
Reporter: Jarosław Wygoda | Owner: Jarosław
| Wygoda
Type: Bug | Status: new
Component: contrib.staticfiles | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Natalia Bidart):

Hello Jarek,

In addition to what Mariusz mentioned, I'm not being able to reproduce. I
set the STORAGES as instructed and ran `collectstatic` on Django 4.2. The
generated `staticfiles.json` has version `1.1` in it. I downgraded to
Django 4.1 and ran `collectstatic` again, no errors.

--
Ticket URL: <https://code.djangoproject.com/ticket/34679#comment:5>

Django

unread,
Jun 26, 2023, 1:54:23 PM6/26/23
to django-...@googlegroups.com
#34679: Cannot run collectstatic with existing unsupported manifest file
-------------------------------------+-------------------------------------
Reporter: Jarosław Wygoda | Owner: Jarosław
| Wygoda
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 4.1
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* status: new => closed
* resolution: => needsinfo


--
Ticket URL: <https://code.djangoproject.com/ticket/34679#comment:6>

Django

unread,
Jun 27, 2023, 6:52:23 AM6/27/23
to django-...@googlegroups.com
#34679: Cannot run collectstatic with existing unsupported manifest file
-------------------------------------+-------------------------------------
Reporter: Jarosław Wygoda | Owner: Jarosław
| Wygoda
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 4.1
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Jarosław Wygoda):

I think this change will improve the developer experience. People finding
bugs after upgrading Django will have easier time reverting to previous
version. Some parts of Django support downgrade paths, e.g. migrations.

--
Ticket URL: <https://code.djangoproject.com/ticket/34679#comment:7>

Django

unread,
Jul 14, 2023, 3:34:53 PM7/14/23
to django-...@googlegroups.com
#34679: Cannot run collectstatic with existing unsupported manifest file
-------------------------------------+-------------------------------------
Reporter: Jarosław Wygoda | Owner: Jarosław
| Wygoda
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 4.1
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Natalia Bidart):

Hello,

In my last comment I mentioned that I can not even reproduce the reported
issue. Could you share a test project with clear steps to reproduce?

Thanks, Natalia.

--
Ticket URL: <https://code.djangoproject.com/ticket/34679#comment:8>

Django

unread,
Jul 16, 2023, 12:49:06 PM7/16/23
to django-...@googlegroups.com
#34679: Cannot run collectstatic with existing unsupported manifest file
-------------------------------------+-------------------------------------
Reporter: Jarosław Wygoda | Owner: Jarosław
| Wygoda
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 4.1
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Jarosław Wygoda):

Sorry I missed your comment. You can reproduce it by running
`./manifest/manage.py collectstatic` with django 3 here
https://github.com/jwygoda/manifest/tree/master. See
https://github.com/jwygoda/manifest/blob/master/test.sh for project setup.

I've also wrote a test reproducing this issue here:
https://github.com/django/django/pull/17015/files#diff-
5d0a445ee662a0619f13e7dfbc73f1de73b76ea5888e15bc0b1a20f32eccd8eaR904

--
Ticket URL: <https://code.djangoproject.com/ticket/34679#comment:9>

Reply all
Reply to author
Forward
0 new messages