Query s view causes and exception in some calls


#1

My view has a reduce count function and from time to time the call fails with the followed exception, any clue?

com.couchbase.client.java.error.TranscodingException: Could not decode View JSON.
at com.couchbase.client.java.view.ViewQueryResponseMapper$ByteBufToJsonObject.call(ViewQueryResponseMapper.java:87)
at com.couchbase.client.java.view.ViewQueryResponseMapper$ByteBufToJsonObject.call(ViewQueryResponseMapper.java:74)
at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:54)
at rx.internal.operators.NotificationLite.accept(NotificationLite.java:150)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:189)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.access$000(OperatorObserveOn.java:65)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:153)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: com.couchbase.client.deps.io.netty.util.IllegalReferenceCountException: refCnt: 0
at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1187)
at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1138)
at com.couchbase.client.deps.io.netty.buffer.PooledUnsafeDirectByteBuf.nioBuffer(PooledUnsafeDirectByteBuf.java:344)
at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.toString(AbstractByteBuf.java:964)
at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.toString(AbstractByteBuf.java:953)
at com.couchbase.client.deps.io.netty.buffer.WrappedByteBuf.toString(WrappedByteBuf.java:762)
at com.couchbase.client.java.transcoder.JsonTranscoder.byteBufToJsonObject(JsonTranscoder.java:89)
at com.couchbase.client.java.view.ViewQueryResponseMapper$ByteBufToJsonObject.call(ViewQueryResponseMapper.java:83)
… 15 more
Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: com.couchbase.client.deps.io.netty.buffer.SimpleLeakAwareByteBuf.class
at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:98)
at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:56)


#2

Can you try with the freshly released 2.0.3 and see if it still happens?


#3

Also, if it does, it may be worth turning up the log level. @daschl can probably give you more guidance on which classes to up the loglevel on.


#4

I’m getting the same issue as well on client 2.0.3. My view is a map only.

I upgraded to 2.0.3 yesterday in hopes to alleviate the following message:

“LEAK: ByteBuf.release() was not called before it’s garbage-collected. Enable advanced leak reporting to find out where the leak occurred. To enable advanced leak reporting, specify the JVM option ‘-Dcom.couchbase.client.deps.io.netty.leakDetectionLevel=advanced’ or call ResourceLeakDetector.setLevel()”

2.0.3 seems to get rid of the LEAK, but I’m now sporadically seeing the message:

“com.couchbase.client.java.error.TranscodingException: Could not decode View JSON.”

A quick search seems to point to line 104: https://github.com/couchbase/couchbase-java-client/blob/master/src/main/java/com/couchbase/client/java/view/ViewQueryResponseMapper.java

I will try bumping to level DEBUG and see if can get some details.


#5

Same issue on my project, and fixed it by downgrading to 2.0.1 of Java SDK


#6

@nikkki, @jmarchesini would you mind to share more infos about how your view looks like and what should be returned from the server under this condition?

Thanks


#7

My view is super simple as just one line of emit(doc.user_id,meta.id);, and I got this error with 2.0.3 when I was querying with this simple view as development view and development subset of data. And I’m using official Amazon image of community version 3.0.0


#8

@daschl I’m getting this error intermittently. I have a job running in the Quartz scheduler, which succeeds on some occasions and fails on others. I’m using CB server 3.0.2 on Windows, with Java 1.7.0_25-b17 on Java HotSpot 64-bit VM build 23.25-b01 mixed mode.

I’m pasting the views that execute during the job run. Not sure exactly which view is causing the error - I’ve added some stack trace logging and will reply again once I nail it down:

function (doc, meta) {
    if (doc.type && doc.type == "user-property") {
        var json = doc.value;

        if (json.Key == "timezone") {
            emit(json.Value, doc.user_id);
        }
    }
}

function (doc, meta) {
    if (doc.type && doc.type == "notification-setting") {
        var json = doc.value;

        if (json.IntervalType == 1) {
            emit(doc.user_id, json.EventNotificationType);
        }
    }
}

function (doc, meta) {
   if (doc.type && doc.type == "activity-log-notification") {
     var json = doc.value;
     
     if (json.Event == 1 || json.Event == 2) {
       emit(doc.user_id, meta.id);
     }
   }
 }

My calling code (in Scala):

val viewResults = CouchbaseConnection.bucket.query(ViewQuery.from(designDoc, viewName).stale(Stale.FALSE))

#9

Today, I got a WARN messages just before the Decode exception. Not sure if this is related or a red herring, but this happened a few millis before the exception:

com.couchbase.client.deps.io.netty.handler.codec.DecoderException

java.lang.IndexOutOfBoundsException: index: 512 (expected: range(0, 512))

com.couchbase.client.deps.io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: index: 512 (expected: range(0, 512))
at com.couchbase.client.deps.io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99)
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:308)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at com.couchbase.client.deps.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:182)
at com.couchbase.client.deps.io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:147)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
at com.couchbase.client.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
at com.couchbase.client.deps.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
at com.couchbase.client.deps.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
at com.couchbase.client.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
at com.couchbase.client.deps.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at com.couchbase.client.deps.io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IndexOutOfBoundsException: index: 512 (expected: range(0, 512))
at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1123)
at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.getByte(AbstractByteBuf.java:338)
at com.couchbase.client.core.endpoint.view.ViewHandler.parseViewRows(ViewHandler.java:373)
at com.couchbase.client.core.endpoint.view.ViewHandler.parseQueryResponse(ViewHandler.java:275)
at com.couchbase.client.core.endpoint.view.ViewHandler.decodeResponse(ViewHandler.java:189)
at com.couchbase.client.core.endpoint.view.ViewHandler.decodeResponse(ViewHandler.java:66)
at com.couchbase.client.core.endpoint.AbstractGenericHandler.decode(AbstractGenericHandler.java:152)
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:89)
… 16 more


#10

@jmarchesini thanks for sharing, I’ll start on reproducing this right now.


#11

@jmarchesini looking at your and @ohassidi stacks this seems to be different issues. I’ll try to reproduce either of them.

Actually I think @ohassidi’s issue was fixed in 2.0.3 through https://github.com/couchbase/couchbase-java-client/commit/e59819aeb2e85bf21154ac35b6b5bbff3ca86e95. Now looking at the other one.

@nikkki which is the exact error you are getting with 2.0.3?


#12

I don’t have the logs when I posted here few days ago, but now I’m having exact error as the original poster had, and I’m using core-1.1.0 and client-2.1.0 that I just compiled from master branch of their git repos:

com.couchbase.client.java.error.TranscodingException: Could not decode View JSON.
	at com.couchbase.client.java.view.ViewQueryResponseMapper$ByteBufToJsonObject.call(ViewQueryResponseMapper.java:104)
	at com.couchbase.client.java.view.ViewQueryResponseMapper$ByteBufToJsonObject.call(ViewQueryResponseMapper.java:91)
	at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:54)
	at rx.internal.operators.NotificationLite.accept(NotificationLite.java:150)
	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:189)
	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.access$000(OperatorObserveOn.java:65)
	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:153)
	at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:45)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
	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)
Caused by: com.couchbase.client.deps.io.netty.util.IllegalReferenceCountException: refCnt: 0
	at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1178)
	at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1129)
	at com.couchbase.client.deps.io.netty.buffer.PooledUnsafeDirectByteBuf.nioBuffer(PooledUnsafeDirectByteBuf.java:344)
	at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.toString(AbstractByteBuf.java:960)
	at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.toString(AbstractByteBuf.java:949)
	at com.couchbase.client.java.transcoder.JsonTranscoder.byteBufToJsonObject(JsonTranscoder.java:89)
	at com.couchbase.client.java.view.ViewQueryResponseMapper$ByteBufToJsonObject.call(ViewQueryResponseMapper.java:100)
	... 14 more
Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: com.couchbase.client.deps.io.netty.buffer.PooledUnsafeDirectByteBuf.class
	at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:98)
	at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:56)
	... 12 more

#13

And my JSON is not small in size


#14

@nikkki hm thanks for confirming. What code did you run to reproduce this?


#15

@nikkki can you try with the latest masters (both core-io and java-client)? I think the off by one error is fixed, maybe this has also fixed the other issue. I at least couldn’t reproduce it anymore here. Thanks!


#16

@daschl - I’m also getting the same exception as the original poster. The trace I posted yesterday (IndexOutOfBounds) was actually a WARN message that occurred milliseconds before the “com.couchbase.client.java.error.TranscodingException: Could not decode View JSON.”

Not sure that the two are related.

Sorry for the confusion.


#17

@jmarchesini they could be very much related. Note that we are planning a 2.1.0-dp today, mainly for people to try out our new N1QL DP4 compatibility, but it also includes this change - if you want to give it a shot and see if it’s gone.

If you’re curious, check out: https://github.com/couchbase/couchbase-jvm-core/commit/0e571c4039c8ae9a2ac6a9addcc4f4ace1961bb7#diff-0a09d15f4bb53ac17bad63b18db3e817L378


#18

@daschl I tried latest code of both core-jvm and java-client, but still got same error:

2015-01-16 22:16:35,571 [localhost-startStop-1] INFO  com.couchbase.client.core.CouchbaseCore- CoreEnvironment: {sslEnabled=false, sslKeystoreFile='null', sslKeystorePassword='null', queryEnabled=false, queryPort=8093, bootstrapHttpEnabled=true, bootstrapCarrierEnabled=true, bootstrapHttpDirectPort=8091, bootstrapHttpSslPort=18091, bootstrapCarrierDirectPort=11210, bootstrapCarrierSslPort=11207, ioPoolSize=2, computationPoolSize=2, responseBufferSize=16384, requestBufferSize=16384, kvServiceEndpoints=1, viewServiceEndpoints=1, queryServiceEndpoints=1, ioPool=NioEventLoopGroup, coreScheduler=CoreScheduler, packageNameAndVersion=couchbase-java-client/2.1.0-SNAPSHOT (git: 2.0.2-27-gcb5319c), dcpEnabled=false}
2015-01-16 22:16:35,571 [localhost-startStop-1] DEBUG com.couchbase.client.core.CouchbaseCore- Diagnostics {
  gc.ps marksweep.collectionCount=4,
  gc.ps marksweep.collectionTime=1118,
  gc.ps scavenge.collectionCount=17,
  gc.ps scavenge.collectionTime=1225,
  heap.pendingFinalize=0,
  heap.used=init = 122611968(119738K) used = 440246744(429928K) committed = 772276224(754176K) max = 1744830464(1703936K),
  mem.physical.free=4577026048,
  mem.physical.total=7847165952,
  mem.swap.free=0,
  mem.swap.total=0,
  mem.virtual.comitted=3716177920,
  offHeap.used=init = 24576000(24000K) used = 92066800(89908K) committed = 100990976(98624K) max = 224395264(219136K),
  proc.cpu.time=64150000000,
  runtime.name=15656@ip-172-30-2-176,
  runtime.spec=Oracle Corporation/Java Virtual Machine Specification: 1.7,
  runtime.startTime=1421446559001,
  runtime.sysProperties={java.vm.version=24.65-b04, java.vendor.url=http://java.oracle.com/, sun.jnu.encoding=UTF-8, java.vm.info=mixed mode, user.dir=/usr/share/tomcat7, sun.cpu.isalist=, java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment, sun.os.patch.level=unknown, catalina.useNaming=true, java.io.tmpdir=/var/cache/tomcat7/temp, sun.nio.ch.bugLevel=, user.home=/usr/share/tomcat7, java.awt.printerjob=sun.print.PSPrinterJob, java.version=1.7.0_65, file.encoding.pkg=sun.io, package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.jasper.,org.apache.naming.resources.,org.apache.tomcat., java.vendor.url.bug=http://bugreport.sun.com/bugreport/, file.encoding=UTF-8, sun.java.command=org.apache.catalina.startup.Bootstrap start, line.separator=
, java.vm.specification.vendor=Oracle Corporation, java.util.logging.manager=org.apache.juli.ClassLoaderLogManager, tomcat.util.buf.StringCache.byte.enabled=true, catalina.home=/usr/share/tomcat7, java.vm.vendor=Oracle Corporation, java.class.path=:/usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar, sun.io.unicode.encoding=UnicodeLittle, user.language=en, os.arch=amd64, user.name=tomcat, java.runtime.version=1.7.0_65-mockbuild_2014_09_18_00_28-b00, sun.boot.class.path=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/lib/resources.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/lib/rt.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/lib/jce.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/lib/rhino.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/lib/jfr.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/classes, package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.jasper.,org.apache.naming.,org.apache.tomcat., sun.cpu.endian=little, tomcat.util.scan.DefaultJarScanner.jarsToSkip=bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,websocket-api.jar,catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,jasper.jar,jasper-el.jar,ecj-*.jar,tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,tomcat-jni.jar,tomcat-spdy.jar,tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,tomcat-juli-adapters.jar,catalina-jmx-remote.jar,catalina-ws.jar,tomcat-jdbc.jar,tools.jar,commons-beanutils*.jar,commons-codec*.jar,commons-collections*.jar,commons-dbcp*.jar,commons-digester*.jar,commons-fileupload*.jar,commons-httpclient*.jar,commons-io*.jar,commons-lang*.jar,commons-logging*.jar,commons-math*.jar,commons-pool*.jar,jstl.jar,geronimo-spec-jaxrpc*.jar,wsdl4j*.jar,ant.jar,ant-junit*.jar,aspectj*.jar,jmx.jar,h2*.jar,hibernate*.jar,httpclient*.jar,jmx-tools.jar,jta*.jar,log4j.jar,log4j-1*.jar,mail*.jar,slf4j*.jar,xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,junit.jar,junit-*.jar,hamcrest*.jar,org.hamcrest*.jar,ant-launcher.jar,cobertura-*.jar,asm-*.jar,dom4j-*.jar,icu4j-*.jar,jaxen-*.jar,jdom-*.jar,jetty-*.jar,oro-*.jar,servlet-api-*.jar,tagsoup-*.jar,xmlParserAPIs-*.jar,xom-*.jar, awt.toolkit=sun.awt.X11.XToolkit, sun.boot.library.path=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/lib/amd64, common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar, java.home=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre, java.vm.name=OpenJDK 64-Bit Server VM, java.endorsed.dirs=, sun.management.compiler=HotSpot 64-Bit Tiered Compilers, java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory, java.runtime.name=OpenJDK Runtime Environment, org.apache.catalina.startup.ContextConfig.jarsToSkip=, catalina.base=/usr/share/tomcat7, java.util.logging.config.file=/usr/share/tomcat7/conf/logging.properties, java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib, file.separator=/, shared.loader=, java.specification.vendor=Oracle Corporation, org.apache.catalina.startup.TldConfig.jarsToSkip=tomcat7-websocket.jar, java.vm.specification.version=1.7, server.loader=, sun.java.launcher=SUN_STANDARD, user.timezone=UTC, os.name=Linux, path.separator=:, java.ext.dirs=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/lib/ext:/usr/java/packages/lib/ext, sun.arch.data.model=64, java.specification.name=Java Platform API Specification, os.version=3.14.19-17.43.amzn1.x86_64, user.country=US, java.class.version=51.0, java.vendor=Oracle Corporation, java.vm.specification.name=Java Virtual Machine Specification, java.specification.version=1.7, java.naming.factory.url.pkgs=org.apache.naming},
  runtime.uptime=36570,
  runtime.vm=Oracle Corporation/OpenJDK 64-Bit Server VM: 24.65-b04,
  sys.cpu.loadAvg=0.92,
  sys.cpu.num=2,
  sys.os.arch=amd64,
  sys.os.name=Linux,
  sys.os.version=3.14.19-17.43.amzn1.x86_64,
  thread.count=46,
  thread.peakCount=46,
  thread.startedCount=48
}
 .
 .
 .
 . 
com.couchbase.client.java.error.TranscodingException: Could not decode View JSON.
	at com.couchbase.client.java.view.ViewQueryResponseMapper$ByteBufToJsonObject.call(ViewQueryResponseMapper.java:104)
	at com.couchbase.client.java.view.ViewQueryResponseMapper$ByteBufToJsonObject.call(ViewQueryResponseMapper.java:91)
	at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:54)
	at rx.internal.operators.NotificationLite.accept(NotificationLite.java:150)
	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:189)
	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.access$000(OperatorObserveOn.java:65)
	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:153)
	at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:45)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
	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)
Caused by: com.couchbase.client.deps.io.netty.util.IllegalReferenceCountException: refCnt: 0
	at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1178)
	at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1129)
	at com.couchbase.client.deps.io.netty.buffer.PooledUnsafeDirectByteBuf.nioBuffer(PooledUnsafeDirectByteBuf.java:344)
	at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.toString(AbstractByteBuf.java:960)
	at com.couchbase.client.deps.io.netty.buffer.AbstractByteBuf.toString(AbstractByteBuf.java:949)
	at com.couchbase.client.java.transcoder.JsonTranscoder.byteBufToJsonObject(JsonTranscoder.java:89)
	at com.couchbase.client.java.view.ViewQueryResponseMapper$ByteBufToJsonObject.call(ViewQueryResponseMapper.java:100)
	... 14 more
Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: com.couchbase.client.deps.io.netty.buffer.PooledUnsafeDirectByteBuf.class
	at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:98)
	at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:56)
	... 12 more

#19

Or should I also upgrade my rx lib when I upgraded the core-jvm and java-client libs?


#20

I upgraded the rx lib from 1.0.0 to currently highest version 1.0.4, but still get this “cannot decode view json” error, and it disappeared once I downgraded core-io and java-client to 2.0.1. Another thing I did is that I added a line of “LOGGER.info(“buf:”,byteBuf.toString(CharsetUtil.UTF_8));” before TRANSCODER.byteBufToJsonObject() is called in line 102 in ViewQueryResponseMapper.java to see exactly what the content is that cannot be decoded, but unfortunately I could only see “buf:” followed by nothing in my log file(means that byteBuf.toString() returned nothing).
But I remember version 2.0.1 of core-io has the issue of big chunk of data…