Bug: ByteBufferAccessor throws ClassCastException when trying to query system_views.local_read_latency
Status: Resolved
Priority: Normal
Resolution: Duplicate
Created: 02/Oct/20 20:51
Resolved: 04/Oct/20 04:29

If you start up a fresh trunk/4.0 node and execute the query “SELECT * FROM system_views.local_read_latency”, you’ll get the following error:

ERROR [Native-Transport-Requests-1] 2020-09-30 09:44:45,099 ErrorMessage.java:457 - Unexpected exception during request
java.lang.ClassCastException: org.apache.cassandra.db.marshal.ByteBufferAccessor cannot be cast to java.lang.String
        at org.apache.cassandra.serializers.AbstractTextSerializer.serialize(AbstractTextSerializer.java:29)
        at org.apache.cassandra.db.marshal.AbstractType.decompose(AbstractType.java:131)
        at org.apache.cassandra.db.marshal.CompositeType.decompose(CompositeType.java:192)
        at org.apache.cassandra.db.virtual.SimpleDataSet.makeDecoratedKey(SimpleDataSet.java:87)
        at org.apache.cassandra.db.virtual.SimpleDataSet.row(SimpleDataSet.java:63)
        at org.apache.cassandra.db.virtual.TableMetricTables$TableMetricTable.data(TableMetricTables.java:196)
        at org.apache.cassandra.db.virtual.AbstractVirtualTable.select(AbstractVirtualTable.java:91)
        at org.apache.cassandra.db.VirtualTablePartitionRangeReadQuery.queryVirtualTable(VirtualTablePartitionRangeReadQuery.java:93)
        at org.apache.cassandra.db.VirtualTableReadQuery.executeLocally(VirtualTableReadQuery.java:61)
        at org.apache.cassandra.db.AbstractReadQuery.executeInternal(AbstractReadQuery.java:64)
        at org.apache.cassandra.db.VirtualTableReadQuery.executeInternal(VirtualTableReadQuery.java:32)
        at org.apache.cassandra.db.VirtualTableReadQuery.execute(VirtualTableReadQuery.java:54)
        at org.apache.cassandra.service.pager.AbstractQueryPager.fetchPage(AbstractQueryPager.java:75)
        at org.apache.cassandra.service.pager.PartitionRangeQueryPager.fetchPage(PartitionRangeQueryPager.java:29)
        at org.apache.cassandra.cql3.statements.SelectStatement$Pager$NormalPager.fetchPage(SelectStatement.java:352)
        at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:400)
        at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:250)
        at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:88)
        at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:216)
        at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:253)
        at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:240)
        at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:108)
        at org.apache.cassandra.transport.Message$Request.execute(Message.java:253)
        at org.apache.cassandra.transport.Message$Dispatcher.processRequest(Message.java:725)
        at org.apache.cassandra.transport.Message$Dispatcher.lambda$channelRead0$0(Message.java:630)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:162)
        at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:119)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:748)