com.datastax.driver.core.exceptions.DriverException: Host replied with server error: java.lang.AssertionError

298 views
Skip to first unread message

Srikrishna Jaliparthy

unread,
Aug 26, 2015, 8:37:13 AM8/26/15
to DataStax Java Driver for Apache Cassandra User Mailing List

Defuncting connection to /127.0.0.1:9042

2015-08-26T17:51:09.85+0530 [App/0]      OUT com.datastax.driver.core.exceptions.DriverException: Host replied with server error: java.lang.AssertionError

2015-08-26T17:51:09.85+0530 [App/0]      OUT at com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:515) ~[cassandra-driver-core-2.1.7.1.jar:na]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:991) [cassandra-driver-core-2.1.7.1.jar:na]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:913) [cassandra-driver-core-2.1.7.1.jar:na]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.epoll.EpollSocketChannel$EpollSocketUnsafe.epollInReady(EpollSocketChannel.java:722) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:326) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:264) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [netty-all-4.0.23.Final.jar:4.0.23.Final]

2015-08-26T17:51:09.85+0530 [App/0]      OUT at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40-]




I am getting the above error while executing cassandra queries ? any idea why this is happening ?

Thanks
sri krishna

Kevin Gallardo

unread,
Aug 26, 2015, 9:01:24 AM8/26/15
to java-dri...@lists.datastax.com
Hello,

This message indicates an error returned by the Cassandra server, not occurring on the driver. Although I can decode in this log that you use Driver version 2.1.7.1, we may find more information about your problem if you could provide the query causing this error, and the version of Cassandra you're using. Additional information like the Schema table concerned, code building the Cluster and creating the Session, may also help. 

Regards.

To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.



--
Kevin Gallardo, 
Drivers and Tools Team
DataStax.

Srikrishna Jaliparthy

unread,
Aug 26, 2015, 10:38:50 AM8/26/15
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi,

Cassandra Version is : 2.1.0

Cluster is created like this :

var clusterBuilder = Cluster.builder()
.addContactPoint(CassandraNode)
.withPort(CassandraPort)
.withCredentials(CassandraUserName, CassandraPassword)


clusterBuilder = clusterBuilder
.withLoadBalancingPolicy(new WhiteListPolicy(
clusterBuilder.getConfiguration().getPolicies().getLoadBalancingPolicy(),
Arrays.asList(new InetSocketAddress(CassandraNode, CassandraPort))))

val cluster = clusterBuilder.build()

val session = cluster.connect()

KeySpace is created like this : CREATE KEYSPACE test  WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 2 };
Schema is like this :
Table1(a1,a2,a3,a4,a5)

As this issue is caught while load testing cassandra, at this point of time i am not sure which query cause this error, will update the thread once i know the query

Srikrishna Jaliparthy

unread,
Aug 26, 2015, 11:15:47 AM8/26/15
to DataStax Java Driver for Apache Cassandra User Mailing List
Getting this error with Update query 

Update Table1 SET a1=?, a2=? where a3=? and a4=?

(a3, a4) is a primary key for Table1

Kevin Gallardo

unread,
Aug 26, 2015, 12:10:52 PM8/26/15
to java-dri...@lists.datastax.com
Thank you for the details.

The configuration of the driver seems legit, if the error happens to be caused internally by Cassandra, you might want to open a thread on the Cassandra mailing list. Have you checked the Cassandra logs? The cause of the exception should be located in the Cassandra log files since the error occurs on the server side.

Regards.

To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Srikrishna Jaliparthy

unread,
Aug 26, 2015, 12:58:27 PM8/26/15
to java-dri...@lists.datastax.com

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


i am getting this error also, while testing my app with cassandra, 


Queries when i am getting this error is: Get/Delete


any idea why is this happening ?

Srikrishna
9695036920

Andrew Tolbert

unread,
Aug 26, 2015, 2:05:51 PM8/26/15
to DataStax Java Driver for Apache Cassandra User Mailing List
Srikrishna,

As Kevin suggested have you tried looking at the Cassandra logs (system.log)?  One of your previous messages indicated an AssertionError (Host replied with server error: java.lang.AssertionError), which indicates an issue on the Cassandra side which caused the host to go down.

Additionally you mentioned using Cassandra 2.1.0.   I would recommend upgrading to a newer version (i.e. 2.1.8) as its possible that the problem you are running into has since been fixed in the last year.

Thanks,
Andy

Srikrishna Jaliparthy

unread,
Aug 26, 2015, 2:12:16 PM8/26/15
to java-dri...@lists.datastax.com
Hi Andrew,

I looked into Cassandra for assertion error and this is the stack trace i found :


java.lang.AssertionError: null
at org.apache.cassandra.db.RangeTombstoneList.diff(RangeTombstoneList.java:424) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.db.DeletionInfo.diff(DeletionInfo.java:189) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.db.ColumnFamily.diff(ColumnFamily.java:311) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.db.ColumnFamily.diff(ColumnFamily.java:394) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.service.RowDataResolver.scheduleRepairs(RowDataResolver.java:114) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.service.RowDataResolver.resolve(RowDataResolver.java:91) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.service.RowDataResolver.resolve(RowDataResolver.java:37) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.service.ReadCallback.get(ReadCallback.java:110) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.service.StorageProxy.fetchRows(StorageProxy.java:1300) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.service.StorageProxy.read(StorageProxy.java:1153) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:255) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:211) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:60) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:187) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.cql3.QueryProcessor.processPrepared(QueryProcessor.java:413) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.transport.messages.ExecuteMessage.execute(ExecuteMessage.java:133) ~[apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:422) [apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:318) [apache-cassandra-2.1.0.jar:2.1.0]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [netty-all-4.0.20.Final.jar:4.0.20.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:332) [netty-all-4.0.20.Final.jar:4.0.20.Final]
at io.netty.channel.AbstractChannelHandlerContext.access$700(AbstractChannelHandlerContext.java:31) [netty-all-4.0.20.Final.jar:4.0.20.Final]
at io.netty.channel.AbstractChannelHandlerContext$8.run(AbstractChannelHandlerContext.java:323) [netty-all-4.0.20.Final.jar:4.0.20.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_51]
at org.apache.cassandra.concurrent.AbstractTracingAwareExecutorService$FutureTask.run(AbstractTracingAwareExecutorService.java:163) [apache-cassandra-2.1.0.jar:2.1.0]
at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:103) [apache-cassandra-2.1.0.jar:2.1.0]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_51]


any idea why is this happening ? i looked into this stack trace and not able to correlate with anything

thanks
sri krishna

Andrew Tolbert

unread,
Aug 26, 2015, 2:16:43 PM8/26/15
to java-dri...@lists.datastax.com
That looks like CASSANDRA-8013 which was fixed in release 2.1.1.  Upgrading should get rid of that particular issue.

Thanks,
Andy

To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Srikrishna

unread,
Aug 26, 2015, 3:16:05 PM8/26/15
to java-dri...@lists.datastax.com
Thanks Andrew 

I will try upgrading Cassandra and test once again 
Reply all
Reply to author
Forward
0 new messages