kreynolds / cassandra-cql

DBI-like CQL driver for Cassandra in Ruby
Apache License 2.0
67 stars 43 forks source link

"No keyspace has been specified" #42

Open outoftime opened 11 years ago

outoftime commented 11 years ago

I'm seeing this error, which is a little baffling. The scenario is typically a worker process that has been running for a while without needing to touch the Cassandra connection. Then it finally does try a query to Cassandra, and explodes on this.

Weird that it throws a "no keyspace has been specified" error when the query is specifying a keyspace...

CassandraCQL::Error::InvalidRequestException
Error
no keyspace has been specified
cassandra-cql-1.1.4/lib/cassandra-cql/database.rb:101:in `rescue in execute_cql_query'
cassandra-cql-1.1.4/lib/cassandra-cql/database.rb:99:in `execute_cql_query'
cassandra-cql-1.1.4/lib/cassandra-cql/statement.rb:47:in `execute'
cassandra-cql-1.1.4/lib/cassandra-cql/database.rb:88:in `execute'
cassandra-cql-1.1.4/lib/cassandra-cql/database.rb:47:in `block in connect!'
thrift_client-0.8.3/lib/thrift_client/abstract_thrift_client.rb:122:in `call'
thrift_client-0.8.3/lib/thrift_client/abstract_thrift_client.rb:122:in `block in do_callbacks'
thrift_client-0.8.3/lib/thrift_client/abstract_thrift_client.rb:121:in `each'
thrift_client-0.8.3/lib/thrift_client/abstract_thrift_client.rb:121:in `do_callbacks'
thrift_client-0.8.3/lib/thrift_client/abstract_thrift_client.rb:99:in `connect!'
thrift_client-0.8.3/lib/thrift_client/abstract_thrift_client.rb:153:in `handled_proxy'
thrift_client-0.8.3/lib/thrift_client/abstract_thrift_client.rb:53:in `execute_cql_query'
cassandra-cql-1.1.4/lib/cassandra-cql/database.rb:99:in `execute_cql_query'
cassandra-cql-1.1.4/lib/cassandra-cql/statement.rb:47:in `execute'
cassandra-cql-1.1.4/lib/cassandra-cql/database.rb:88:in `execute'

Any ideas? For now I'd be thrilled by a workaround...

ameliaj8 commented 11 years ago

I've also encountered this error. Restarting the process fixes it, but a proper fix would be appreciated.

askumar commented 9 years ago

Hi, I am getting error when i do CassandraCQL::Database.new('127.0.0.1:9160', {:keyspace => 'keyspace1'})

CassandraCQL::Error::InvalidRequestException: Keyspace 'keyspace1' does not exist from /usr/local/share/gems/gems/cassandra-cql-1.2.2/lib/cassandra-cql/database.rb:121:in rescue in execute_cql_query' from /usr/local/share/gems/gems/cassandra-cql-1.2.2/lib/cassandra-cql/database.rb:115:inexecute_cql_query' from /usr/local/share/gems/gems/cassandra-cql-1.2.2/lib/cassandra-cql/statement.rb:47:in execute' from /usr/local/share/gems/gems/cassandra-cql-1.2.2/lib/cassandra-cql/database.rb:104:inexecute' from /usr/local/share/gems/gems/cassandra-cql-1.2.2/lib/cassandra-cql/database.rb:63:in block in connect!' from /usr/local/share/gems/gems/thrift_client-0.8.4/lib/thrift_client/abstract_thrift_client.rb:128:incall' from /usr/local/share/gems/gems/thrift_client-0.8.4/lib/thrift_client/abstract_thrift_client.rb:128:in block in do_callbacks' from /usr/local/share/gems/gems/thrift_client-0.8.4/lib/thrift_client/abstract_thrift_client.rb:127:ineach' from /usr/local/share/gems/gems/thrift_client-0.8.4/lib/thrift_client/abstract_thrift_client.rb:127:in do_callbacks' from /usr/local/share/gems/gems/thrift_client-0.8.4/lib/thrift_client/abstract_thrift_client.rb:100:inconnect!' from /usr/local/share/gems/gems/cassandra-cql-1.2.2/lib/cassandra-cql/database.rb:65:in connect!' from /usr/local/share/gems/gems/cassandra-cql-1.2.2/lib/cassandra-cql/database.rb:38:ininitialize'

Any idea why?