I am running a python(3.4) flask app on aws beanstalk(amazon linux). When I login to ec2 shell and try to run flask app locally, it runs properly and easily fetches data from remote cassandra.
But while fetching data from cassandra the app run by AWS eb keep throwing following errors in httpd/error_log.
ERROR in app: Exception on /user/1003 [GET]
Traceback (most recent call last):
File "/opt/python/run/venv/lib/python3.4/site-packages/flask/app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/opt/python/run/venv/lib/python3.4/site-packages/flask/app.py", line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/python/run/venv/lib/python3.4/site-packages/flask/app.py", line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/opt/python/run/venv/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
raise value
File "/opt/python/run/venv/lib/python3.4/site-packages/flask/app.py", line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/python/run/venv/lib/python3.4/site-packages/flask/app.py", line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/opt/python/current/app/application.py", line 53, in user_profile
data = get_user_data(id)
File "/opt/python/current/app/application.py", line 163, in get_user_data
if obj:
File "/opt/python/run/venv/lib64/python3.4/site-packages/cassandra/cqlengine/query.py", line 393, in __le
n__
self._execute_query()
File "/opt/python/run/venv/lib64/python3.4/site-packages/cassandra/cqlengine/query.py", line 428, in _exe
cute_query
self._result_generator = (i for i in self._execute(self._select_query()))
File "/opt/python/run/venv/lib64/python3.4/site-packages/cassandra/cqlengine/query.py", line 360, in _exe
cute
result = _execute_statement(self.model, statement, self._consistency, self._timeout)
File "/opt/python/run/venv/lib64/python3.4/site-packages/cassandra/cqlengine/query.py", line 1412, in _ex
ecute_statement
parts = model._routing_key_from_values(key_values, connection.get_cluster().protocol_version)
File "/opt/python/run/venv/lib64/python3.4/site-packages/cassandra/cqlengine/connection.py", line 183, in
get_cluster
raise CQLEngineException("%s.cluster is not configured. Call one of the setup or default functions firs
t." % __name__)
cassandra.cqlengine.CQLEngineException: cassandra.cqlengine.connection.cluster is not configured. Call one
of the setup or default functions first.
Regards,
Vaibhav