question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cassandra.cqlengine.CQLEngineException: Connection name '<object object at 0x7eff59dcc8e0>' doesn't exist in the registry.

See original GitHub issue

Hi! I’m experiencing an issue where django-cassandra-engine stops working due to new Cython version not being compatible with cassandra-driver python package. I looked around the web a bit, and it suggests to me that Cython version needs to be 0.24.1, as Cython 0.25 breaks the cassandra-driver.

Thankfully, Datastax team released a new version of cassandra-driver: 3.7.1, and Cython issue is gone but now I’m having a new issue.

All I can speculate from your code and cassandra-driver codebase is that your connection.get_session() no longer works as cassandra-driver’s _connections dictionary is empty at the point of failure.

I spent the whole day to burn and crash therefore, any solution or advice would be really appreciated 😉

The below is the traceback from my Docker environment.

Thanks!!!

Traceback (most recent call last): File “/code/manage.py”, line 10, in <module> execute_from_command_line(sys.argv) File “/usr/local/lib/python2.7/site-packages/django/core/management/init.py”, line 353, in execute_from_command_line utility.execute() File “/usr/local/lib/python2.7/site-packages/django/core/management/init.py”, line 327, in execute django.setup() File “/usr/local/lib/python2.7/site-packages/django/init.py”, line 18, in setup apps.populate(settings.INSTALLED_APPS) File “/usr/local/lib/python2.7/site-packages/django/apps/registry.py”, line 108, in populate app_config.import_models(all_models) File “/usr/local/lib/python2.7/site-packages/django/apps/config.py”, line 202, in import_models self.models_module = import_module(models_module_name) File “/usr/local/lib/python2.7/importlib/init.py”, line 37, in import_module import(name) File “/usr/local/lib/python2.7/site-packages/django_cassandra_engine/models/init.py”, line 5, in <module> conn.connect() File “/usr/local/lib/python2.7/site-packages/django_cassandra_engine/base/init.py”, line 104, in connect self.connection = CassandraConnection(**settings) File “/usr/local/lib/python2.7/site-packages/django_cassandra_engine/connection.py”, line 58, in init self.setup() File “/usr/local/lib/python2.7/site-packages/django_cassandra_engine/connection.py”, line 62, in setup self.session = connection.get_session() File “/usr/local/lib/python2.7/site-packages/cassandra/cqlengine/connection.py”, line 293, in get_session conn = get_connection(connection) File “/usr/local/lib/python2.7/site-packages/cassandra/cqlengine/connection.py”, line 190, in get_connection raise CQLEngineException(“Connection name ‘{0}’ doesn’t exist in the registry.”.format(name)) cassandra.cqlengine.CQLEngineException: Connection name ‘<object object at 0x7eff59dcc8e0>’ doesn’t exist in the registry.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
bicepjaicommented, Jul 6, 2020

this is happening again with these versions. anyone faced this issue and resolved it ?

cassandra-driver==3.24.0
Django==2.2
django-cassandra-engine==1.6.1

when starting the all and trying to get queryset

app_container       | Traceback (most recent call last):
app_container       |   File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
app_container       |     response = get_response(request)
app_container       |   File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 115, in _get_response
app_container       |     response = self.process_exception_by_middleware(e, request)
app_container       |   File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 113, in _get_response
app_container       |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
app_container       |   File "/app/app/views.py", line 14, in query_view
app_container       |     test_text = str(list(Storage_Keys_DCDF_GB.objects.all()))
app_container       |   File "/usr/local/lib/python3.8/site-packages/cassandra/cqlengine/query.py", line 437, in __len__
app_container       |     self._execute_query()
app_container       |   File "/usr/local/lib/python3.8/site-packages/cassandra/cqlengine/query.py", line 472, in _execute_query
app_container       |     self._result_generator = (i for i in self._execute(self._select_query()))
app_container       |   File "/usr/local/lib/python3.8/site-packages/cassandra/cqlengine/query.py", line 404, in _execute
app_container       |     result = _execute_statement(self.model, statement, self._consistency, self._timeout, connection=connection)
app_container       |   File "/usr/local/lib/python3.8/site-packages/cassandra/cqlengine/query.py", line 1531, in _execute_statement
app_container       |     return conn.execute(s, params, timeout=timeout, connection=connection)
app_container       |   File "/usr/local/lib/python3.8/site-packages/cassandra/cqlengine/connection.py", line 331, in execute
app_container       |     conn = get_connection(connection)
app_container       |   File "/usr/local/lib/python3.8/site-packages/cassandra/cqlengine/connection.py", line 241, in get_connection
app_container       |     raise CQLEngineException("Connection name '{0}' doesn't exist in the registry.".format(name))
app_container       | cassandra.cqlengine.CQLEngineException: Connection name '<object object at 0x7f88d52eaed0>' doesn't exist in the registry.
1reaction
piecubedcommented, Jan 9, 2021

Im also having this issue on python3.8

Read more comments on GitHub >

github_iconTop Results From Across the Web

CQL Engine Exception about a connection name not existing ...
This happens with cassandra-driver-3.7. When I downgraded the version to 3.6 and 3.5 things started working. My laptop has 3.5 on it and...
Read more >
Trying to use Model, getting CQLEngineException ...
cassandra.cqlengine.CQLEngineException: Connection name '<object object at 0x7fbd95322ab0>' doesn't exist in the registry. How can I fix it?
Read more >
Cassandra Driver 3.13.0 documentation - GitHub Pages
Source code for cassandra.cqlengine.connection ... None session = None # connections registry DEFAULT_CONNECTION = object() _connections = {} # Because type ...
Read more >
cassandra.cqlengine.CQLEngineException Example
def set_default_connection(name): global cluster, session if name not in ... raise CQLEngineException("Connection name '{0}' doesn't exist in the registry.
Read more >
cassandra.cqlengine.query - Query and filter model objects
distinct_fields default to the partition key fields if not specified. Note: distinct_fields must be a partition key or a static column. class Automobile(Model): ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found