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.

  • When Cassandra is unreachable (from the start of application) I see the following exceptions: {code:java} com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.TransportException: [/127.0.0.1:9042] Cannot connect)) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:196) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:79) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1104) at com.datastax.driver.core.Cluster.init(Cluster.java:121) at com.datastax.driver.core.Cluster.connect(Cluster.java:198) at com.datastax.driver.core.Cluster.connect(Cluster.java:226) {code} and {code:java} java.util.concurrent.RejectedExecutionException: Task com.google.common.util.concurrent.ListenableFutureTask@36549757 rejected from java.util.concurrent.ThreadPoolExecutor@2c12300b[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:248) at com.datastax.driver.core.SessionManager.init(SessionManager.java:67) at com.datastax.driver.core.Cluster.connect(Cluster.java:200) at com.datastax.driver.core.Cluster.connect(Cluster.java:226) {code} IMHO Cluster.connect should not throw undocumented exceptions - this breaks library consumers. Looks like the cause is that com.datastax.driver.core.Cluster.Manager#init closes the thread pools in case of exception.
    via by Mikhail Mazursky,
  • When Cassandra is unreachable (from the start of application) I see the following exceptions: {code:java} com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.TransportException: [/127.0.0.1:9042] Cannot connect)) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:196) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:79) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1104) at com.datastax.driver.core.Cluster.init(Cluster.java:121) at com.datastax.driver.core.Cluster.connect(Cluster.java:198) at com.datastax.driver.core.Cluster.connect(Cluster.java:226) {code} and {code:java} java.util.concurrent.RejectedExecutionException: Task com.google.common.util.concurrent.ListenableFutureTask@36549757 rejected from java.util.concurrent.ThreadPoolExecutor@2c12300b[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:248) at com.datastax.driver.core.SessionManager.init(SessionManager.java:67) at com.datastax.driver.core.Cluster.connect(Cluster.java:200) at com.datastax.driver.core.Cluster.connect(Cluster.java:226) {code} IMHO Cluster.connect should not throw undocumented exceptions - this breaks library consumers. Looks like the cause is that com.datastax.driver.core.Cluster.Manager#init closes the thread pools in case of exception.
    via by Mikhail Mazursky,
  • 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: /127.0.0.1:9042 (com.datastax.driver.core.TransportException: [/127.0.0.1:9042] Cannot connect)) at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:196) at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:79) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1104) at com.datastax.driver.core.Cluster.init(Cluster.java:121) at com.datastax.driver.core.Cluster.connect(Cluster.java:198) at com.datastax.driver.core.Cluster.connect(Cluster.java:226)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    34 more bugmates