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

Closed
kz26 opened this issue May 1, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@kz26
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/decorators.py", line 97, in wrapped_view
response = self.authenticate(self.fn, request, _args, *_kwargs)

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

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

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

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

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

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

File "/usr/lib/python2.7/dist-packages/memcache.py", line 813, in _get
self.check_key(key)

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

MemcachedKeyLengthError: Key length is > 250

@kz26

This comment has been minimized.

Copy link
Author

commented May 1, 2013

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

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

@tschellenbach

This comment has been minimized.

Copy link
Owner

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.

@tschellenbach

This comment has been minimized.

Copy link
Owner

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.