com.datastax.driver.core.exceptions.NoHostAvailableException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Started our server which attempts to periodically connect to a cluster which is built like this: cluster = Cluster.builder().withRetryPolicy(lRetryPolicy).withSocketOptions(new SocketOptions().setReadTimeoutMillis(360000).setConnectTimeoutMillis(20000)).withLoadBalancingPolicy(new RoundRobinPolicy()).addContactPoints(dbIpAddress.split(",")).build(); when all Cassandra nodes in the cluster are down. Just under 5 minutes later I started all the Cassandra nodes. Here is the first NoHostAvailableException: <2014.05.26 13:46:37 688 -0400><E><acampeau-desktop><RIWorker [2]><server.cassandra.session.CassandraSessionManager.allocateSession> EXCEPTION logged in com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /138.120.140.92 (com.datastax.driver.core.TransportException: [/138.120.140.92] Cannot connect), /138.120.140.96 (com.datastax.driver.core.TransportException: [/138.120.140.96] Cannot connect), /138.120.140.99 (com.datastax.driver.core.TransportException: [/138.120.140.99] Cannot connect)) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:195) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:78) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:977) at com.datastax.driver.core.Cluster$Manager.newSession(Cluster.java:1014) at com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:889) at com.datastax.driver.core.Cluster.connect(Cluster.java:170) at com.datastax.driver.core.Cluster.connect(Cluster.java:189) at ... Less then 200ms later and subsequently for hours later, I kept seeing the following: [java.util.concurrent.RejectedExecutionException]: Task com.google.common.util.concurrent.ListenableFutureTask@4a7c295a rejected from java.util.concurrent.ThreadPoolExecutor@527feed0[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) at com.google.common.util.concurrent.MoreExecutors$ListeningDecorator.execute(MoreExecutors.java:484) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:132) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:58) at com.datastax.driver.core.SessionManager.addOrRenewPool(SessionManager.java:236) at com.datastax.driver.core.SessionManager.<init>(SessionManager.java:57) at com.datastax.driver.core.Cluster$Manager.newSession(Cluster.java:1016) at com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:889) at com.datastax.driver.core.Cluster.connect(Cluster.java:170) at com.datastax.driver.core.Cluster.connect(Cluster.java:189) at ... In the debugger I see the cluster.manager.executor as Terminated. Next server restart with Cassandra cluster nodes all down produced the same result.
    via by Andre Campeau,
  • Started our server which attempts to periodically connect to a cluster which is built like this: cluster = Cluster.builder().withRetryPolicy(lRetryPolicy).withSocketOptions(new SocketOptions().setReadTimeoutMillis(360000).setConnectTimeoutMillis(20000)).withLoadBalancingPolicy(new RoundRobinPolicy()).addContactPoints(dbIpAddress.split(",")).build(); when all Cassandra nodes in the cluster are down. Just under 5 minutes later I started all the Cassandra nodes. Here is the first NoHostAvailableException: <2014.05.26 13:46:37 688 -0400><E><acampeau-desktop><RIWorker [2]><server.cassandra.session.CassandraSessionManager.allocateSession> EXCEPTION logged in com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /138.120.140.92 (com.datastax.driver.core.TransportException: [/138.120.140.92] Cannot connect), /138.120.140.96 (com.datastax.driver.core.TransportException: [/138.120.140.96] Cannot connect), /138.120.140.99 (com.datastax.driver.core.TransportException: [/138.120.140.99] Cannot connect)) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:195) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:78) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:977) at com.datastax.driver.core.Cluster$Manager.newSession(Cluster.java:1014) at com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:889) at com.datastax.driver.core.Cluster.connect(Cluster.java:170) at com.datastax.driver.core.Cluster.connect(Cluster.java:189) at ... Less then 200ms later and subsequently for hours later, I kept seeing the following: [java.util.concurrent.RejectedExecutionException]: Task com.google.common.util.concurrent.ListenableFutureTask@4a7c295a rejected from java.util.concurrent.ThreadPoolExecutor@527feed0[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) at com.google.common.util.concurrent.MoreExecutors$ListeningDecorator.execute(MoreExecutors.java:484) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:132) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:58) at com.datastax.driver.core.SessionManager.addOrRenewPool(SessionManager.java:236) at com.datastax.driver.core.SessionManager.<init>(SessionManager.java:57) at com.datastax.driver.core.Cluster$Manager.newSession(Cluster.java:1016) at com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:889) at com.datastax.driver.core.Cluster.connect(Cluster.java:170) at com.datastax.driver.core.Cluster.connect(Cluster.java:189) at ... In the debugger I see the cluster.manager.executor as Terminated. Next server restart with Cassandra cluster nodes all down produced the same result.
    via by Andre Campeau,
  • Does not work with Cassandra 3.0
    via GitHub by gw0
    ,
    • com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /138.120.140.92 (com.datastax.driver.core.TransportException: [/138.120.140.92] Cannot connect), /138.120.140.96 (com.datastax.driver.core.TransportException: [/138.120.140.96] Cannot connect), /138.120.140.99 (com.datastax.driver.core.TransportException: [/138.120.140.99] Cannot connect)) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:195) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:78) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:977) at com.datastax.driver.core.Cluster$Manager.newSession(Cluster.java:1014) at com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:889) at com.datastax.driver.core.Cluster.connect(Cluster.java:170) at com.datastax.driver.core.Cluster.connect(Cluster.java:189)

    Users with the same issue

    kidkid
    2 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    34 more bugmates