Giter VIP home page Giter VIP logo

Comments (11)

r4fek avatar r4fek commented on July 20, 2024

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.

ptchankue avatar ptchankue commented on July 20, 2024

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.

r4fek avatar r4fek commented on July 20, 2024

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.

ptchankue avatar ptchankue commented on July 20, 2024

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.

r4fek avatar r4fek commented on July 20, 2024

Do you have this error in uwsgi or just regular Django development server?

from django-cassandra-engine.

ptchankue avatar ptchankue commented on July 20, 2024

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.

ptchankue avatar ptchankue commented on July 20, 2024

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.

r4fek avatar r4fek commented on July 20, 2024

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.

ptchankue avatar ptchankue commented on July 20, 2024

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.

r4fek avatar r4fek commented on July 20, 2024

Hah, no problem. I hope you'll find this project useful. Closing then.

from django-cassandra-engine.

gelezayka avatar gelezayka commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.