jazzband / django-pipeline

Pipeline is an asset packaging library for Django.
https://django-pipeline.readthedocs.io/
MIT License
1.5k stars 372 forks source link

Post-processing Failed #640

Open chrisspen opened 6 years ago

chrisspen commented 6 years ago

I recently upgraded both pipeline and Django to 1.11, and now I'm unable to run collectstatic. When I do, it pipeline seems to choke on arbitrary JS or CSS files. For example:

Post-processed 'js/lib/highmaps-4.2.5/api/images/apple-touch-icon-152x152.png' as 'js/lib/highmaps-4.2.5/api/images/apple-touch-icon-152x152.3e06108d391c.png'
Post-processed 'js/lib/highmaps-4.2.5/api/images/splash.svg' as 'js/lib/highmaps-4.2.5/api/images/splash.6e71c0b7e3c5.svg'
Post-processed 'js/lib/highmaps-4.2.5/api/images/sprite.png' as 'js/lib/highmaps-4.2.5/api/images/sprite.0703ab1e72ca.png'
Post-processed 'js/lib/highmaps-4.2.5/api/images/apple-touch-icon-144x144.png' as 'js/lib/highmaps-4.2.5/api/images/apple-touch-icon-144x144.8635a3c81f46.png'
Post-processed 'js/lib/highmaps-4.2.5/api/images/favicon-160x160.png' as 'js/lib/highmaps-4.2.5/api/images/favicon-160x160.b39ea2feadd2.png'
Post-processed 'js/lib/highmaps-4.2.5/api/images/favicon-32x32.png' as 'js/lib/highmaps-4.2.5/api/images/favicon-32x32.77e0c99f5ebd.png'
Post-processed 'js/lib/highmaps-4.2.5/api/images/apple-touch-icon-57x57.png' as 'js/lib/highmaps-4.2.5/api/images/apple-touch-icon-57x57.e402babd43c7.png'
Post-processed 'js/lib/highmaps-4.2.5/api/images/favicon-96x96.png' as 'js/lib/highmaps-4.2.5/api/images/favicon-96x96.105a20921e74.png'
Post-processing 'js/lib/highmaps-4.2.5/api/css/jquery-ui.min.css' failed!

Traceback (most recent call last):
  File "manage.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/myproject/.env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/usr/local/myproject/.env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/myproject/.env/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/myproject/.env/local/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/usr/local/myproject/.env/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 199, in handle
    collected = self.collect()
  File "/usr/local/myproject/.env/local/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 145, in collect
    raise processed
ValueError: The file 'js/lib/highmaps-4.2.5/api/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png' could not be found with <pipeline.storage.PipelineCachedStorage object at 0x7f29c9a82ad0>.

Fatal error: local() encountered an error (return code 1) while executing 'python manage.py collectstatic --noinput --traceback'

In the previous version, it was able to parse jquery-ui.min.css just fine, and the image ui-bg_highlight-soft_75_cccccc_1x100.png definitely exists at the path specified, so I'm not sure what's going on here.

My PIPELINE settings haven't changed, so I'm not sure what would be causing this other than the upgrade. My settings are:

PIPELINE = {
    'PIPELINE_ENABLED': True,
    'JAVASCRIPT': { ... },
    'STYLESHEETS': { ... },
    'JS_COMPRESSOR': 'pipeline.compressors.slimit.SlimItCompressor',
    'CSS_COMPRESSOR': 'pipeline.compressors.yui.YUICompressor',
    'YUI_JS_ARGUMENTS': '--nomunge --disable-optimizations',
    'YUI_BINARY': '/usr/bin/yui-compressor',
}

Is this a bug or have I misconfigured Pipeline?

chrisspen commented 6 years ago

The image appears to be the trigger. Pipeline fails on any CSS file that contains a url() to an image. This is a pretty massive bug, as virtually every major Javascript and CSS library I use contains files like this.

I'm using version 1.6.13, the most recent version. Is this a known issue?

chrisspen commented 6 years ago

I tried switching storage backends, but they all experience similar problems.

The most stable backend appears to be the pipeline.storage.PipelineStorage, but that ignores files listed in ModelAdmin's Media.js list. Is there any way to get these files included?

Zarak-Shah-ji commented 3 years ago

I"m facing the same issue while deploying my django app using heroku ,please can anyone help soon?

remote: -----> $ python manage.py collectstatic --noinput remote: Post-processing 'core/css/jquery-ui.min.css' failed!