Skip to content
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

Django-facebook failure with Memcached #304

kz26 opened this issue May 1, 2013 · 3 comments


None yet
2 participants
Copy link

commented May 1, 2013

From a Django 1.5 instance using memcached exclusively for the session backend. Occurs when trying to perform a Facebook login via POST to /facebook/connect.

File "/home/app/lib/python2.7/site-packages/django_facebook/", line 97, in wrapped_view
response = self.authenticate(self.fn, request, _args, *_kwargs)

File "/home/app/lib/python2.7/site-packages/django_facebook/", line 171, in authenticate
request, redirect_uri=redirect_uri)

File "/home/app/lib/python2.7/site-packages/django_facebook/", line 29, in require_persistent_graph
graph = get_persistent_graph(request, _args, *_kwargs)

File "/home/app/lib/python2.7/site-packages/django_facebook/", line 69, in get_persistent_graph
graph = get_facebook_graph(request, _args, *_kwargs)

File "/home/app/lib/python2.7/site-packages/django_facebook/", line 161, in get_facebook_graph
access_token = cache.get(cache_key)

File "/home/app/lib/python2.7/site-packages/django/core/cache/backends/", line 64, in get
val = self._cache.get(key)

File "/usr/lib/python2.7/dist-packages/", line 862, in get
return self._get('get', key)

File "/usr/lib/python2.7/dist-packages/", line 813, in _get

File "/usr/lib/python2.7/dist-packages/", line 1023, in check_key
% self.server_max_key_length)

MemcachedKeyLengthError: Key length is > 250


This comment has been minimized.

Copy link

commented May 1, 2013

This can be fixed by MD5'ing the generated cache key in

I'll submit a pull request when I have time.


This comment has been minimized.

Copy link

commented May 1, 2013

started seeing the same problem today, this is going to be resolved in a few hours.
if you could fix it before that though that would be great.


This comment has been minimized.

Copy link

commented May 1, 2013

Thanks for reporting this!!
Fixed in the latest release. 5.0.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.