com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried)

DataStax JIRA | Ryan McGuire | 3 years ago
  1. 0

    I'm trying to use the [CQL YCSB driver found here|https://github.com/jbellis/YCSB/blob/f9d2f4a5f2fc49c5ea5b2f5620898f945a1f6b4b/cassandra/src/main/java/com/yahoo/ycsb/db/CassandraCQLClient.java] The insert function works fine, but the read function fails with this error: {code} com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried) at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:65) at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:256) at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:172) at com.datastax.driver.core.SessionManager.execute(SessionManager.java:92) at com.yahoo.ycsb.db.CassandraCQLClient.read(CassandraCQLClient.java:207) at com.yahoo.ycsb.DBWrapper$1.go(DBWrapper.java:124) at com.yahoo.ycsb.DBWrapper.operation(DBWrapper.java:206) at com.yahoo.ycsb.DBWrapper.read(DBWrapper.java:111) at com.yahoo.ycsb.workloads.CoreWorkload.doTransactionRead(CoreWorkload.java:522) at com.yahoo.ycsb.workloads.CoreWorkload.doTransaction(CoreWorkload.java:470) at com.yahoo.ycsb.ClientThread$1.doOperation(Client.java:349) at com.yahoo.ycsb.ClientThread.run(Client.java:405) at com.yahoo.ycsb.ClientThread.run(Client.java:346) Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried) at com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:103) at com.datastax.driver.core.SessionManager.execute(SessionManager.java:418) at com.datastax.driver.core.SessionManager.executeQuery(SessionManager.java:454) at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:104) ... 10 more {code} The error is similar to JAVA-261, but the workarounds in that ticket didn't fix it for me. Also, I have tried using this code with only one worker thread, but got the same error. Any ideas?

    DataStax JIRA | 3 years ago | Ryan McGuire
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried)
  2. 0

    Random NoHostAvailableException using DataStax Java driver

    Google Groups | 2 years ago | Ola Nowak
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: [cassandra-11/10.0.0.11:9042, /10.0.0.10:9042, /10.0.0.12:9042, /10.0.0.7:9042, /10.0.0.9:9042, /10.0.0.8:9042] - use getErrors() for details)
  3. 0

    Random NoHostAvailableException using DataStax Java driver

    apache.org | 1 year ago
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: [cassandra-11/10.0.0.11:9042, /10.0.0.10:9042, /10.0.0.12:9042, /10.0.0.7:9042, /10.0.0.9:9042, /10.0.0.8:9042] - use getErrors() for details)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    cassandra-user@incubator.apache.org - Random NoHostAvailableException using DataStax Java driver

    nabble.com | 1 year ago
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: [cassandra-11/10.0.0.11:9042, /10.0.0.10:9042, /10.0.0.12:9042, /10.0.0.7:9042, /10.0.0.9:9042, /10.0.0.8:9042] - use getErrors() for details)
  6. 0

    Stack Overflow

    pr8x.com | 9 months ago
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: ec2-54-197-xxx-xxx.compute-1.amazonaws.com/54.197.xxx.xxx:9042 (com.datastax.driver.core.ConnectionException: [ec2-54-197-xxx-xxx.compute-1.amazonaws.com/54.197.xxx.xxx:9042] Write attempt on defunct connection))

    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 (no host was tried)

      at com.datastax.driver.core.RequestHandler.sendRequest()
    2. DataStax Java Driver for Apache Cassandra - Core
      SessionManager.execute
      1. com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:103)
      2. com.datastax.driver.core.SessionManager.execute(SessionManager.java:418)
      3. com.datastax.driver.core.SessionManager.executeQuery(SessionManager.java:454)
      4. com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:104)
      5. com.datastax.driver.core.SessionManager.execute(SessionManager.java:92)
      5 frames
    3. com.yahoo.ycsb
      ClientThread.run
      1. com.yahoo.ycsb.db.CassandraCQLClient.read(CassandraCQLClient.java:207)
      2. com.yahoo.ycsb.DBWrapper$1.go(DBWrapper.java:124)
      3. com.yahoo.ycsb.DBWrapper.operation(DBWrapper.java:206)
      4. com.yahoo.ycsb.DBWrapper.read(DBWrapper.java:111)
      5. com.yahoo.ycsb.workloads.CoreWorkload.doTransactionRead(CoreWorkload.java:522)
      6. com.yahoo.ycsb.workloads.CoreWorkload.doTransaction(CoreWorkload.java:470)
      7. com.yahoo.ycsb.ClientThread$1.doOperation(Client.java:349)
      8. com.yahoo.ycsb.ClientThread.run(Client.java:405)
      9. com.yahoo.ycsb.ClientThread.run(Client.java:346)
      9 frames