com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.59.104:9042 (com.datastax.driver.core.exceptions.DriverException: Host replied with server error: Index: 1))

DataStax JIRA | Kavanagh | 2 years ago
  1. 0

    Attempting to execute the following code succeeds: {code} Cluster cluster = Cluster.builder().withPort(9042).addContactPoint(CASSANDRA_HOST).build(); Session session = cluster.connect(CASSANDRA_KS); PreparedStatement preparedStatement = session.prepare( "SELECT id, fname, lname FROM profiles where solr_query=? limit 100"); BoundStatement boundStatement = preparedStatement.bind("fname:joh"); ResultSet resultSet = session.execute(boundStatement); {code} Whereas the following fails with a cryptic error {code} Cluster cluster = Cluster.builder().withPort(9042).addContactPoint(CASSANDRA_HOST).build(); Session session = cluster.connect(CASSANDRA_KS); PreparedStatement preparedStatement = session.prepare( "SELECT id, fname, lname FROM profiles where solr_query=? limit ?"); BoundStatement boundStatement = preparedStatement.bind("fname:joh", 100); ResultSet resultSet = session.execute(boundStatement); {code} Exception: {code} com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.59.104:9042 (com.datastax.driver.core.exceptions.DriverException: Host replied with server error: Index: 1)) at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:84) at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:289) at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:205) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52) at com.datastax.tes.solr.SolrTest.testNonEmptyResultSetPrepared_pass(SolrTest.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runners.Suite.runChild(Suite.java:127) at org.junit.runners.Suite.runChild(Suite.java:26) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.59.104:9042 (com.datastax.driver.core.exceptions.DriverException: Host replied with server error: Index: 1)) at com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:108) at com.datastax.driver.core.RequestHandler$1.run(RequestHandler.java:179) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) {code}

    DataStax JIRA | 2 years ago | Kavanagh
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.59.104:9042 (com.datastax.driver.core.exceptions.DriverException: Host replied with server error: Index: 1))
  2. 0

    Attempting to execute the following code succeeds: {code} Cluster cluster = Cluster.builder().withPort(9042).addContactPoint(CASSANDRA_HOST).build(); Session session = cluster.connect(CASSANDRA_KS); PreparedStatement preparedStatement = session.prepare( "SELECT id, fname, lname FROM profiles where solr_query=? limit 100"); BoundStatement boundStatement = preparedStatement.bind("fname:joh"); ResultSet resultSet = session.execute(boundStatement); {code} Whereas the following fails with a cryptic error {code} Cluster cluster = Cluster.builder().withPort(9042).addContactPoint(CASSANDRA_HOST).build(); Session session = cluster.connect(CASSANDRA_KS); PreparedStatement preparedStatement = session.prepare( "SELECT id, fname, lname FROM profiles where solr_query=? limit ?"); BoundStatement boundStatement = preparedStatement.bind("fname:joh", 100); ResultSet resultSet = session.execute(boundStatement); {code} Exception: {code} com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.59.104:9042 (com.datastax.driver.core.exceptions.DriverException: Host replied with server error: Index: 1)) at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:84) at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:289) at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:205) at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52) at com.datastax.tes.solr.SolrTest.testNonEmptyResultSetPrepared_pass(SolrTest.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runners.Suite.runChild(Suite.java:127) at org.junit.runners.Suite.runChild(Suite.java:26) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.59.104:9042 (com.datastax.driver.core.exceptions.DriverException: Host replied with server error: Index: 1)) at com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:108) at com.datastax.driver.core.RequestHandler$1.run(RequestHandler.java:179) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) {code}

    DataStax JIRA | 2 years ago | Kavanagh
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.59.104:9042 (com.datastax.driver.core.exceptions.DriverException: Host replied with server error: Index: 1))
  3. 0

    Error while saving the Spark RDD to Cassandra

    Stack Overflow | 2 years ago | Ankur
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /10.87.33.133:9042 (com.datastax.driver.core.exceptions.DriverException: Timed out waiting for server response))
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Constant timeouts in Cassandra after adding second node

    Stack Overflow | 10 months ago | aroth
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:10112 (com.datastax.driver.core.exceptions.DriverException: Timed out waiting for server response))
  6. 0

    Defuncting connection to *.*.*.* (java.io.IOException: An existing connection was forcibly closed by the remote host)

    Stack Overflow | 3 years ago | user3116058
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: [/10.201.39.26, /10.201.39.25, /10.201.39.15, /10.201.39.19, /10.201.39.16, /10.201.39.17, /10.201.39.22, /10.201.39.21] - use getErrors() for details)

    3 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: /192.168.59.104:9042 (com.datastax.driver.core.exceptions.DriverException: Host replied with server error: Index: 1))

      at com.datastax.driver.core.RequestHandler.sendRequest()
    2. DataStax Java Driver for Apache Cassandra - Core
      RequestHandler$1.run
      1. com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:108)
      2. com.datastax.driver.core.RequestHandler$1.run(RequestHandler.java:179)
      2 frames
    3. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      3. java.lang.Thread.run(Thread.java:745)
      3 frames