I’m running into this strange issue - pretty consistently right now…
Soc I have a document where I get an exception when I try to Get(doc id)
- this is the snippet where I get the first log line - but not the second:
Util.info("key=" + key + ", docid=" + getDocId(key));
JsonDocument doc = getDb().get(getDocId(key));
Util.info("Doc. loaded ");
The exception is:
Caused by: com.couchbase.client.core.CouchbaseException: java.lang.RuntimeException: Could not decode snappy-compressed value.
at com.couchbase.client.core.endpoint.AbstractGenericHandler.decode(AbstractGenericHandler.java:369)
at com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81)
at com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
at com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at com.couchbase.client.deps.io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
at com.couchbase.client.deps.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:312)
at com.couchbase.client.deps.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:286)
at com.couchbase.client.deps.io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:253)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at com.couchbase.client.deps.io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:335)
at com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1304)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:356)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:342)
at com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:921)
at com.couchbase.client.deps.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:135)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:646)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:581)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460)
at com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:131)
at com.couchbase.client.deps.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:811)
Caused by: java.lang.RuntimeException: Could not decode snappy-compressed value.
at com.couchbase.client.core.endpoint.kv.KeyValueHandler.handleSnappyDecompression(KeyValueHandler.java:397)
at com.couchbase.client.core.endpoint.kv.KeyValueHandler.decodeResponse(KeyValueHandler.java:949)
at com.couchbase.client.core.endpoint.kv.KeyValueHandler.decodeResponse(KeyValueHandler.java:132)
at com.couchbase.client.core.endpoint.AbstractGenericHandler.decode(AbstractGenericHandler.java:338)
... 33 more
Caused by: com.couchbase.client.deps.org.iq80.snappy.CorruptionException: Invalid copy offset for opcode starting at 1
at com.couchbase.client.deps.org.iq80.snappy.SnappyDecompressor.decompressAllTags(SnappyDecompressor.java:165)
at com.couchbase.client.deps.org.iq80.snappy.SnappyDecompressor.uncompress(SnappyDecompressor.java:47)
at com.couchbase.client.deps.org.iq80.snappy.Snappy.uncompress(Snappy.java:85)
at com.couchbase.client.core.endpoint.kv.KeyValueHandler.handleSnappyDecompression(KeyValueHandler.java:395)
... 36 more
The document that fails seems pretty straight forward to me:
{
"catchphoto": false,
"datetaken": "2015-12-08T13:45:47+0100",
"filepath": "/photo/ab/ab720a1f-dbd0-4ac5-9fef-a9e86ac32b3b.jpg",
"height": 125,
"ispublic": false,
"key": "740B51E6D8BD1BC5C1257F1500461C63",
"revisioninfo": {
"created": "2015-12-08T13:45:48+0100",
"createdby": "John Dalsgaard/2124DEFEC111BA8FC1257ED20034B387/Fangst",
"modifiedcount": 0
},
"size": 3688,
"thumbnailfilepath": "/photo/ab/ab720a1f-dbd0-4ac5-9fef-a9e86ac32b3b-tn.jpg",
"thumbnailheight": 100,
"thumbnailsize": 2703,
"thumbnailwidth": 120,
"type": "Photo",
"width": 150
}
And the meta data:
{
"meta": {
"id": "Photo:740B51E6D8BD1BC5C1257F1500461C63",
"rev": "2-159c2bd3020200000000000002000000",
"expiration": 0,
"flags": 33554432,
"type": "json"
},
"xattrs": {
"_sync": {
"rev": "1-0314fe729a6efb9e7ac7896e486b640c",
"sequence": 322931,
"recent_sequences": [
322931
],
"history": {
"revs": [
"1-0314fe729a6efb9e7ac7896e486b640c"
],
"parents": [
-1
],
"channels": [
null
]
},
"cas": "0x00000202d32b9c15",
"value_crc32c": "0x5a509151",
"time_saved": "2019-05-06T20:35:56.405028379+02:00"
}
}
}
… and it also happens with other similar “Photo” docs (that are loaded on the first page of the web app). So basically, the entire web app is not functional at the moment… (it is in a demo environment - but of course it is worrying… - can this also happen in production?)
Where can I start troubleshooting this?
Environment:
Couchbase server: Community Edition 6.0.0 build 1693 ‧ IPv4
Java 1.8 using the couchbase client SDK 2.7.9
Not sure if this matters - but this environment also has a Sync. Gateway: (Couchbase Sync Gateway/2.6.0(127;b4c828d) CE). We use this environment for developing a new version of our app that uses Coucbase and Sync Gateway