com.datastax.driver.core.exceptions.OperationTimedOutException: [localhost/127.0.0.1:9142] Timed out waiting for server response

GitHub | itstata | 4 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    newbie how can set enable_user_defined_functions=true in cassandra.yaml

    Google Groups | 8 months ago | Andy Davidson
    com.datastax.driver.core.exceptions.InvalidQueryException: User-defined functions are disabled in cassandra.yaml - set enable_user_defined_functions=true to enable
  2. 0

    Connection timed out while dropping keyspace

    Stack Overflow | 2 weeks ago | Hossein
    com.datastax.driver.core.exceptions.OperationTimedOutException: [/192.168.0.1:9042] Timed out waiting for server response
  3. 0

    i am using cassandra 2.0.9 and datastax java driver 3.0.0. I had too many NoHostAvailableException after some ReadTimeOutException and WriteTimeOutException.NoHostException occurred even though cassandra is normal and listening in 9160 and 9042 ports. It says some connections are closed, if connections are closed then it should establish new connections for processing. i haven't set connectionsPerHost. My code to connect cassandra using driver {code:java} private static Cluster constructCluster(String hostName,String port) { String[] hostNames = hostName.split(","); SocketOptions sOptions = new SocketOptions(); sOptions.setKeepAlive(true); QueryOptions qOptions = new QueryOptions().setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM) .setFetchSize(500); LatencyAwarePolicy loadBalancingPolicy = LatencyAwarePolicy.builder(DCAwareRoundRobinPolicy.builder().withLocalDc(defaultDC).build()) .build(); Cluster cluster = Cluster.builder() .addContactPoints(hostNames) .withLoadBalancingPolicy(loadBalancingPolicy) .withPoolingOptions(new PoolingOptions()) .withQueryOptions(qOptions) .withReconnectionPolicy(new ConstantReconnectionPolicy(TimeUnit.SECONDS.toMillis(5))) .withRetryPolicy(new LoggingRetryPolicy(DefaultRetryPolicy.INSTANCE)) .withSocketOptions(sOptions) .build(); LOGGER.log(Level.SEVERE, "host name {0}", hostName); return cluster; } {code} My exception trace {code:java} com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.250.151:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.250.151] Connection has been closed), /192.168.249.134:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: [/192.168.249.134] Timed out waiting for server response), /192.168.250.165:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.250.165] Connection has been closed), /192.168.249.91:9042, /192.168.251.84:9042 [only showing errors of first 3 hosts, use getErrors() for more details]) at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:84) at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:37) at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37) at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:63) {code} another exception trace {code:java} com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.249.134:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: [/192.168.249.134] Timed out waiting for server response), /192.168.251.84:9042 (com.datastax.driver.core.exceptions.DriverException: Timeout while trying to acquire available connection (you may want to increase the driver number of per-host connections)), /192.168.250.151:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.250.151] Connection has been closed), /192.168.250.165:9042, /192.168.249.91:9042 [only showing errors of first 3 hosts, use getErrors() for more details]) at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:84) at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:37) at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37) at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:63) {code} I cannot reproduce this issue later.

    DataStax JIRA | 12 months ago | Rishikesan
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.250.151:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.250.151] Connection has been closed), /192.168.249.134:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: [/192.168.249.134] Timed out waiting for server response), /192.168.250.165:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.250.165] Connection has been closed), /192.168.249.91:9042, /192.168.251.84:9042 [only showing errors of first 3 hosts, use getErrors() for more details])
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    i am using cassandra 2.0.9 and datastax java driver 3.0.0. I had too many NoHostAvailableException after some ReadTimeOutException and WriteTimeOutException.NoHostException occurred even though cassandra is normal and listening in 9160 and 9042 ports. It says some connections are closed, if connections are closed then it should establish new connections for processing. i haven't set connectionsPerHost. My code to connect cassandra using driver {code:java} private static Cluster constructCluster(String hostName,String port) { String[] hostNames = hostName.split(","); SocketOptions sOptions = new SocketOptions(); sOptions.setKeepAlive(true); QueryOptions qOptions = new QueryOptions().setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM) .setFetchSize(500); LatencyAwarePolicy loadBalancingPolicy = LatencyAwarePolicy.builder(DCAwareRoundRobinPolicy.builder().withLocalDc(defaultDC).build()) .build(); Cluster cluster = Cluster.builder() .addContactPoints(hostNames) .withLoadBalancingPolicy(loadBalancingPolicy) .withPoolingOptions(new PoolingOptions()) .withQueryOptions(qOptions) .withReconnectionPolicy(new ConstantReconnectionPolicy(TimeUnit.SECONDS.toMillis(5))) .withRetryPolicy(new LoggingRetryPolicy(DefaultRetryPolicy.INSTANCE)) .withSocketOptions(sOptions) .build(); LOGGER.log(Level.SEVERE, "host name {0}", hostName); return cluster; } {code} My exception trace {code:java} com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.250.151:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.250.151] Connection has been closed), /192.168.249.134:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: [/192.168.249.134] Timed out waiting for server response), /192.168.250.165:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.250.165] Connection has been closed), /192.168.249.91:9042, /192.168.251.84:9042 [only showing errors of first 3 hosts, use getErrors() for more details]) at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:84) at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:37) at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37) at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:63) {code} another exception trace {code:java} com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.249.134:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: [/192.168.249.134] Timed out waiting for server response), /192.168.251.84:9042 (com.datastax.driver.core.exceptions.DriverException: Timeout while trying to acquire available connection (you may want to increase the driver number of per-host connections)), /192.168.250.151:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.250.151] Connection has been closed), /192.168.250.165:9042, /192.168.249.91:9042 [only showing errors of first 3 hosts, use getErrors() for more details]) at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:84) at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:37) at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37) at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:63) {code} I cannot reproduce this issue later.

    DataStax JIRA | 12 months ago | Rishikesan
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.250.151:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.250.151] Connection has been closed), /192.168.249.134:9042 (com.datastax.driver.core.exceptions.OperationTimedOutException: [/192.168.249.134] Timed out waiting for server response), /192.168.250.165:9042 (com.datastax.driver.core.exceptions.TransportException: [/192.168.250.165] Connection has been closed), /192.168.249.91:9042, /192.168.251.84:9042 [only showing errors of first 3 hosts, use getErrors() for more details])

    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.OperationTimedOutException

      [localhost/127.0.0.1:9142] Timed out waiting for server response**

      at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onTimeout()
    2. DataStax Java Driver for Apache Cassandra - Core
      Connection$ResponseHandler$1.run
      1. com.datastax.driver.core.RequestHandler$SpeculativeExecution.onTimeout(RequestHandler.java:770)
      2. com.datastax.driver.core.Connection$ResponseHandler$1.run(Connection.java:1374)
      2 frames
    3. Netty
      DefaultThreadFactory$DefaultRunnableDecorator.run
      1. io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:581)
      2. io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:655)
      3. io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:367)
      4. io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:145)
      4 frames
    4. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)
      1 frame