New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
You have offline compression enabled but key is missing from offline manifest #169
Comments
What version of django_compressor are you using ? |
Whatever is in PyPI. I will try upgrading to latest dev version. Thanks |
I had the same problem by mixing inline scripts with included files. This was my template code.
And this was the data that Django compressor was using to generate a manifest key.
The key is a digest of the string representation of the list of nodes inside the In my case, removing the inline code from the You can trace the data and digest in the get_hexdigest function of compressor.cache. Look for clues in your standard output/web server error log. Hope it helps, |
It should be fixed in development version, thanks to the fix that went in #154 |
Looks like the problem was a script include inside an inline block. This was on latest dev version.Thanks @viotti {% compress js inline %}
<script type="text/javascript" src="/static/js/pages/calculator.js"></script> |
This issue should probably be closed, as noted earlier here, it is a duplicate of #154. |
Hi, i'm suffering this issue. My settings.py looks like this: ### COMPRESSION - django_compressor
COMPRESS_ENABLED = True
COMPRESS_OFFLINE = True
COMPRESS_PARSER = 'compressor.parser.LxmlParser'
COMPRESS_CSS_FILTERS = [
'compressor.filters.css_default.CssAbsoluteFilter',
'compressor.filters.cssmin.CSSMinFilter',
]
COMPRESS_JS_FILTERS = [
'compressor.filters.closure.ClosureCompilerFilter',
]
COMPRESS_CLOSURE_COMPILER_BINARY = 'java -jar /path/to/compiler.jar' All works right except by inline js code present in .html file. I have several css/js external files linked from my .html. All these are well compressed with {% compress css/js %}, but when i try to compress all the js code printed in .html file (code between <script></script> labels) i get this error. "OfflineGenerationError at / Any tip to solve this? |
rubenjimenez: please try the development version. If that doesn't fix your problem, open up a new bug, with the following info:
|
I prove development version and i'm still getting the same error. It only occurs in offline compression and it always appears with any js inline code. I'm trying with {% compress js %} and not with {% compress js inline %} (which also fails). If you need more information, don't hesitate to ask for it. |
same issue with development branch |
Still having issues with this. It appears that even in the dev branch, using {{ STATIC_URL }}, the hex generation process is generating new hexes that do not make any sense or correspond to the hexes saved in manifest.json. |
Solution: dont have compress js span a block. Eg, use compress once in the master template and once in the the templates that each inherit. Downside: two http requests for css and js each, instead of one. Can be reduced to one by moving the master js/css to be in all the templates. Would be nice if we didnt have to choose between DRY in templates and reducing http requests:) |
Have the same thing happen. Don't have any inline code in compress, and the key that reports missing is in fact exists in manifest.json |
@altryne : it could be a permissions problem, verify that the webserver / django process has the rights to read the manifest. Can't help much more without more details. |
Turns out it was a Django thing with a 500 page. With compression offline, django tried to render the 500 page without context, which in itself created the 500 error. This really helped: |
Hi everyone, the link to chriskief.com was helplful. However, it did not solve the problem for me. It turned out that I had django template vars like "{{myvar}}" in my javascripts. I forgot to add them to COMPRESS_OFFLINE_CONTEXT and hence I got the missing key error. Once i took all my javascripts with template variables out of the compressor, everything worked fine again. Before I got a 500 error which did not display the standard django error but the Apache "misconfiguration page". I am not sure yet, if only missing definitions in COMPRESS_OFFLINE_CONTEXT are the problem or if also {% url ... %} causes this issue. |
I'm seeing this in my deployment. I use compress like so
could it be that compress cannot process the |
I ran into this issue and it has to do with the use of the "bootstrap.min.css" - if you use the non-minified version of bootstrap it should work. Basically, compressor is trying to minify a file that is... already minified. Thus it throws an error. |
I am not sure what this issue is but I am using offline generation and this error occurs after using the compress management command and accessing the website. Should each of those css files have their own key?
My Settings:
COMPRESS_URL = STATIC_URL
COMPRESS_ROOT = STATIC_ROOT
COMPRESS_OFFLINE = True
COMPRESS_OFFLINE_MANIFEST = "manifest.json" # Is created in CACHE directory
COMPRESS_CSS_FILTERS = ['compressor.filters.css_default.CssAbsoluteFilter','compressor.filters.cssmin.CSSMinFilter']
COMPRESS_YUI_BINARY = os.path.join(PROJECT_ROOT, 'bin/yui.sh')
COMPRESS_JS_FILTERS = ['compressor.filters.closure.ClosureCompilerFilter']
COMPRESS_CLOSURE_COMPILER_BINARY = os.path.join(PROJECT_ROOT, 'bin/closure.sh')
COMPRESS_CLOSURE_COMPILER_ARGUMENTS = "--language_in=ECMASCRIPT5"
COMPRESS_STORAGE = 'compressor.storage.GzipCompressorFileStorage' # DOES NOT WORK WTF
You have offline compression enabled but key "b68ba4d2116295c56138e439f1b03a03" is missing from offline manifest. You may need to run "python manage.py compress".
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.3.1
Exception Type: OfflineGenerationError
Exception Value:
You have offline compression enabled but key "b68ba4d2116295c56138e439f1b03a03" is missing from offline manifest. You may need to run "python manage.py compress".
Exception Location: /srv/www/project/lib/python2.6/site-packages/compressor/templatetags/compress.py in render_offline, line 56
The text was updated successfully, but these errors were encountered: