com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:12000 (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] Error writing))

DataStax JIRA | Pavel Chlupacek | 6 months ago
  1. 0

    When passing ReadOnly buffer (ByteBuffer.wrap(arr).asReadOnlyBuffer()) to Blob type field, the driver seems to fail to construct message with following found in log : {code} com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] Error writing at com.datastax.driver.core.Connection$10.operationComplete(Connection.java:564) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.Connection$10.operationComplete(Connection.java:548) ~[cassandra-driver-core-3.0.1.jar:na] at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:680) ~[netty-common-4.0.33.Final.jar:4.0.33.Final] at io.netty.util.concurrent.DefaultPromise.notifyLateListener(DefaultPromise.java:621) ~[netty-common-4.0.33.Final.jar:4.0.33.Final] at io.netty.util.concurrent.DefaultPromise.addListener(DefaultPromise.java:138) ~[netty-common-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:93) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:28) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at com.datastax.driver.core.Connection$Flusher.run(Connection.java:878) ~[cassandra-driver-core-3.0.1.jar:na] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358) ~[netty-common-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112) ~[netty-common-4.0.33.Final.jar:4.0.33.Final] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40] Caused by: io.netty.handler.codec.EncoderException: java.nio.ReadOnlyBufferException at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:107) ~[netty-codec-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:643) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:700) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:636) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.handler.timeout.IdleStateHandler.write(IdleStateHandler.java:284) ~[netty-handler-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:643) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:700) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:636) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:622) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:939) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannel.write(AbstractChannel.java:234) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] ... 5 common frames omitted Caused by: java.nio.ReadOnlyBufferException: null at java.nio.ByteBuffer.array(ByteBuffer.java:996) ~[na:1.8.0_40] at io.netty.buffer.UnsafeByteBufUtil.setBytes(UnsafeByteBufUtil.java:368) ~[netty-buffer-4.0.33.Final.jar:4.0.33.Final] at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:205) ~[netty-buffer-4.0.33.Final.jar:4.0.33.Final] at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:877) ~[netty-buffer-4.0.33.Final.jar:4.0.33.Final] at com.datastax.driver.core.CBUtil.writeValue(CBUtil.java:319) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.CBUtil.writeValueList(CBUtil.java:344) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.Requests$QueryProtocolOptions.encode(Requests.java:319) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.Requests$Execute$1.encode(Requests.java:169) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.Requests$Execute$1.encode(Requests.java:165) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.Message$ProtocolEncoder.encode(Message.java:319) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.Message$ProtocolEncoder.encode(Message.java:280) ~[cassandra-driver-core-3.0.1.jar:na] at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:89) ~[netty-codec-4.0.33.Final.jar:4.0.33.Final] ... 15 common frames omitted {code} That in fact causes following exception to be propagated {code} All host(s) tried for query failed (tried: /127.0.0.1:12000 (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] Error writing)) com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:12000 (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] Error writing)) at com.datastax.driver.core.RequestHandler.reportNoMoreHosts(RequestHandler.java:211) at com.datastax.driver.core.RequestHandler.access$1000(RequestHandler.java:43) at com.datastax.driver.core.RequestHandler$SpeculativeExecution.sendRequest(RequestHandler.java:277) at com.datastax.driver.core.RequestHandler$SpeculativeExecution$1.run(RequestHandler.java:400) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {code} making the connection with server defunct. Expected behaviour. 1) If the buffer must not be read-only, then this shall be asserted immediatelly when the row of blob field is constructed 2) Only that particular request shall fail, reporting the exception back, connection shall be availble for further request 3) Even when connection will fail for this reason, driver shall be able to allocate new connection w/o dormant time pretending that server have failed.

    DataStax JIRA | 6 months ago | Pavel Chlupacek
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:12000 (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] Error writing))
  2. 0

    When passing ReadOnly buffer (ByteBuffer.wrap(arr).asReadOnlyBuffer()) to Blob type field, the driver seems to fail to construct message with following found in log : {code} com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] Error writing at com.datastax.driver.core.Connection$10.operationComplete(Connection.java:564) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.Connection$10.operationComplete(Connection.java:548) ~[cassandra-driver-core-3.0.1.jar:na] at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:680) ~[netty-common-4.0.33.Final.jar:4.0.33.Final] at io.netty.util.concurrent.DefaultPromise.notifyLateListener(DefaultPromise.java:621) ~[netty-common-4.0.33.Final.jar:4.0.33.Final] at io.netty.util.concurrent.DefaultPromise.addListener(DefaultPromise.java:138) ~[netty-common-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:93) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.DefaultChannelPromise.addListener(DefaultChannelPromise.java:28) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at com.datastax.driver.core.Connection$Flusher.run(Connection.java:878) ~[cassandra-driver-core-3.0.1.jar:na] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358) ~[netty-common-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112) ~[netty-common-4.0.33.Final.jar:4.0.33.Final] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40] Caused by: io.netty.handler.codec.EncoderException: java.nio.ReadOnlyBufferException at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:107) ~[netty-codec-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:643) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:700) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:636) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.handler.timeout.IdleStateHandler.write(IdleStateHandler.java:284) ~[netty-handler-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:643) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:700) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:636) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:622) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:939) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] at io.netty.channel.AbstractChannel.write(AbstractChannel.java:234) ~[netty-transport-4.0.33.Final.jar:4.0.33.Final] ... 5 common frames omitted Caused by: java.nio.ReadOnlyBufferException: null at java.nio.ByteBuffer.array(ByteBuffer.java:996) ~[na:1.8.0_40] at io.netty.buffer.UnsafeByteBufUtil.setBytes(UnsafeByteBufUtil.java:368) ~[netty-buffer-4.0.33.Final.jar:4.0.33.Final] at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:205) ~[netty-buffer-4.0.33.Final.jar:4.0.33.Final] at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:877) ~[netty-buffer-4.0.33.Final.jar:4.0.33.Final] at com.datastax.driver.core.CBUtil.writeValue(CBUtil.java:319) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.CBUtil.writeValueList(CBUtil.java:344) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.Requests$QueryProtocolOptions.encode(Requests.java:319) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.Requests$Execute$1.encode(Requests.java:169) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.Requests$Execute$1.encode(Requests.java:165) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.Message$ProtocolEncoder.encode(Message.java:319) ~[cassandra-driver-core-3.0.1.jar:na] at com.datastax.driver.core.Message$ProtocolEncoder.encode(Message.java:280) ~[cassandra-driver-core-3.0.1.jar:na] at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:89) ~[netty-codec-4.0.33.Final.jar:4.0.33.Final] ... 15 common frames omitted {code} That in fact causes following exception to be propagated {code} All host(s) tried for query failed (tried: /127.0.0.1:12000 (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] Error writing)) com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:12000 (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] Error writing)) at com.datastax.driver.core.RequestHandler.reportNoMoreHosts(RequestHandler.java:211) at com.datastax.driver.core.RequestHandler.access$1000(RequestHandler.java:43) at com.datastax.driver.core.RequestHandler$SpeculativeExecution.sendRequest(RequestHandler.java:277) at com.datastax.driver.core.RequestHandler$SpeculativeExecution$1.run(RequestHandler.java:400) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) {code} making the connection with server defunct. Expected behaviour. 1) If the buffer must not be read-only, then this shall be asserted immediatelly when the row of blob field is constructed 2) Only that particular request shall fail, reporting the exception back, connection shall be availble for further request 3) Even when connection will fail for this reason, driver shall be able to allocate new connection w/o dormant time pretending that server have failed.

    DataStax JIRA | 6 months ago | Pavel Chlupacek
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:12000 (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] Error writing))
  3. 0

    Unable to generate executable war file using "mvnw -Pprod package", getting following stacktrace

    GitHub | 1 month ago | KalavaraSiri
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1:9142 (com.datastax.driver.core.exceptions.OperationTime dOutException: [localhost/127.0.0.1] Timed out waiting for server response))
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Cassandra Java Exception - NoHostAvailableException - Code - Help To User

    helptouser.com | 11 months ago
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /127.0.0.1:9042 (com.datastax.driver.core.exceptions.DriverException: Host replied with server error: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.io.FileNotFoundException: C:\apache-cassandra-new\data\data\system\schema_columnfamilies-45f5b36024bc3f83a3631034ea4fa697\system-schema_columnfamilies-tmplink-ka-4839-Data.db (The process cannot access the file because it is being used by another process)))
  6. 0

    GitHub comment 832#156657004

    GitHub | 1 year ago | drax68
    com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: cassandra.example.com/1.2.3.4:9042 (com.datastax.driver.core.OperationTimedOutException: [cassandra.example.com/1.2.3.4:9042] Operation timed out))

    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: /127.0.0.1:12000 (com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] Error writing))

      at com.datastax.driver.core.RequestHandler.reportNoMoreHosts()
    2. DataStax Java Driver for Apache Cassandra - Core
      RequestHandler$SpeculativeExecution$1.run
      1. com.datastax.driver.core.RequestHandler.reportNoMoreHosts(RequestHandler.java:211)
      2. com.datastax.driver.core.RequestHandler.access$1000(RequestHandler.java:43)
      3. com.datastax.driver.core.RequestHandler$SpeculativeExecution.sendRequest(RequestHandler.java:277)
      4. com.datastax.driver.core.RequestHandler$SpeculativeExecution$1.run(RequestHandler.java:400)
      4 frames
    3. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      3. java.lang.Thread.run(Thread.java:745)
      3 frames