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))

DataStax JIRA | Andre Campeau | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    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.

    DataStax JIRA | 3 years ago | Andre Campeau
    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))
  2. 0

    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.

    DataStax JIRA | 3 years ago | Andre Campeau
    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))
  3. 0

    Does CassandraUnit works with DataStax's java driver version 2.0.0?

    Google Groups | 3 years ago | Lei Gu, Ph. D
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1 (com.datastax.driver.core.ConnectionException: [/127.0.0.1] Unexpected error during transport initialization (com.datastax.driver.core.TransportException: [/127.0.0.1] Channel has been closed)))
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Does not work with Cassandra 3.0

    GitHub | 1 year ago | gw0
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /1.2.3.4:9042 (com.datastax.driver.core.exceptions.InvalidQueryException: unconfigured table schema_keyspaces))
  6. 0

    [Kundera-datastax] NoHostAvailableException

    GitHub | 2 years ago | ansarrafique
    com.impetus.kundera.KunderaException: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried)

  1. kid 2 times, last 4 months ago
24 unregistered visitors
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.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()
  2. DataStax Java Driver for Apache Cassandra - Core
    Cluster.connect
    1. com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:195)
    2. com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:78)
    3. com.datastax.driver.core.Cluster$Manager.init(Cluster.java:977)
    4. com.datastax.driver.core.Cluster$Manager.newSession(Cluster.java:1014)
    5. com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:889)
    6. com.datastax.driver.core.Cluster.connect(Cluster.java:170)
    7. com.datastax.driver.core.Cluster.connect(Cluster.java:189)
    7 frames