bihealth / sodar-core

SODAR Core: A Django-based framework for building scientific data management web apps
MIT License
9 stars 1 forks source link

Select2 dependency in DAL v3.9.5 breaks collectstatic with Whitenoise in production #1224

Open mikkonie opened 1 year ago

mikkonie commented 1 year ago

django-autocomplete-light v3.9.5 came out yesterday. It causes collecstatic to fail in production with Whitenoise, at least when using CompressedManifestStaticFilesStorage. I believe this is caused by an update to the select2 dependency within DAL.

This may be midigated by switching to a different storage backend in Whitenoise. Alas, missing files are bad and I don't want to do workarounds just for this broken update.

For now, I'm pinning DAL to v3.9.4. I'll observe how further updates behave.

Full error dump in comments. See also bihealth/sodar-server#1666.

mikkonie commented 1 year ago

Error dump from SODAR:

Post-processing 'vendor/select2/docs/plugins/highlight/css/brown-paper.css' failed!

Traceback (most recent call last):
  File "manage.py", line 28, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.8/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 187, in handle
    collected = self.collect()
  File "/usr/local/lib/python3.8/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 134, in collect
    raise processed
whitenoise.storage.MissingFileError: The file 'vendor/select2/docs/plugins/highlight/css/brown-papersq.png' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7ff0f836cfa0>.

The CSS file 'vendor/select2/docs/plugins/highlight/css/brown-paper.css' references a file which could not be found:
  vendor/select2/docs/plugins/highlight/css/brown-papersq.png

Please check the URL references in this CSS file, particularly any
relative paths which might be pointing to the wrong location.
mikkonie commented 6 months ago

I've now upgraded the dependency to 3.11.0. In local development all seems fine, but I'll have to see how this behaves with Whitenoise and debug accordingly. If all else fails, I'll revert back to an older version.