Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7822993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:05:40+00:00 2026-06-02T08:05:40+00:00

I try to install johnny cache with my django website. So i set up

  • 0

I try to install johnny cache with my django website.

So i set up all the johnny cache related settings like this:

CACHES = {
  'default': {
    # 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',                                                                                                        
    'LOCATION': '127.0.0.1:11211',
    'BACKEND': 'johnny.backends.memcached.MemcachedCache',
    'JOHNNY_CACHE': True,
  }
}

So far, the whole project still run properly in production mode.
But immediatly after setting up the middlewares
'johnny.middleware.LocalStoreClearMiddleware' and 'johnny.middleware.QueryCacheMiddleware' I get the following exception:

Environment:

Request Method: GET
Django Version: 1.3.1
Python Version: 2.6.6
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'core_knowledge_platform.core_web_service',
 'south']
Installed Middleware:
('johnny.middleware.LocalStoreClearMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'johnny.middleware.QueryCacheMiddleware')


Traceback:
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
  117.                             response = middleware_method(request, e)
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/u1/msc/vg55/public_html/core_knowledge_web_platform/core_knowledge_platform/core_web_service/views.py" in __call__
  95.         return getattr(self, method)(request, *args, **kwargs)
File "/u1/msc/vg55/public_html/core_knowledge_web_platform/core_knowledge_platform/core_web_service/views.py" in GET
  673.             if not access.validate_user_is_editor(request.user):
File "/u1/msc/vg55/public_html/core_knowledge_web_platform/core_knowledge_platform/core_web_service/business_logic/access.py" in validate_user_is_editor
  38.     if papergroups:
File "/usr/lib/python2.6/site-packages/django/db/models/query.py" in __nonzero__
  113.             iter(self).next()
File "/usr/lib/python2.6/site-packages/django/db/models/query.py" in _result_iter
  107.                 self._fill_cache()
File "/usr/lib/python2.6/site-packages/django/db/models/query.py" in _fill_cache
  772.                     self._result_cache.append(self._iter.next())
File "/usr/lib/python2.6/site-packages/django/db/models/query.py" in iterator
  273.         for row in compiler.results_iter():
File "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py" in results_iter
  698.                     row = self.resolve_columns(row, fields)
File "/usr/lib/python2.6/site-packages/django/db/backends/mysql/compiler.py" in resolve_columns
  12.         return row[:index_extra_select] + tuple(values)

Exception Type: TypeError at /publication/
Exception Value: cannot concatenate 'str' and 'tuple' objects

NB: johnny cache is not set in the INSTALLED_APPS as the documentation says it’s useless

EDIT:

Well, I’ve discovered that the exception is thrown only when there is a cache hit.
When I wait for the stored values in memcached to be expired, then on loading page, no exception is thrown…

To add more shadow to my issue, when I run the whole project with johnny activated in localhost, everything works out. But when I run it in prod environment (Apache/2.2.15 (CentOS)), there the exception is thrown…
And django version on both environment are exactly the same: 1.3.1

NB: I’ve set up the middleware order as specified by okm

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T08:05:41+00:00Added an answer on June 2, 2026 at 8:05 am

    I have had the exact same issue. While I am still trying to get to the exact bottom of it, I have found some useful things.

    1. Older versions of johnny cache work. Since I need master/slave setups to work, I used this fork: https://bitbucket.org/skoczen/johnny-cache It only includes commits up to November, so the problem is introduced after that.

    2. On the admin pages, the error is caused by the auth_user and auth_table table caches. Adding these to the JOHNNY_BLACKLIST circumvents the issue, and also disables caching for those tables. I doubt the issue is unique to those tables, so I’m blacklisting those tables is not a good solution.

    I have checked my configuration and tried many things, just like you and that is not the problem.

    Hope this helps.

    Edit:
    More digging has revealed that the issue crops up with this commit bcdb46c5d357, which added code to cache queries returning null: https://bitbucket.org/jmoiron/johnny-cache/changeset/bcdb46c5d357

    If you stick to an earlier one, it should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am try to install amqp for php (Integrating PHP with RabbitMQ) using this
I keep getting this error when I try to install a package: Download error
I try to install this phonegap plugin from github , but when I refer
When i try to install mysql on windows i get this error MySQL-python-0.9.2>python setup.py
i try to install my WebService on Windows-XP, and i got this error: The
I downloaded Tomcat 6 from Tomcat Website and try to install. I found the
I'm getting this error when I try and install node on my new mac
I try to install modx 1.0.5 on my WAMP server with this specification PHP
I have this error when I try to install Express-on-Railway JS framework, please help:
I've a Windows CE device on which I try to install all Exceptions message

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.