java.lang.ArrayIndexOutOfBoundsException: 4

DataStax JIRA | Philip Thompson | 7 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

    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/

    DataStax JIRA | 7 months ago | Philip Thompson
    java.lang.ArrayIndexOutOfBoundsException: 4
  2. 0

    Unable to connect cassandra through R

    Stack Overflow | 3 years ago | Osman Khalid
    java.lang.ArrayIndexOutOfBoundsException: 34
  3. 0

    unable to connect R with Cassandra using JDBC, need help

    Google Groups | 3 years ago | Osman Khalid
    java.lang.ArrayIndexOutOfBoundsException: 34
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [Cassandra-user] unable to connect R with Cassandra using JDBC, need help - Grokbase

    grokbase.com | 9 months ago
    java.lang.ArrayIndexOutOfBoundsException: 34
  6. 0

    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.

    DataStax JIRA | 2 months ago | Chris Swingler
    java.lang.ArrayIndexOutOfBoundsException: 15

    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. java.lang.ArrayIndexOutOfBoundsException

      4

      at org.apache.cassandra.transport.Frame$Header$Flag.deserialize()
    2. org.apache.cassandra
      Frame$Decoder.decode
      1. org.apache.cassandra.transport.Frame$Header$Flag.deserialize(Frame.java:120)
      2. org.apache.cassandra.transport.Frame$Header.<init>(Frame.java:96)
      3. org.apache.cassandra.transport.Frame$Header.<init>(Frame.java:84)
      4. org.apache.cassandra.transport.Frame.create(Frame.java:74)
      5. org.apache.cassandra.transport.Frame$Decoder.decode(Frame.java:186)
      5 frames
    3. Netty
      NioWorker.run
      1. org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:425)
      2. org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
      3. org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
      4. org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
      5. org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
      6. org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:109)
      7. org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)
      8. org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90)
      9. org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
      9 frames
    4. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      3. java.lang.Thread.run(Thread.java:745)
      3 frames