org.apache.cassandra.transport.ProtocolException: Unknown opcode 38

94 views
Skip to first unread message

Wim Deblauwe

unread,
Nov 6, 2014, 6:32:20 AM11/6/14
to astyanax-cas...@googlegroups.com
Hi,

I am currently using Spring Data Cassandra 1.1.1 with Cassandra 2.1.1 and Cassandra Unit 2.0.2.2. I want to add storing of files to my application. For this, I am looking to the Chunked Object store recipe in Astyanax. 

I managed to have a unit test running by adding the following dependencies to my pom.xml:

<dependency>
            <groupId>com.netflix.astyanax</groupId>
            <artifactId>astyanax-core</artifactId>
            <version>${astyanax.version}</version>
        </dependency>
        <dependency>
            <groupId>com.netflix.astyanax</groupId>
            <artifactId>astyanax-thrift</artifactId>
            <version>${astyanax.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cassandra</groupId>
            <artifactId>cassandra-thrift</artifactId>
            <version>2.1.1</version>
        </dependency>
        <dependency>
            <groupId>com.netflix.astyanax</groupId>
            <artifactId>astyanax-cassandra</artifactId>
            <version>${astyanax.version}</version>
        </dependency>
        <dependency>
            <groupId>com.netflix.astyanax</groupId>
            <artifactId>astyanax-recipes</artifactId>
            <version>${astyanax.version}</version>
        </dependency>
        <dependency>
            <groupId>org.xerial.snappy</groupId>
            <artifactId>snappy-java</artifactId>
            <version>1.1.1.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.thrift</groupId>
            <artifactId>libthrift</artifactId>
            <version>0.9.1</version>
        </dependency>

With astyanax.version set to 2.0.1



This is how I create the Keyspace object in the unit test:

@Bean
public Keyspace keyspace()
{
AstyanaxContext<Keyspace> astyanaxContext = new AstyanaxContext.Builder()
.forKeyspace( "images" )
.withAstyanaxConfiguration( new AstyanaxConfigurationImpl()
.setCqlVersion( "3.0.0" )
.setTargetCassandraVersion( "2.0" )
.setDiscoveryType( NodeDiscoveryType.NONE ) )
.withConnectionPoolConfiguration( new ConnectionPoolConfigurationImpl( "testConnectionPool" )
 .setPort( 9142 )
 .setMaxConnsPerHost( 1 )
 .setSeeds( "127.0.0.1:9142" ) )
.withConnectionPoolMonitor( new Slf4jConnectionPoolMonitorImpl() )
.buildKeyspace( ThriftFamilyFactory.getInstance() );
astyanaxContext.start();
Keyspace keyspace = astyanaxContext.getClient();
return keyspace;
}

I create a simple keyspace in CQL at the start of the test:

CREATE KEYSPACE images WITH replication = {
  'class': 'SimpleStrategy',
  'replication_factor': '1'
};

USE images;

I probably need to create a table as well. How?

Running the test (without the table created, but I don't know if that could be the cause?), I get this error:

2014-11-06 12:10:56 ERROR [SharedPool-Worker-1] Message - Unexpected exception during request; channel = [id: 0x2a5e2ad6, /127.0.0.1:55104 => /127.0.0.1:9142]
io.netty.handler.codec.DecoderException: org.apache.cassandra.transport.ProtocolException: Unknown opcode 38
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:280)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:149)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.cassandra.transport.ProtocolException: Unknown opcode 38
at org.apache.cassandra.transport.Message$Type.fromOpcode(Message.java:131)
at org.apache.cassandra.transport.Frame$Decoder.decode(Frame.java:207)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:249)
... 12 common frames omitted

Any idea what I could be doing wrong?

regards,

Wim

Christian Kampka

unread,
Feb 7, 2015, 7:25:18 AM2/7/15
to astyanax-cas...@googlegroups.com
Hi,

not sure if this is still helpful, but the Astyanax driver won't work with Cassandra 2.1+
You should migrate to the Datastax driver, it's much more capable than Astyanax.

Cheers,
Christian
Reply all
Reply to author
Forward
0 new messages