Django compress error: Invalid input of type: 'CacheKey'
We suddenly started getting this issue when compressing django static files on production servers. Ubuntu 16.04, Python 3.x, Django 1.11. I am using an ansible-playbook to deploy.
The error is as follows:
CommandError: An error occurred during rendering /chalktalk/app/chalktalk-react-40/chalktalk-react-40/chalktalk/apps/exams/templates/exams/section-edit.html: Invalid input of type: 'CacheKey'. Convert to a byte, string or number first.
It doesn't seem to be an issue in one of the static files but a general issue. Every time we run it, we get a different file.
I was looking for any clues on google and nothing shows up with the same error.
python django ansible django-compressor
add a comment |
We suddenly started getting this issue when compressing django static files on production servers. Ubuntu 16.04, Python 3.x, Django 1.11. I am using an ansible-playbook to deploy.
The error is as follows:
CommandError: An error occurred during rendering /chalktalk/app/chalktalk-react-40/chalktalk-react-40/chalktalk/apps/exams/templates/exams/section-edit.html: Invalid input of type: 'CacheKey'. Convert to a byte, string or number first.
It doesn't seem to be an issue in one of the static files but a general issue. Every time we run it, we get a different file.
I was looking for any clues on google and nothing shows up with the same error.
python django ansible django-compressor
1
Good timing! I am damn sure all using django-redis must have been broken their prod environments with the unexpected backward incompatible changes.
– Babu
Nov 19 '18 at 9:16
@Babu It only broke our CI. Its not really the fault of redis-py, after all it was a major version bump so compatibility is explicitly not expected. django-redis should have been restricting what versions they allow, but even that is not an "incompatible change" on their part, just a bug in their setup.py.
– Andrew Backer
Nov 20 '18 at 5:05
Yeah, not blaming anyone here :)
– Babu
Nov 20 '18 at 18:11
add a comment |
We suddenly started getting this issue when compressing django static files on production servers. Ubuntu 16.04, Python 3.x, Django 1.11. I am using an ansible-playbook to deploy.
The error is as follows:
CommandError: An error occurred during rendering /chalktalk/app/chalktalk-react-40/chalktalk-react-40/chalktalk/apps/exams/templates/exams/section-edit.html: Invalid input of type: 'CacheKey'. Convert to a byte, string or number first.
It doesn't seem to be an issue in one of the static files but a general issue. Every time we run it, we get a different file.
I was looking for any clues on google and nothing shows up with the same error.
python django ansible django-compressor
We suddenly started getting this issue when compressing django static files on production servers. Ubuntu 16.04, Python 3.x, Django 1.11. I am using an ansible-playbook to deploy.
The error is as follows:
CommandError: An error occurred during rendering /chalktalk/app/chalktalk-react-40/chalktalk-react-40/chalktalk/apps/exams/templates/exams/section-edit.html: Invalid input of type: 'CacheKey'. Convert to a byte, string or number first.
It doesn't seem to be an issue in one of the static files but a general issue. Every time we run it, we get a different file.
I was looking for any clues on google and nothing shows up with the same error.
python django ansible django-compressor
python django ansible django-compressor
edited Nov 16 '18 at 4:37
nmusleh
asked Nov 16 '18 at 4:21
nmuslehnmusleh
641822
641822
1
Good timing! I am damn sure all using django-redis must have been broken their prod environments with the unexpected backward incompatible changes.
– Babu
Nov 19 '18 at 9:16
@Babu It only broke our CI. Its not really the fault of redis-py, after all it was a major version bump so compatibility is explicitly not expected. django-redis should have been restricting what versions they allow, but even that is not an "incompatible change" on their part, just a bug in their setup.py.
– Andrew Backer
Nov 20 '18 at 5:05
Yeah, not blaming anyone here :)
– Babu
Nov 20 '18 at 18:11
add a comment |
1
Good timing! I am damn sure all using django-redis must have been broken their prod environments with the unexpected backward incompatible changes.
– Babu
Nov 19 '18 at 9:16
@Babu It only broke our CI. Its not really the fault of redis-py, after all it was a major version bump so compatibility is explicitly not expected. django-redis should have been restricting what versions they allow, but even that is not an "incompatible change" on their part, just a bug in their setup.py.
– Andrew Backer
Nov 20 '18 at 5:05
Yeah, not blaming anyone here :)
– Babu
Nov 20 '18 at 18:11
1
1
Good timing! I am damn sure all using django-redis must have been broken their prod environments with the unexpected backward incompatible changes.
– Babu
Nov 19 '18 at 9:16
Good timing! I am damn sure all using django-redis must have been broken their prod environments with the unexpected backward incompatible changes.
– Babu
Nov 19 '18 at 9:16
@Babu It only broke our CI. Its not really the fault of redis-py, after all it was a major version bump so compatibility is explicitly not expected. django-redis should have been restricting what versions they allow, but even that is not an "incompatible change" on their part, just a bug in their setup.py.
– Andrew Backer
Nov 20 '18 at 5:05
@Babu It only broke our CI. Its not really the fault of redis-py, after all it was a major version bump so compatibility is explicitly not expected. django-redis should have been restricting what versions they allow, but even that is not an "incompatible change" on their part, just a bug in their setup.py.
– Andrew Backer
Nov 20 '18 at 5:05
Yeah, not blaming anyone here :)
– Babu
Nov 20 '18 at 18:11
Yeah, not blaming anyone here :)
– Babu
Nov 20 '18 at 18:11
add a comment |
2 Answers
2
active
oldest
votes
This appears to be an issue with the underlying redis
library. Try pinning your redis
version to 2.10.6
, from August 17, 2017. The new version 3, released Nov 15, has this incompatible change.
pip install redis==2.10.6
# and/or
echo redis==2.10.6 >> requirements.txt
I am not sure what package you are using which may be requiring redis as a dependency, or if you are using it yourself. In either case its the same process.
I just started having this issue as well, but through the django-redis
package, which requires the underlying redis
lib. However, that package actually doesn't restrict the maximum version, so it happily upgrades past a major version bump, which you can't really do since thats where you expect the API to change!
The exact code, in master at django-redis:
install_requires = [
"redis>=2.10.0",
]
But it should really be this
install_requires = [
"redis>=2.10.0, <3",
]
Edit: I found the bug report in django-redis (#342) about this just now, but this SO question came up first in google when I was looking into it.
1
Thank you Andrew. I actually have in my requirements.txtdjango-redis-cache==1.6.5 celery[redis]==3.1.23 asgi-redis==1.4.3 channels-redis==2.1.0
. But I found out that the ansible playbook is installing debian packages and one of them isredis-tools
and that has no version requirement so it is installing3.0.6
– nmusleh
Nov 16 '18 at 15:21
Do I pin the redis version by just adding it to the requirements.txt fileredis==2.10.6
before the django-redis-cache and other redis dependent packages?
– nmusleh
Nov 16 '18 at 15:41
I just added redis==2.10.6 in my requirements.txt and it worked :)
– nmusleh
Nov 16 '18 at 15:57
@nmusleh Yes, thats all you should need if you are installing viapip install -r requirements.txt
since it will force that version. If you are using other package managers, or if installing/upgrading manually with--upgrade
then it will upgrade dependencies unless you tell it not to with--no-deps
.
– Andrew Backer
Nov 19 '18 at 3:04
add a comment |
Try installing redis-py below version 3
This is look like a comment please delete it and paste your proper answer and read How to Write good answer
– Ali
Nov 16 '18 at 10:40
Technically he is correct, though without providing any supporting docs and so on there would be no way to evaluate it.
– Andrew Backer
Nov 16 '18 at 11:32
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53331405%2fdjango-compress-error-invalid-input-of-type-cachekey%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
This appears to be an issue with the underlying redis
library. Try pinning your redis
version to 2.10.6
, from August 17, 2017. The new version 3, released Nov 15, has this incompatible change.
pip install redis==2.10.6
# and/or
echo redis==2.10.6 >> requirements.txt
I am not sure what package you are using which may be requiring redis as a dependency, or if you are using it yourself. In either case its the same process.
I just started having this issue as well, but through the django-redis
package, which requires the underlying redis
lib. However, that package actually doesn't restrict the maximum version, so it happily upgrades past a major version bump, which you can't really do since thats where you expect the API to change!
The exact code, in master at django-redis:
install_requires = [
"redis>=2.10.0",
]
But it should really be this
install_requires = [
"redis>=2.10.0, <3",
]
Edit: I found the bug report in django-redis (#342) about this just now, but this SO question came up first in google when I was looking into it.
1
Thank you Andrew. I actually have in my requirements.txtdjango-redis-cache==1.6.5 celery[redis]==3.1.23 asgi-redis==1.4.3 channels-redis==2.1.0
. But I found out that the ansible playbook is installing debian packages and one of them isredis-tools
and that has no version requirement so it is installing3.0.6
– nmusleh
Nov 16 '18 at 15:21
Do I pin the redis version by just adding it to the requirements.txt fileredis==2.10.6
before the django-redis-cache and other redis dependent packages?
– nmusleh
Nov 16 '18 at 15:41
I just added redis==2.10.6 in my requirements.txt and it worked :)
– nmusleh
Nov 16 '18 at 15:57
@nmusleh Yes, thats all you should need if you are installing viapip install -r requirements.txt
since it will force that version. If you are using other package managers, or if installing/upgrading manually with--upgrade
then it will upgrade dependencies unless you tell it not to with--no-deps
.
– Andrew Backer
Nov 19 '18 at 3:04
add a comment |
This appears to be an issue with the underlying redis
library. Try pinning your redis
version to 2.10.6
, from August 17, 2017. The new version 3, released Nov 15, has this incompatible change.
pip install redis==2.10.6
# and/or
echo redis==2.10.6 >> requirements.txt
I am not sure what package you are using which may be requiring redis as a dependency, or if you are using it yourself. In either case its the same process.
I just started having this issue as well, but through the django-redis
package, which requires the underlying redis
lib. However, that package actually doesn't restrict the maximum version, so it happily upgrades past a major version bump, which you can't really do since thats where you expect the API to change!
The exact code, in master at django-redis:
install_requires = [
"redis>=2.10.0",
]
But it should really be this
install_requires = [
"redis>=2.10.0, <3",
]
Edit: I found the bug report in django-redis (#342) about this just now, but this SO question came up first in google when I was looking into it.
1
Thank you Andrew. I actually have in my requirements.txtdjango-redis-cache==1.6.5 celery[redis]==3.1.23 asgi-redis==1.4.3 channels-redis==2.1.0
. But I found out that the ansible playbook is installing debian packages and one of them isredis-tools
and that has no version requirement so it is installing3.0.6
– nmusleh
Nov 16 '18 at 15:21
Do I pin the redis version by just adding it to the requirements.txt fileredis==2.10.6
before the django-redis-cache and other redis dependent packages?
– nmusleh
Nov 16 '18 at 15:41
I just added redis==2.10.6 in my requirements.txt and it worked :)
– nmusleh
Nov 16 '18 at 15:57
@nmusleh Yes, thats all you should need if you are installing viapip install -r requirements.txt
since it will force that version. If you are using other package managers, or if installing/upgrading manually with--upgrade
then it will upgrade dependencies unless you tell it not to with--no-deps
.
– Andrew Backer
Nov 19 '18 at 3:04
add a comment |
This appears to be an issue with the underlying redis
library. Try pinning your redis
version to 2.10.6
, from August 17, 2017. The new version 3, released Nov 15, has this incompatible change.
pip install redis==2.10.6
# and/or
echo redis==2.10.6 >> requirements.txt
I am not sure what package you are using which may be requiring redis as a dependency, or if you are using it yourself. In either case its the same process.
I just started having this issue as well, but through the django-redis
package, which requires the underlying redis
lib. However, that package actually doesn't restrict the maximum version, so it happily upgrades past a major version bump, which you can't really do since thats where you expect the API to change!
The exact code, in master at django-redis:
install_requires = [
"redis>=2.10.0",
]
But it should really be this
install_requires = [
"redis>=2.10.0, <3",
]
Edit: I found the bug report in django-redis (#342) about this just now, but this SO question came up first in google when I was looking into it.
This appears to be an issue with the underlying redis
library. Try pinning your redis
version to 2.10.6
, from August 17, 2017. The new version 3, released Nov 15, has this incompatible change.
pip install redis==2.10.6
# and/or
echo redis==2.10.6 >> requirements.txt
I am not sure what package you are using which may be requiring redis as a dependency, or if you are using it yourself. In either case its the same process.
I just started having this issue as well, but through the django-redis
package, which requires the underlying redis
lib. However, that package actually doesn't restrict the maximum version, so it happily upgrades past a major version bump, which you can't really do since thats where you expect the API to change!
The exact code, in master at django-redis:
install_requires = [
"redis>=2.10.0",
]
But it should really be this
install_requires = [
"redis>=2.10.0, <3",
]
Edit: I found the bug report in django-redis (#342) about this just now, but this SO question came up first in google when I was looking into it.
edited Nov 16 '18 at 11:28
answered Nov 16 '18 at 11:12
Andrew BackerAndrew Backer
4,81123460
4,81123460
1
Thank you Andrew. I actually have in my requirements.txtdjango-redis-cache==1.6.5 celery[redis]==3.1.23 asgi-redis==1.4.3 channels-redis==2.1.0
. But I found out that the ansible playbook is installing debian packages and one of them isredis-tools
and that has no version requirement so it is installing3.0.6
– nmusleh
Nov 16 '18 at 15:21
Do I pin the redis version by just adding it to the requirements.txt fileredis==2.10.6
before the django-redis-cache and other redis dependent packages?
– nmusleh
Nov 16 '18 at 15:41
I just added redis==2.10.6 in my requirements.txt and it worked :)
– nmusleh
Nov 16 '18 at 15:57
@nmusleh Yes, thats all you should need if you are installing viapip install -r requirements.txt
since it will force that version. If you are using other package managers, or if installing/upgrading manually with--upgrade
then it will upgrade dependencies unless you tell it not to with--no-deps
.
– Andrew Backer
Nov 19 '18 at 3:04
add a comment |
1
Thank you Andrew. I actually have in my requirements.txtdjango-redis-cache==1.6.5 celery[redis]==3.1.23 asgi-redis==1.4.3 channels-redis==2.1.0
. But I found out that the ansible playbook is installing debian packages and one of them isredis-tools
and that has no version requirement so it is installing3.0.6
– nmusleh
Nov 16 '18 at 15:21
Do I pin the redis version by just adding it to the requirements.txt fileredis==2.10.6
before the django-redis-cache and other redis dependent packages?
– nmusleh
Nov 16 '18 at 15:41
I just added redis==2.10.6 in my requirements.txt and it worked :)
– nmusleh
Nov 16 '18 at 15:57
@nmusleh Yes, thats all you should need if you are installing viapip install -r requirements.txt
since it will force that version. If you are using other package managers, or if installing/upgrading manually with--upgrade
then it will upgrade dependencies unless you tell it not to with--no-deps
.
– Andrew Backer
Nov 19 '18 at 3:04
1
1
Thank you Andrew. I actually have in my requirements.txt
django-redis-cache==1.6.5 celery[redis]==3.1.23 asgi-redis==1.4.3 channels-redis==2.1.0
. But I found out that the ansible playbook is installing debian packages and one of them is redis-tools
and that has no version requirement so it is installing 3.0.6
– nmusleh
Nov 16 '18 at 15:21
Thank you Andrew. I actually have in my requirements.txt
django-redis-cache==1.6.5 celery[redis]==3.1.23 asgi-redis==1.4.3 channels-redis==2.1.0
. But I found out that the ansible playbook is installing debian packages and one of them is redis-tools
and that has no version requirement so it is installing 3.0.6
– nmusleh
Nov 16 '18 at 15:21
Do I pin the redis version by just adding it to the requirements.txt file
redis==2.10.6
before the django-redis-cache and other redis dependent packages?– nmusleh
Nov 16 '18 at 15:41
Do I pin the redis version by just adding it to the requirements.txt file
redis==2.10.6
before the django-redis-cache and other redis dependent packages?– nmusleh
Nov 16 '18 at 15:41
I just added redis==2.10.6 in my requirements.txt and it worked :)
– nmusleh
Nov 16 '18 at 15:57
I just added redis==2.10.6 in my requirements.txt and it worked :)
– nmusleh
Nov 16 '18 at 15:57
@nmusleh Yes, thats all you should need if you are installing via
pip install -r requirements.txt
since it will force that version. If you are using other package managers, or if installing/upgrading manually with --upgrade
then it will upgrade dependencies unless you tell it not to with --no-deps
.– Andrew Backer
Nov 19 '18 at 3:04
@nmusleh Yes, thats all you should need if you are installing via
pip install -r requirements.txt
since it will force that version. If you are using other package managers, or if installing/upgrading manually with --upgrade
then it will upgrade dependencies unless you tell it not to with --no-deps
.– Andrew Backer
Nov 19 '18 at 3:04
add a comment |
Try installing redis-py below version 3
This is look like a comment please delete it and paste your proper answer and read How to Write good answer
– Ali
Nov 16 '18 at 10:40
Technically he is correct, though without providing any supporting docs and so on there would be no way to evaluate it.
– Andrew Backer
Nov 16 '18 at 11:32
add a comment |
Try installing redis-py below version 3
This is look like a comment please delete it and paste your proper answer and read How to Write good answer
– Ali
Nov 16 '18 at 10:40
Technically he is correct, though without providing any supporting docs and so on there would be no way to evaluate it.
– Andrew Backer
Nov 16 '18 at 11:32
add a comment |
Try installing redis-py below version 3
Try installing redis-py below version 3
answered Nov 16 '18 at 10:32
Fernando Ruiz HumanesFernando Ruiz Humanes
11
11
This is look like a comment please delete it and paste your proper answer and read How to Write good answer
– Ali
Nov 16 '18 at 10:40
Technically he is correct, though without providing any supporting docs and so on there would be no way to evaluate it.
– Andrew Backer
Nov 16 '18 at 11:32
add a comment |
This is look like a comment please delete it and paste your proper answer and read How to Write good answer
– Ali
Nov 16 '18 at 10:40
Technically he is correct, though without providing any supporting docs and so on there would be no way to evaluate it.
– Andrew Backer
Nov 16 '18 at 11:32
This is look like a comment please delete it and paste your proper answer and read How to Write good answer
– Ali
Nov 16 '18 at 10:40
This is look like a comment please delete it and paste your proper answer and read How to Write good answer
– Ali
Nov 16 '18 at 10:40
Technically he is correct, though without providing any supporting docs and so on there would be no way to evaluate it.
– Andrew Backer
Nov 16 '18 at 11:32
Technically he is correct, though without providing any supporting docs and so on there would be no way to evaluate it.
– Andrew Backer
Nov 16 '18 at 11:32
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53331405%2fdjango-compress-error-invalid-input-of-type-cachekey%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Good timing! I am damn sure all using django-redis must have been broken their prod environments with the unexpected backward incompatible changes.
– Babu
Nov 19 '18 at 9:16
@Babu It only broke our CI. Its not really the fault of redis-py, after all it was a major version bump so compatibility is explicitly not expected. django-redis should have been restricting what versions they allow, but even that is not an "incompatible change" on their part, just a bug in their setup.py.
– Andrew Backer
Nov 20 '18 at 5:05
Yeah, not blaming anyone here :)
– Babu
Nov 20 '18 at 18:11