Query s view causes and exception in some calls

Tried version 2.0.2 and got the “cannot decode view json” again.

2.1.0-dp seems to address my issue. I’m no longer receiving “Cannot decode view Json” messages.

Thanks for the quick turnaround.

@nikkki do you also want to try 2.1.0-dp to see if it solves your issue? Here’s how to get it: http://blog.couchbase.com/n1ql-dp4-java-sdk

@daschl Tried and the result still isn’t good though without “Cannot decode view json” anymore, and I’m running a simple query to the beer sample, using the “brewery_beers” view, on a non-VPC instance from your official community version AMI(3.0.0):

The line 69 in CouchTool.main() is System.out.print("Total_Row:" + Integer.toString(vr.totalRows()) + "/Found_Row:" + Integer.toString(vr.allRows().size()));, and “vr” is a ViewResult.

I am also getting this error but intermittently with the stack trace below.

I have the following observations:

  • I don’t believe it has anything to do with the server as when I run the same query against the server 100 times it responds every time correctly.
  • The data that is shown in the stack trace has nothing to do with the view query, the data is from another unrelated document
  • It looks to me as if some requests are being crossed over so that the view query runs but the client reads the response from another request or a chunk from another request

Is there anyone working / looking at this?

Stack trace:

Message Could not decode View JSON.Stacktrace 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:55)
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:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745) Caused by: com.couchbase.client.deps.com.fasterxml.jackson.core.JsonParseException: Unexpected end-of-input: was expecting closing quote for a string value
at [Source: {“id”:"TEST-NYX-CAS}; line: 1, column: 41]
at com.couchbase.client.deps.com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1419)
at com.couchbase.client.deps.com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:508)
at com.couchbase.client.deps.com.fasterxml.jackson.core.base.ParserMinimalBase._reportInvalidEOF(ParserMinimalBase.java:445)
at com.couchbase.client.deps.com.fasterxml.jackson.core.json.ReaderBasedJsonParser._finishString2(ReaderBasedJsonParser.java:1598)
at com.couchbase.client.deps.com.fasterxml.jackson.core.json.ReaderBasedJsonParser._finishString(ReaderBasedJsonParser.java:1585)
at com.couchbase.client.deps.com.fasterxml.jackson.core.json.ReaderBasedJsonParser.getValueAsString(ReaderBasedJsonParser.java:249)
at com.couchbase.client.java.transcoder.JacksonTransformers$AbstractJsonValueDeserializer.decodeObject(JacksonTransformers.java:59)
at com.couchbase.client.java.transcoder.JacksonTransformers$JsonObjectDeserializer.deserialize(JacksonTransformers.java:142)
at com.couchbase.client.java.transcoder.JacksonTransformers$JsonObjectDeserializer.deserialize(JacksonTransformers.java:137)
at com.couchbase.client.deps.com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3051)
at com.couchbase.client.deps.com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2146)
at com.couchbase.client.java.transcoder.JsonTranscoder.stringToJsonObject(JsonTranscoder.java:78)
at com.couchbase.client.java.transcoder.JsonTranscoder.byteBufToJsonObject(JsonTranscoder.java:89)
at com.couchbase.client.java.view.ViewQueryResponseMapper$ByteBufToJsonObject.call(ViewQueryResponseMapper.java:83) … 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:58) … 12 more

@jamesdbloom can you try 2.1.0 which was released yesterday?

I just got this same JSON decode error with 2.0.3, tried 2.1.0 which seems to fix the decode error.

awesome! great to hear it works