com.datastax.driver.core.exceptions.InvalidQueryException: no keyspace has been specified

DataStax JIRA | Joaquin Casares | 4 years ago
  1. 0

    When uploading a large dataset in Cassandra, I got a an _InvalidQueryException: no keyspace has been specified_. The exception seems to be related to a timeout on _Connection#setKeyspace_, which is ignored. To my understanding, the query is issued using a connection for which the keyspace has not been set, and the query fails, returning an _InvalidQueryException_. This is the service log: {code} 2014-08-14 10:51:33,865 WARN [Worker-0] com.datastax.driver.core.Connection - Timeout while setting keyspace on connection to cassandra-04.prod.visualdna.com/10.200.40.64:9042. This should not happen but is not critical (it will retried) 2014-08-14 10:51:34,379 WARN [Worker-0] com.datastax.driver.core.Connection - Timeout while setting keyspace on connection to cassandra-04.prod.visualdna.com/10.200.40.64:9042. This should not happen but is not critical (it will retried) 2014-08-14 10:51:34,889 WARN [Worker-0] com.datastax.driver.core.Connection - Timeout while setting keyspace on connection to cassandra-04.prod.visualdna.com/10.200.40.64:9042. This should not happen but is not critical (it will retried) 2014-08-14 10:51:35,405 WARN [Worker-0] com.datastax.driver.core.Connection - Timeout while setting keyspace on connection to cassandra-04.prod.visualdna.com/10.200.40.64:9042. This should not happen but is not critical (it will retried) com.datastax.driver.core.exceptions.InvalidQueryException: no keyspace has been specified at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:35) at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:256) at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:172) at net.imagini.common.dao.cassandra.datastax.DatastaxCassandraDataAccess$AsyncOperationExecutor.tryGetFuture(DatastaxCassandraDataAccess.java:802) at net.imagini.common.dao.cassandra.datastax.DatastaxCassandraDataAccess$AsyncOperationExecutor.join(DatastaxCassandraDataAccess.java:784) at net.imagini.common.dao.cassandra.datastax.DatastaxCassandraDataAccess.executeBatchMutation(DatastaxCassandraDataAccess.java:267) at net.imagini.common.dao.cassandra.datastax.DatastaxCassandraDataAccess.executeMutation(DatastaxCassandraDataAccess.java:291) at net.imagini.sprinkler.workers.BaseCassandraWorker.commit(BaseCassandraWorker.java:146) at net.imagini.sprinkler.workers.BaseCassandraWorker.throttledCommit(BaseCassandraWorker.java:132) at net.imagini.sprinkler.workers.BaseCassandraWorker.processQueue(BaseCassandraWorker.java:93) at net.imagini.sprinkler.workers.BaseCassandraWorker.run(BaseCassandraWorker.java:58) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: no keyspace has been specified at com.datastax.driver.core.Responses$Error.asException(Responses.java:97) at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:108) at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:235) at com.datastax.driver.core.RequestHandler.onSet(RequestHandler.java:367) at com.datastax.driver.core.Connection$Dispatcher.messageReceived(Connection.java:571) at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443) at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303) at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) ... 3 more {code}

    DataStax JIRA | 2 years ago | Antonio Barbuzzi
    com.datastax.driver.core.exceptions.InvalidQueryException: no keyspace has been specified
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    When uploading a large dataset in Cassandra, I got a an _InvalidQueryException: no keyspace has been specified_. The exception seems to be related to a timeout on _Connection#setKeyspace_, which is ignored. To my understanding, the query is issued using a connection for which the keyspace has not been set, and the query fails, returning an _InvalidQueryException_. This is the service log: {code} 2014-08-14 10:51:33,865 WARN [Worker-0] com.datastax.driver.core.Connection - Timeout while setting keyspace on connection to cassandra-04.prod.visualdna.com/10.200.40.64:9042. This should not happen but is not critical (it will retried) 2014-08-14 10:51:34,379 WARN [Worker-0] com.datastax.driver.core.Connection - Timeout while setting keyspace on connection to cassandra-04.prod.visualdna.com/10.200.40.64:9042. This should not happen but is not critical (it will retried) 2014-08-14 10:51:34,889 WARN [Worker-0] com.datastax.driver.core.Connection - Timeout while setting keyspace on connection to cassandra-04.prod.visualdna.com/10.200.40.64:9042. This should not happen but is not critical (it will retried) 2014-08-14 10:51:35,405 WARN [Worker-0] com.datastax.driver.core.Connection - Timeout while setting keyspace on connection to cassandra-04.prod.visualdna.com/10.200.40.64:9042. This should not happen but is not critical (it will retried) com.datastax.driver.core.exceptions.InvalidQueryException: no keyspace has been specified at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:35) at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:256) at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:172) at net.imagini.common.dao.cassandra.datastax.DatastaxCassandraDataAccess$AsyncOperationExecutor.tryGetFuture(DatastaxCassandraDataAccess.java:802) at net.imagini.common.dao.cassandra.datastax.DatastaxCassandraDataAccess$AsyncOperationExecutor.join(DatastaxCassandraDataAccess.java:784) at net.imagini.common.dao.cassandra.datastax.DatastaxCassandraDataAccess.executeBatchMutation(DatastaxCassandraDataAccess.java:267) at net.imagini.common.dao.cassandra.datastax.DatastaxCassandraDataAccess.executeMutation(DatastaxCassandraDataAccess.java:291) at net.imagini.sprinkler.workers.BaseCassandraWorker.commit(BaseCassandraWorker.java:146) at net.imagini.sprinkler.workers.BaseCassandraWorker.throttledCommit(BaseCassandraWorker.java:132) at net.imagini.sprinkler.workers.BaseCassandraWorker.processQueue(BaseCassandraWorker.java:93) at net.imagini.sprinkler.workers.BaseCassandraWorker.run(BaseCassandraWorker.java:58) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: com.datastax.driver.core.exceptions.InvalidQueryException: no keyspace has been specified at com.datastax.driver.core.Responses$Error.asException(Responses.java:97) at com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:108) at com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:235) at com.datastax.driver.core.RequestHandler.onSet(RequestHandler.java:367) at com.datastax.driver.core.Connection$Dispatcher.messageReceived(Connection.java:571) at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) at org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:70) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443) at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303) at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) ... 3 more {code}

    DataStax JIRA | 2 years ago | Antonio Barbuzzi
    com.datastax.driver.core.exceptions.InvalidQueryException: no keyspace has been specified

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.datastax.driver.core.exceptions.InvalidQueryException

      no keyspace has been specified

      at com.datastax.driver.core.ResultSetFuture.convertException()
    2. DataStax Java Driver for Apache Cassandra - Core
      PreparedStatementTest.reprepareOnNewlyUpNodeNoKeyspaceTest
      1. com.datastax.driver.core.ResultSetFuture.convertException(ResultSetFuture.java:270)
      2. com.datastax.driver.core.Session.toPreparedStatement(Session.java:220)
      3. com.datastax.driver.core.Session.prepare(Session.java:170)
      4. com.datastax.driver.core.PreparedStatementTest.reprepareOnNewlyUpNodeTest(PreparedStatementTest.java:288)
      5. com.datastax.driver.core.PreparedStatementTest.reprepareOnNewlyUpNodeNoKeyspaceTest(PreparedStatementTest.java:319)
      5 frames