Error occurs with cosmos db version upgrade

Siva Raghavan 5 Reputation points
2023-06-07T00:16:47.3766667+00:00

We are encountering error after updating cosmos db version to 4.45.1

Error was received while reading the incoming data. The connection will be closed.

java.lang.NoSuchMethodError: 'reactor.core.publisher.Mono reactor.core.publisher.Mono.fromFuture(java.util.function.Supplier, boolean)'| at com.azure.cosmos.implementation.caches.AsyncCacheNonBlocking.getAsync(AsyncCacheNonBlocking.java:75)| at com.azure.cosmos.implementation.caches.RxPartitionKeyRangeCache.tryLookupAsync(RxPartitionKeyRangeCache.java:63)| at com.azure.cosmos.implementation.RxDocumentClientImpl.lambda$readMany$65(RxDocumentClientImpl.java:2328)| at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:125)| at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1815)| at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)| at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1815)| at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.signalCached(MonoCacheTime.java:328)| at reactor.core.publisher.MonoCacheTime$CoordinatorSubscriber.onNext(MonoCacheTime.java:345)| at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:180)| at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:180)| at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:180)| at reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)| at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onNext(FluxRetryWhen.java:173)| at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1815)| at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:185)| at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onComplete(FluxMapFuseable.java:150)| at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)| at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249)| at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1815)| at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:148)| at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56)| at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)| at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)| at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1815)| at reactor.core.publisher.MonoIgnoreThen$ThenAcceptInner.onNext(MonoIgnoreThen.java:305)| at reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)| at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onNext(FluxRetryWhen.java:173)| at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1815)| at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:185)| at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2057)| at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onComplete(FluxMapFuseable.java:150)| at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)| at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249)| at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1815)| at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:185)| at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)| at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:84)| at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:259)| at reactor.core.publisher.FluxHandle$HandleSubscriber.onComplete(FluxHandle.java:212)| at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onComplete(FluxMap.java:269)| at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onComplete(FluxDoFinally.java:145)| at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onComplete(FluxHandleFuseable.java:229)| at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onComplete(FluxContextWrite.java:126)| at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)| at reactor.core.publisher.MonoCollectList$MonoCollectListSubscriber.onComplete(MonoCollectList.java:128)| at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:259)| at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)| at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:401)| at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:416)| at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:470)| at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:685)| at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:94)| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)| at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)| at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)| at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)| at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)| at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)| at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)| at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)| at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)| at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1504)| at io.netty.handler.ssl.SslHandler.decodeNonJdkCompatible(SslHandler.java:1265)| at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1302)| at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:508)| at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:447)| at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)| at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)| at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)| at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)| at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)| at io.netty.channel.kqueue.AbstractKQueueStreamChannel$KQueueStreamUnsafe.readReady(AbstractKQueueStreamChannel.java:544)| at io.netty.channel.kqueue.AbstractKQueueChannel$AbstractKQueueUnsafe.readReady(AbstractKQueueChannel.java:382)| at io.netty.channel.kqueue.KQueueEventLoop.processReady(KQueueEventLoop.java:211)| at io.netty.channel.kqueue.KQueueEventLoop.run(KQueueEventLoop.java:289)| at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)| at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)| at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)| at java.base/java.lang.Thread.run(Thread.java:833)|java.lang.NoSuchMethodError: 'reactor.core.publisher.Mono reactor.core.publisher.Mono.fromFuture(java.util.function.Supplier, boolean)'

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,909 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Sedat SALMAN 14,180 Reputation points MVP
    2023-06-07T01:00:21.2666667+00:00

    It seems that the Cosmos DB dependency might be bringing an older version of reactor-core that doesn't have the required method

    You can either try excluding the reactor-core dependency from the Cosmos DB dependency in your build file

    or

    Try explicitly adding a reactor-core dependency to your project with a version of 3.3.0 or higher

    https://stackoverflow.com/questions/60246812/spring-boot-reactivecosmosrepository-java-lang-nosuchmethoderror-reactor-ut


  2. SSingh-MSFT 16,371 Reputation points Moderator
    2023-06-07T04:11:57.4166667+00:00

    Hi Siva Raghavan •,

    Welcome to Microsoft Q&A forum and thanks for using Azure Services.

    As I understand, you are getting error when doing cosmos db version upgrade.

    Could you please confirm if the Cosmos DB API is Mongo DB?

    If yes, please follow the steps mentioned in the documentation here: https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/upgrade-version

    At this moment, only qualifying accounts using the server version 3.2 can be upgraded to version 3.6 and higher. If your account doesn't show the upgrade option, please file a support ticket.

    In case you do not have support plan, do let us know so that we can help with other options to unblock you.

    Thank you.


  3. Ayushkrity Anuj 0 Reputation points
    2023-09-18T17:00:16.2766667+00:00

    I am also encountering the same error when try to upgrade azure-spring-data-cosmos from 3.33.0 to 3.38.0

    Error is:
    ERROR ERRORapplog.cls=reactor.util.Loggers$Slf4JLogger,applog.mthd=error,applog.line=315,applog.msg=[id:4d56b5d3, L:/11.16.181.39:48392 - R:captymas-fcap-dev-azure-cosmosdb-eastus2.documents.azure.com/10.237.196.230:443] Error was received while reading the incoming data. The connection will be closed.,exc.stack=java.lang.NoSuchMethodError: reactor.core.publisher.Mono.fromFuture(Ljava/util/function/Supplier;Z)Lreactor/core/publisher/Mono;\n\tat com.azure.cosmos.implementation.caches.AsyncCacheNonBlocking.getAsync(AsyncCacheNonBlocking.java:75)\n\tat com.azure.cosmos.implementation.caches.RxPartitionKeyRangeCache.tryLookupAsync(RxPartitionKeyRangeCache.java:62)\n\tat com.azure.cosmos.implementation.caches.RxPartitionKeyRangeCache.tryGetOverlappingRangesAsync(RxPartitionKeyRangeCache.java:112)\n\tat com.azure.cosmos.implementation.routing.RoutingMapProviderHelper.lambda$getOverlappingRanges$2(RoutingMapProviderHelper.java:125)\n\tat reactor.core.publisher.FluxDefer.subscribe(FluxDefer.java:46)\n\tat reactor.core.publisher.FluxRepeat$RepeatSubscriber.resubscribe(FluxRepeat.java:120)\n\tat reactor.core.publisher.FluxRepeat$RepeatSubscriber.onComplete(FluxRepeat.java:104)\n\tat reactor.core.publisher.FluxRepeat.subscribeOrReturn(FluxRepeat.java:55)\n\tat reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57)\n\tat reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)\n\tat reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)\n\tat reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onNext(FluxRetryWhen.java:174)\n\tat reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)\n\tat reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)\n\tat reactor.core.publisher.Operators$MonoInnerProducerBase.complete(Operators.java:2664)\n\tat reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:180)\n\tat reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onComplete(FluxMapFuseable.java:150)\n\tat reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1817)\n\tat reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249)\n\tat reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete(MonoIgnoreThen.java:284)\n\tat reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext(MonoIgnoreThen.java:187)\n\tat reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:232)\n\tat reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51)\n\tat reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)\n\tat reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)\n\tat reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete(MonoIgnoreThen.java:284)\n\tat reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext(MonoIgnoreThen.java:187)\n\tat reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)\n\tat reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onNext(FluxRetryWhen.java:174)\n\tat reactor.core.publisher.Operators$MonoInnerProducerBase.complete(Operators.java:2664)\n\tat reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:180)\n\tat reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2058)\n\tat reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onComplete(FluxMapFuseable.java:150)\n\tat reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1817)\n\tat reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249)\n\tat reactor.core.publisher.Operators$MonoInnerProducerBase.complete(Operators.java:2664)\n\tat reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:180)\n\tat reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)\n\tat reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:85)\n\tat reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260)\n\tat reactor.core.publisher.FluxHandle$HandleSubscriber.onComplete(FluxHandle.java:213)\n\tat reactor.core.publisher.FluxMap$MapConditionalSubscriber.onComplete(FluxMap.java:269)\n\tat reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onComplete(FluxDoFinally.java:145)\n\tat reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onComplete(FluxHandleFuseable.java:229)\n\tat reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onComplete(FluxContextWrite.java:126)\n\tat reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1817)\n\tat reactor.core.publisher.MonoCollectList$MonoCollectListSubscriber.onComplete(MonoCollectList.java:128)\n\tat reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260)\n\tat reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:142)\n\tat reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:400)\n\tat reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:419)\n\tat reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:473)\n\tat reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:684)\n\tat reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:93)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)\n\tat io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)\n\tat io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)\n\tat io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)\n\tat io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)\n\tat io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1373)\n\tat io.netty.handler.ssl.SslHandler.decodeNonJdkCompatible(SslHandler.java:1247)\n\tat io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1287)\n\tat io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:507)\n\tat io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:446)\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)\n\tat io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)\n\tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)\n\tat io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795)\n\tat io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480)\n\tat io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)\n\tat io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.lang.Thread.run(Thread.java:750)\n

    Dependency is:

    		<dependency>
               	<groupId>com.azure</groupId>
                <artifactId>azure-spring-data-cosmos</artifactId>
                <version>3.38.0</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-beans</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.projectreactor</groupId>
                <artifactId>reactor-core</artifactId>
                <version>${reactor-core.version}</version>
            </dependency>
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.