Compatibility issue after upgrade of Couchbase community version from 7.2.4 to 7.6.1

We have tried an FTS query with Java client version 3.4.11 to 3.6.1. Still We are getting below error,
Cannot invoke "com.couchbase.client.core.deps.com.fasterxml.jackson.databind.JsonNode.doubleValue()" because the return value of "com.couchbase.client.core.deps.com.fasterxml.jackson.databind.node.ObjectNode.get(String)" is null

Can you provide the code and related classes, and the complete stack trace?
Thanks,
Mike

Thanks for the quick response.

Here’s the query which throws error via java client library but responds well from Couchbase UI.

FTS Query:

{“conjuncts”:[{“field”:“requestType”,“match”:“contractorJob”,“operator”:“and”},{“start”:“2023-04-24T00:00:00.00Z”,“end”:“2024-04-23T23:59:59.999Z”,“inclusive_start”:true,“inclusive_end”:true,“field”:“auditDetail.modifiedTime”}]}


Stack trace:

{"@timestamp":"2024-04-24T05:13:38.7537139Z","@version":"1","message":"Cannot invoke \"com.couchbase.client.core.deps.com.fasterxml.jackson.databind.JsonNode.doubleValue()\" because the return value of \"com.couchbase.client.core.deps.com.fasterxml.jackson.databind.node.ObjectNode.get(String)\" is null","stack_trace":"java.lang.NullPointerException: Cannot invoke \"com.couchbase.client.core.deps.com.fasterxml.jackson.databind.JsonNode.doubleValue()\" because the return value of \"com.couchbase.client.core.deps.com.fasterxml.jackson.databind.node.ObjectNode.get(String)\" is null\n\tat com.couchbase.client.core.util.CoreAsyncUtils.block(CoreAsyncUtils.java:54)\n\tat com.couchbase.client.java.AsyncUtils.block(AsyncUtils.java:37)\n\tat com.couchbase.client.java.Cluster.searchQuery(Cluster.java:457)\n\tat com.bt.srims.ecm.cjm.data.CouchbaseTemplateRepo.searchQuery(CouchbaseTemplateRepo.java:175)\n\tat com.bt.srims.ecm.cjm.service.impl.ContractorJobRequestServiceImpl.setPaginationResponse(ContractorJobRequestServiceImpl.java:691)\n\tat com.bt.srims.ecm.cjm.service.impl.ContractorJobRequestServiceImpl.fetchRequests(ContractorJobRequestServiceImpl.java:661)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\n\tat java.base/java.lang.reflect.Method.invoke(Unknown Source)\n\tat org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:354)\n\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)\n\tat java.base/java.lang.Thread.run(Unknown Source)\n\tSuppressed: java.lang.Exception: The above exception was originally thrown by another thread at the following location.\n\t\tat com.couchbase.client.core.api.search.result.CoreSearchRow.fromResponse(CoreSearchRow.java:138)\n\t\tat com.couchbase.client.core.api.search.result.CoreSearchRow.fromResponse(CoreSearchRow.java:132)\n\t\tat reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:113)\n\t\tat reactor.core.publisher.FluxRefCount$RefCountInner.onNext(FluxRefCount.java:238)\n\t\tat reactor.core.publisher.FluxPublish$PublishSubscriber.drain(FluxPublish.java:571)\n\t\tat reactor.core.publisher.FluxPublish$PublishSubscriber.onNext(FluxPublish.java:310)\n\t\tat reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210)\n\t\tat reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210)\n\t\tat reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:210)\n\t\tat reactor.core.publisher.SinkManyUnicast.drainRegular(SinkManyUnicast.java:284)\n\t\tat reactor.core.publisher.SinkManyUnicast.drain(SinkManyUnicast.java:365)\n\t\tat reactor.core.publisher.SinkManyUnicast.subscribe(SinkManyUnicast.java:423)\n\t\tat reactor.core.publisher.InternalFluxOperator.subscribe(InternalFluxOperator.java:68)\n\t\tat reactor.core.publisher.FluxPublish.connect(FluxPublish.java:106)\n\t\tat reactor.core.publisher.FluxRefCount.subscribe(FluxRefCount.java:88)\n\t\tat reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76)\n\t\tat reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:165)\n\t\tat reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:121)\n\t\tat reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:67)\n\t\tat java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)\n\t\tat java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)\n\t\tat java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)\n\t\tat java.base/java.util.concurrent.CompletableFuture.complete(Unknown Source)\n\t\tat com.couchbase.client.core.msg.BaseRequest.succeed(BaseRequest.java:161)\n\t\tat com.couchbase.client.core.io.netty.chunk.ChunkedMessageHandler.completeInitialResponse(ChunkedMessageHandler.java:274)\n\t\tat com.couchbase.client.core.io.netty.chunk.ChunkedMessageHandler.handleHttpContent(ChunkedMessageHandler.java:261)\n\t\tat com.couchbase.client.core.io.netty.chunk.ChunkedMessageHandler.channelRead(ChunkedMessageHandler.java:210)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)\n\t\tat com.couchbase.client.core.deps.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)\n\t\tat com.couchbase.client.core.deps.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509)\n\t\tat com.couchbase.client.core.deps.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407)\n\t\tat com.couchbase.client.core.deps.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)\n\t\tat com.couchbase.client.core.deps.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\t\tat com.couchbase.client.core.deps.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\t\t... 1 common frames


CouchbaseTemplateRepo.class

@Override
public SearchResult searchQuery(String indexName, SearchQuery query, SearchOptions options) {
return cluster.searchQuery(indexName, query, options); //line no 175
}

Thanks. If you have the output from the query UI, that would also help.

For some reason the “score” is missing.

double score = hit.get("score").doubleValue();

There’s a ticket for this - MB-60719 .

@nikhilvjain What you’ve shared here …

{“conjuncts”:[{“field”:“requestType”,“match”:“contractorJob”,“operator”:“and”},{“start”:“2023-04-24T00:00:00.00Z”,“end”:“2024-04-23T23:59:59.999Z”,“inclusive_start”:true,“inclusive_end”:true,“field”:“auditDetail.modifiedTime”}]}

… is only the query portion of the search request. Is this all the payload you’re pushing into the SDK?

@IswaryaI , @nikhilvjain - you can avoid this error by NOT disabling scoring.

searchOptions().disableScoring(true) <--- do not set to true

This will be fixed in the June release.

2 Likes

Thanks for the workaround, will try this and update here @mreiche !

It is working by enabling scoring. Thank you @mreiche.