Comments (11)
Timeout has nothing to do with it. Please try to add lazy_connect: True just below retry_connect and try again.
from django-cassandra-engine.
Thanks for your reply. But I tried that it didn't work I still have the same error:
File "/Library/Python/2.7/site-packages/cqlengine/query.py", line 870, in _execute
tmp = execute(q, consistency_level=self._consistency, timeout=self._timeout)
File "/Library/Python/2.7/site-packages/cqlengine/connection.py", line 89, in execute
raise CQLEngineException("It is required to setup() cqlengine before executing queries")
CQLEngineException: It is required to setup() cqlengine before executing queries
from django-cassandra-engine.
Has only this query problems to run or other too? Could you tell me more about your environment? Have you tried to run it in Django shell? Are you sure Cassandra is working fine?
from django-cassandra-engine.
I have this problem every where I try the same kind of query in my django app.
I try django shell and everything seem to be fine there. I can filter by id, author... and I get a results. The problem is that sometimes it fails because of an OperationTimeout. Same when I use the cql shell.
That is why I suspected the timeout settings in the django settings file.
This is what I am getting from the django app now, which is what the django shell gives me as well:
OperationTimedOut at /api/persons/8c680558-f301-11e4-abc7-000c290119be/
errors={}, last_host=192.168.10.201
from django-cassandra-engine.
Do you have this error in uwsgi or just regular Django development server?
from django-cassandra-engine.
It occured on the regular django developement server.
I started a new project which does the same thing and I don't have the same
problem. There is probably something that I added without knowing in the
previous project. I will start removing all unnecessary code and I will see
how it goes.
On Thu, May 14, 2015 at 8:38 AM, Rafał Furmański [email protected]
wrote:
Do you have this error in uwsgi or just regular Django development server?
—
Reply to this email directly or view it on GitHub
#34 (comment)
.
from django-cassandra-engine.
Hi Rafal,
The reason why my old code is not working is that it constructs queries
like this:
Users: SELECT * FROM None.user_image LIMIT 10000
It can't attach the correct keyspace and when cqlengine tries to connect to
it, it fails.
My cassandra settings look correct:
'cassandra': {
'ENGINE': 'django_cassandra_engine',
'NAME': 'mydb',
'TEST_NAME': 'test_ mydb',
'HOST':'127.0.0.1', #
development
'PORT': 9042,
'OPTIONS': {
'replication': {
'strategy_class': 'SimpleStrategy',
'replication_factor': 1
}
},
}
Do you have any ideas where I can make a fix?
Regards,
Patrick
On Thu, May 14, 2015 at 9:20 AM, Patrick Tchankue [email protected]
wrote:
It occured on the regular django developement server.
I started a new project which does the same thing and I don't have the
same problem. There is probably something that I added without knowing in
the previous project. I will start removing all unnecessary code and I will
see how it goes.On Thu, May 14, 2015 at 8:38 AM, Rafał Furmański <[email protected]
wrote:
Do you have this error in uwsgi or just regular Django development server?
—
Reply to this email directly or view it on GitHub
#34 (comment)
.
from django-cassandra-engine.
I can't say for sure what's wrong with your settings..
Perhaps you're setting 'NAME' option to None somehow?
Does my testproject work for you?
from django-cassandra-engine.
Hi Rafal,
I managed to figure out what was wrong. I couldn't connect to cassandra
because, a colleague removed the anonymous account on my cassandra server.
I wasn't aware of that, it is only today that I accessed the logs and I saw
an authentifcation error.
So I added two key values to cassandra settings (USER and PASSWORD),
everything seems normal now.
Thanks again for your time, I much appreciate it.
Regards,
Patrick
On Fri, Jun 5, 2015 at 10:16 PM, Rafał Furmański [email protected]
wrote:
I can't say for sure what's wrong with your settings..
Perhaps you're setting 'NAME' option to None somehow?
Does my testproject work for you?—
Reply to this email directly or view it on GitHub
#34 (comment)
.
from django-cassandra-engine.
Hah, no problem. I hope you'll find this project useful. Closing then.
from django-cassandra-engine.
i have the same problem :(
File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = wrapped_callback(request, _callback_args, *_callback_kwargs)
File "./users/views.py", line 14, in login
if login_form.is_valid():
File "/usr/lib/python2.7/site-packages/django/forms/forms.py", line 162, in is_valid
return self.is_bound and not bool(self.errors)
File "/usr/lib/python2.7/site-packages/django/forms/forms.py", line 154, in errors
self.full_clean()
File "/usr/lib/python2.7/site-packages/django/forms/forms.py", line 354, in full_clean
self._clean_form()
File "/usr/lib/python2.7/site-packages/django/forms/forms.py", line 378, in _clean_form
cleaned_data = self.clean()
File "./users/forms.py", line 15, in clean
user = Users.objects.get(email=email)
File "build/bdist.linux-x86_64/egg/cqlengine/query.py", line 531, in get
return self.filter(_args, *_kwargs).get()
File "build/bdist.linux-x86_64/egg/cqlengine/query.py", line 533, in get
self._execute_query()
File "build/bdist.linux-x86_64/egg/cqlengine/query.py", line 317, in _execute_query
self._result_cache = list(self._execute(self._select_query()))
File "build/bdist.linux-x86_64/egg/cqlengine/query.py", line 251, in _execute
result = execute(q, consistency_level=self._consistency, timeout=self._timeout)
File "build/bdist.linux-x86_64/egg/cqlengine/connection.py", line 89, in execute
raise CQLEngineException("It is required to setup() cqlengine before executing queries")
in uwsgi and manage.py runserver
from django-cassandra-engine.
Related Issues (20)
- Can't delete from admin - You cannot .filter() on a DjangoCassandraQuerySet which has been ordered using python HOT 1
- Support for values_list 'named' keyword argument
- Django 3.0 support HOT 4
- admin ui HOT 1
- TypeError: sql_flush() got an unexpected keyword argument 'reset_sequences' HOT 2
- Date must be mapped to DateField in serializers
- Creating keyspace but models are not syncing HOT 2
- Multiple cassandra configurations HOT 5
- Stale Cached Response on GET HOT 2
- Can I use Scylla's scylla-driver with this? HOT 1
- built-in ORM HOT 3
- Error while connecting to AWS Keyspace HOT 2
- django cassnadra migration HOT 1
- Does this library support connecting through TLS (if possible, with client cert auth)?
- Discord server HOT 1
- Can't connect to K8ssandra in minikube, problem with settings HOT 1
- django 3.2 LTS support & Python 3.7+ only
- Looking for a way to dump any CQL statement to logging
- cassandra.cluster.NoHostAvailable
- sync_cassandra command fails after syncing 1 model HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-cassandra-engine.