java.lang.ArrayIndexOutOfBoundsException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Turning on authentication in the Python driver to talk to a Cassandra 1.2.19 cluster with {{authenticator: PasswordAuthenticator}} enabled results in a failed connection. Example Pyton code: {code} import time from cassandra.cluster import Cluster from cassandra.auth import PlainTextAuthProvider query=""" select key,bootstrapped,cql_version,data_center, rack,release_version,thrift_version from system.local;""" clusterhosts=['127.0.0.1'] auth = PlainTextAuthProvider(username='cassandra', password='cassandra') cluster = Cluster(clusterhosts, auth_provider=auth) s = cluster.connect(None) result = s.execute(query) for l in result: print l print "Time: %ss" % eta print "shutting down" start = time.time() cluster.shutdown() eta = time.time() - start print "shutdown took %s seconds" % eta {code} Output/stacktrace: {code} Traceback (most recent call last): File "/Users/chrisswingler/src/nagios_cassandra/demo_cass_bug.py", line 22, in <module> s = cluster.connect(None) File "cassandra/cluster.py", line 1160, in cassandra.cluster.Cluster.connect (cassandra/cluster.c:17467) File "cassandra/cluster.py", line 1193, in cassandra.cluster.Cluster.connect (cassandra/cluster.c:17288) File "cassandra/cluster.py", line 1180, in cassandra.cluster.Cluster.connect (cassandra/cluster.c:16991) File "cassandra/cluster.py", line 2597, in cassandra.cluster.ControlConnection.connect (cassandra/cluster.c:47304) File "cassandra/cluster.py", line 2634, in cassandra.cluster.ControlConnection._reconnect_internal (cassandra/cluster.c:48201) cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'127.0.0.1': KeyError(0,)}) {code} The Cassandra node will also throw this exception: {code} ERROR [Native-Transport-Requests:374] 2017-02-15 19:24:07,637 ErrorMessage.java (line 210) Unexpected exception during request java.lang.ArrayIndexOutOfBoundsException: 15 at org.apache.cassandra.transport.Message$Type.fromOpcode(Message.java:102) at org.apache.cassandra.transport.Frame$Decoder.decode(Frame.java:179) at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:425) at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) 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} I'm speculating this is an incompatibility with how authentication is handled on the native CQL transport in Cassandra 1.2.19. If this is broken on the Cassandra 1.2.19 side, the Datastax driver docs for {{cassandra.auth}} should be updated to reflect this.
    via by Chris Swingler,
  • Unable to connect cassandra through R
    via Stack Overflow by Osman Khalid
    ,
  • So I've reproduced this locally on OS X, as well as on Ubuntu with CassCI. We are using the current HEAD of the {{cassandra-test}} branch, which is {{a6bd6c368d69626c0b}}. When connecting to a two node, 1.2.16 cluster (for sanity I checked that this also repros on 1.2.19 and it does), we see the following error from the driver: {code} cassandra.cluster: ERROR: Control connection failed to connect, shutting down Cluster: Traceback (most recent call last): File "cassandra/cluster.py", line 1176, in cassandra.cluster.Cluster.connect (cassandra/cluster.c:16911) self.control_connection.connect() File "cassandra/cluster.py", line 2521, in cassandra.cluster.ControlConnection.connect (cassandra/cluster.c:45182) self._set_new_connection(self._reconnect_internal()) File "cassandra/cluster.py", line 2558, in cassandra.cluster.ControlConnection._reconnect_internal (cassandra/cluster.c:46079) raise NoHostAvailable("Unable to connect to any servers", errors) NoHostAvailable: ('Unable to connect to any servers', {'127.0.0.1': ConnectionException('Failed to initialize new connection to 127.0.0.1: Error from server: code=0000 [Server error] message="java.lang.ArrayIndexOutOfBoundsException: 4"',)}) {code} with the following error logged server side by the C* node: {code} ERROR [Native-Transport-Requests:3] 2016-09-03 14:47:36,946 ErrorMessage.java (line 210) Unexpected exception during request java.lang.ArrayIndexOutOfBoundsException: 4 at org.apache.cassandra.transport.Frame$Header$Flag.deserialize(Frame.java:120) at org.apache.cassandra.transport.Frame$Header.<init>(Frame.java:96) at org.apache.cassandra.transport.Frame$Header.<init>(Frame.java:84) at org.apache.cassandra.transport.Frame.create(Frame.java:74) at org.apache.cassandra.transport.Frame$Decoder.decode(Frame.java:186) at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:425) at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) 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} Our connection code looks like: {code} cluster = PyCluster([node_ip], auth_provider=auth_provider, compression=compression, protocol_version=protocol_version, load_balancing_policy=load_balancing_policy, default_retry_policy=FlakyRetryPolicy(), port=port, ssl_options=ssl_opts, connect_timeout=10, allow_beta_protocol_version=True) session = cluster.connect(wait_for_all_pools=True) {code} protocol_version is being explicitly set to 1. auth_provider, ssl_opts and compression are None. load_balancing_policy is WhiteListRoundRobinPolicy. default_retry_policy is our own FlakyRetryPolicy which you can find in dtest.py. For transparency's sake, this started happening sometime in the last 21 days as far as our CI can tell. Changes have gone into none of {the driver, C* 1.2, this dtest} in that time period. Given that, we have no good guess as to why this just started, but it does reproduce completely consistently. Related Links: https://issues.apache.org/jira/browse/CASSANDRA-12616 http://cassci.datastax.com/job/cassandra-2.1_dtest/506/testReport/upgrade_supercolumns_test/TestSCUpgrade/upgrade_with_counters_test/
    via by Philip Thompson,
    • java.lang.ArrayIndexOutOfBoundsException: 15 at org.apache.cassandra.transport.Message$Type.fromOpcode(Message.java:102) at org.apache.cassandra.transport.Frame$Decoder.decode(Frame.java:179) at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:425) at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) 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)
    No Bugmate found.