com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] Error writing

DataStax JIRA | Pavel Chlupacek | 9 months 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

    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 | 9 months ago | Pavel Chlupacek
    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 | 9 months ago | Pavel Chlupacek
    com.datastax.driver.core.exceptions.TransportException: [/127.0.0.1] Error writing
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Apache Spark Developers List - bug using kryo as closure serializer

    nabble.com | 1 year ago
    java.nio.ReadOnlyBufferException

    Root Cause Analysis

    1. java.nio.ReadOnlyBufferException

      null

      at java.nio.ByteBuffer.array()
    2. Java RT
      ByteBuffer.array
      1. java.nio.ByteBuffer.array(ByteBuffer.java:996)[na:1.8.0_40]
      1 frame
    3. Netty
      AbstractByteBuf.writeBytes
      1. io.netty.buffer.UnsafeByteBufUtil.setBytes(UnsafeByteBufUtil.java:368)[netty-buffer-4.0.33.Final.jar:4.0.33.Final]
      2. io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:205)[netty-buffer-4.0.33.Final.jar:4.0.33.Final]
      3. io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:877)[netty-buffer-4.0.33.Final.jar:4.0.33.Final]
      3 frames
    4. DataStax Java Driver for Apache Cassandra - Core
      Message$ProtocolEncoder.encode
      1. com.datastax.driver.core.CBUtil.writeValue(CBUtil.java:319)[cassandra-driver-core-3.0.1.jar:na]
      2. com.datastax.driver.core.CBUtil.writeValueList(CBUtil.java:344)[cassandra-driver-core-3.0.1.jar:na]
      3. com.datastax.driver.core.Requests$QueryProtocolOptions.encode(Requests.java:319)[cassandra-driver-core-3.0.1.jar:na]
      4. com.datastax.driver.core.Requests$Execute$1.encode(Requests.java:169)[cassandra-driver-core-3.0.1.jar:na]
      5. com.datastax.driver.core.Requests$Execute$1.encode(Requests.java:165)[cassandra-driver-core-3.0.1.jar:na]
      6. com.datastax.driver.core.Message$ProtocolEncoder.encode(Message.java:319)[cassandra-driver-core-3.0.1.jar:na]
      7. com.datastax.driver.core.Message$ProtocolEncoder.encode(Message.java:280)[cassandra-driver-core-3.0.1.jar:na]
      7 frames
    5. Netty
      AbstractChannel.write
      1. io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:89)[netty-codec-4.0.33.Final.jar:4.0.33.Final]
      2. io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:643)[netty-transport-4.0.33.Final.jar:4.0.33.Final]
      3. io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:700)[netty-transport-4.0.33.Final.jar:4.0.33.Final]
      4. io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:636)[netty-transport-4.0.33.Final.jar:4.0.33.Final]
      5. io.netty.handler.timeout.IdleStateHandler.write(IdleStateHandler.java:284)[netty-handler-4.0.33.Final.jar:4.0.33.Final]
      6. io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:643)[netty-transport-4.0.33.Final.jar:4.0.33.Final]
      7. io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:700)[netty-transport-4.0.33.Final.jar:4.0.33.Final]
      8. io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:636)[netty-transport-4.0.33.Final.jar:4.0.33.Final]
      9. io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:622)[netty-transport-4.0.33.Final.jar:4.0.33.Final]
      10. io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:939)[netty-transport-4.0.33.Final.jar:4.0.33.Final]
      11. io.netty.channel.AbstractChannel.write(AbstractChannel.java:234)[netty-transport-4.0.33.Final.jar:4.0.33.Final]
      11 frames
    6. DataStax Java Driver for Apache Cassandra - Core
      Connection$Flusher.run
      1. com.datastax.driver.core.Connection$Flusher.run(Connection.java:878)[cassandra-driver-core-3.0.1.jar:na]
      1 frame
    7. Netty
      SingleThreadEventExecutor$2.run
      1. io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:358)[netty-common-4.0.33.Final.jar:4.0.33.Final]
      2. io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)[netty-transport-4.0.33.Final.jar:4.0.33.Final]
      3. io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)[netty-common-4.0.33.Final.jar:4.0.33.Final]
      3 frames
    8. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)[na:1.8.0_40]
      1 frame