-
Notifications
You must be signed in to change notification settings - Fork 147
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
TypeError: 'NoneType' object is not iterable #15
Comments
Probably coming from ElastiCache that chose to return |
This is not invalid; I get the same problem with |
@dan-passaro The error message may be the same, but the problem is different:
Anyway, I’ve been testing django-cachalot against a ton of supported softwares (see https://travis-ci.org/BertrandBordage/django-cachalot) for a year, and at no moment I could see something like that. Please send your Python, Django, memcached, python-memcached, and OS versions, it may help us find the reason. |
Python 2.7.9 I have been looking into it more, and if the only calls to cache are all in EDIT: Looks like
This PDB is in Curiously it fails differently with other large data, e.g.:
|
I guess the underlying bug is in python-memcached (or memcached itself but I feel that's impossibly unlikely)...
Note it returns FWIW this "only shows up on Django 1.8" because I forgot that as part of moving to Django 1.8, we also had to move from |
I am unable to reproduce this bug outside the pdb context. I serialized I'm convinced it's a bug with python-memcache not correctly determining timeouts on set. Switching to pylibmc consistently causes a timeout exception to be raised instead, after which subsequent requests to the page in question generate the same TypeError in cachalot. This suggests to me that independent of client, a set operation that times out leaves a dangling, null key in memcached. I've unfortunately sunk too much time trying to figure this problem out to get specific reproduction steps or to properly identify the issue. As there are other pressing things I need to do here at work, I'm going to fork cachalot and duct-tape over the problem by handling/skipping |
Thanks for trying to solve this, I don’t really understand either what’s causing this. By the way, are you using Windows? It may be the cause of the issue, I don’t know how memcached behaves on Windows and most Django developers are Linux or MacOS users. |
No, the servers use FreeTDS to connect to a legacy SQL Server DB. We're I understand not wanting to support SQL Server, but I think the code in And even without support, Cachalot works amazingly well! Thanks for putting |
Yes, that’s why I said I don’t understand ;) I know it’s not DB related in this case, but anyway, it’s not totally safe to use it with an unsupported DB. In django-cachalot 1.1, a system check error will prevent you from using this unsafe combination. However, you’ll be able to skip this error using SILENCED_SYSTEM_CHECKS. What’s weird about your large object issue is that it should throw the error described in the limits of memcached. Try to tweak the settings as I suggested in that piece of doc, it may fix the issue. Glad you enjoy Cachalot besides that :D |
I ran into this exact issue. I just went into the shell, cleared the cache and the issue was resolved. (Using Python 3.5, Django 1.10 and Memcached) |
running django-cachalot with Django 1.8, memcached and ElastiCache
File "/opt/python/run/venv/lib/python2.7/site-packages/cachalot/monkey_patch.py", line 57, in _get_result_or_execute_query
new_table_cache_keys.difference_update(data)
TypeError: 'NoneType' object is not iterable
The text was updated successfully, but these errors were encountered: