Knotis / djangocassandra

Cassandra support for the Django web framework
BSD 3-Clause "New" or "Revised" License
12 stars 4 forks source link

Final ouput rendering after migrate generates get_db_prep_lookup EmptyResultSet #61

Open N3TC4T opened 8 years ago

N3TC4T commented 8 years ago

Hey man

can you help me in this ? I've tried everything but no luck :'(

$ python manage.py migrate my_app --database=cassandra

Traceback (most recent call last): File "manage.py", line 12, in execute_from_command_line(sys.argv) File "/root/Desktop/app/lib/python2.7/site-packages/django/core/management/init.py", line 385, in execute_from_command_line utility.execute() File "/root/Desktop/app/lib/python2.7/site-packages/django/core/management/init.py", line 377, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/root/Desktop/app/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv self.execute(_args, _options.dict) File "/root/Desktop/app/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute output = self.handle(_args, _options) File "/root/Desktop/app/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 165, in handle emit_post_migrate_signal(created_models, self.verbosity, self.interactive, connection.alias) File "/root/Desktop/app/lib/python2.7/site-packages/django/core/management/sql.py", line 268, in emit_post_migrate_signal using=db) File "/root/Desktop/app/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 198, in send response = receiver(signal=self, sender=sender, *_named) File "/root/Desktop/app/lib/python2.7/site-packages/django/contrib/auth/management/init.py", line 94, in create_permissions "content_type", "codename" File "/root/Desktop/app/lib/python2.7/site-packages/django/db/models/query.py", line 141, in iter self._fetch_all() File "/root/Desktop/app/lib/python2.7/site-packages/django/db/models/query.py", line 966, in _fetch_all self._result_cache = list(self.iterator()) File "/root/Desktop/app/lib/python2.7/site-packages/django/db/models/query.py", line 1205, in iterator for row in self.query.get_compiler(self.db).results_iter(): File "/root/Desktop/app/lib/python2.7/site-packages/djangotoolbox/db/basecompiler.py", line 407, in results_iter results = self.build_query(fields).fetch( File "/root/Desktop/app/lib/python2.7/site-packages/djangotoolbox/db/basecompiler.py", line 542, in build_query query.add_filters(self.query.where) File "/root/Desktop/app/lib/python2.7/site-packages/djangocassandra/db/backends/cassandra/utils.py", line 20, in _func return func(_args, **kwargs) File "/root/Desktop/app/lib/python2.7/site-packages/djangocassandra/db/backends/cassandra/compiler.py", line 447, in add_filters self.root_predicate = self.init_predicate(None, filters) File "/root/Desktop/app/lib/python2.7/site-packages/djangocassandra/db/backends/cassandra/compiler.py", line 404, in init_predicate child File "/root/Desktop/app/lib/python2.7/site-packages/djangocassandra/db/backends/cassandra/compiler.py", line 410, in init_predicate decoded_child = self._decode_child(node) File "/root/Desktop/app/lib/python2.7/site-packages/djangotoolbox/db/basecompiler.py", line 199, in _decode_child rhs, rhs_params = child.process_rhs(self.compiler, self.connection) File "/root/Desktop/app/lib/python2.7/site-packages/django/db/models/lookups.py", line 112, in process_rhs return self.get_db_prep_lookup(value, connection) File "/root/Desktop/app/lib/python2.7/site-packages/django/db/models/lookups.py", line 211, in get_db_prep_lookup raise EmptyResultSet django.db.utils.DatabaseError

sethdenner commented 8 years ago

I get this error after running migrate. I'm not sure why it gets thrown but the migration actually goes through. Double check your cassandra keyspace and see if your column families have been created corretly despite this error.

N3TC4T commented 8 years ago

Thanks man .

sethdenner commented 8 years ago

I'm going to keep this issue open since it is a bug; but I'm going to update the title to more accurately reflect the issue.

sethdenner commented 8 years ago

This happens when Django is trying to generate the final output after the migrate command finishes successfully.