Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-1894

Unexpected status code while removing path via sub-document API

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • None
    • 1

    Description

      I have the following document stored in my collection named `user_profile`:

      {
        "nZ46sulX": {
          "v": "D8tQkYxsoA95HhJ6hPKnFA==",
          "m": "AA0xNjM4MzU2MDcyMzg0"
        },
        "mi8wR+wG": {
          "v": "D8tQkYxsoA95HhJ6hPKnFA==",
          "m": "AA0xNjM4MzU2MDcyMzg0"
        }
      }

      I'm trying to remove document path "mi8wR+wG" using the sub-document API via Spring Data `ReactiveCouchbaseTemplate`:

          List<MutateInSpec> mutations = List.of(MutateInSpec.remove("mi8wR+wG"), MutateInSpec.upsert("nZ46sulX", Map.of("v", "D8tQkYxsoA95HhJ6hPKnFA==",                                                                  "m", "AA0xNjM4MzU2MDcyMzg0")));
       
      template.getCollection(collection).reactive()
                  .mutateIn("rAOQ2uW4rSqB2QXED8TdXA", mutations, MutateInOptions.mutateInOptions()
                      .durability(durability)
                      .storeSemantics(StoreSemantics.UPSERT))
      

      When `StoreSemantics.UPSERT ` is used the following exception is thrown:

      com.couchbase.client.core.error.CouchbaseException: SubdocMutateRequest failed with unexpected status code INVALID_REQUEST {"completed":true,"coreId":"0x8e6022fb00000001","idempotent":false,"lastChannelId":"8E6022FB00000001/00000000E0CC9A73","lastDispatchedFrom":"127.0.0.1:35904","lastDispatchedTo":"127.0.0.1:11210","requestId":122,"requestType":"SubdocMutateRequest","retried":2,"retryReasons":["COLLECTION_MAP_REFRESH_IN_PROGRESS"],"service":{"bucket":"profiling","collection":"user_profile","documentId":"rAOQ2uW4rSqB2QXED8TdXA","opaque":"0x84","scope":"_default","type":"kv"},"status":"INVALID_REQUEST","timeoutMs":2500,"timings":{"dispatchMicros":138151,"encodingMicros":2197,"totalDispatchMicros":138151,"totalMicros":205171}}
      2021-12-01 12:45:26,304 ERROR cb-io-kv-5-2 c.u.p.p.s.ProfileFacadeService - Error occurred while submitting context: cntx1, ctxId: a1308e6a-c7e2-4687-8aa8-2b8ceb3b5d35
      com.couchbase.client.core.error.CouchbaseException: SubdocMutateRequest failed with unexpected status code INVALID_REQUEST
      	at com.couchbase.client.core.error.DefaultErrorUtil.keyValueStatusToException(DefaultErrorUtil.java:56)
      	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
      Error has been observed at the following site(s):
      	*____________________ ⇢ at com.couchbase.client.core.Reactor$MyLittleAssemblyFactory.callOnAssembly(Reactor.java:202)
      	|_     Mono.doFinally ⇢ at com.couchbase.client.core.Reactor.wrap(Reactor.java:63)
      	|_ Mono.onErrorResume ⇢ at com.couchbase.client.core.Reactor.wrap(Reactor.java:69)
      	|_                    ⇢ at com.couchbase.client.java.ReactiveCollection.lambda$mutateIn$21(ReactiveCollection.java:646)
      	*__________Mono.error ⇢ at com.couchbase.client.core.Reactor.lambda$wrap$1(Reactor.java:73)
      	*________Mono.flatMap ⇢ at com.couchbase.client.java.ReactiveCollection.lambda$mutateIn$22(ReactiveCollection.java:646)
      	*__________Mono.defer ⇢ at com.couchbase.client.java.ReactiveCollection.mutateIn(ReactiveCollection.java:640)
      	*________Flux.flatMap ⇢ at com.upstreamsystems.profiling.profiles.service.couchbase.CouchbaseAdapter.upsertDocument(CouchbaseAdapter.java:51)
      	|_     Flux.doOnError ⇢ at com.upstreamsystems.profiling.profiles.service.couchbase.CouchbaseAdapter.upsertDocument(CouchbaseAdapter.java:58)
      	|_          Flux.then ⇢ at com.upstreamsystems.profiling.profiles.service.couchbase.CouchbaseAdapter.upsertDocument(CouchbaseAdapter.java:59)
      	|_                    ⇢ at com.upstreamsystems.profiling.profiles.service.couchbase.ProfileCouchbaseService.upsertUserProfile(ProfileCouchbaseService.java:35)
      	|_                    ⇢ at com.upstreamsystems.profiling.profiles.service.ProfileFacadeService.updateProfile(ProfileFacadeService.java:449)
      	*_____Mono.thenReturn ⇢ at com.upstreamsystems.profiling.profiles.service.ProfileFacadeService.lambda$submitProfileContext$18(ProfileFacadeService.java:242)
      	*________Mono.flatMap ⇢ at com.upstreamsystems.profiling.profiles.service.ProfileFacadeService.submitProfileContext(ProfileFacadeService.java:242)
      	|_       Mono.flatMap ⇢ at com.upstreamsystems.profiling.profiles.service.ProfileFacadeService.submitProfileContext(ProfileFacadeService.java:244)
      	*_____Mono.thenReturn ⇢ at com.upstreamsystems.profiling.profiles.service.ProfileFacadeService.submitProfileContext(ProfileFacadeService.java:245)
      Original Stack Trace:
      		at com.couchbase.client.core.error.DefaultErrorUtil.keyValueStatusToException(DefaultErrorUtil.java:56)
      		at com.couchbase.client.java.kv.MutateInAccessor.lambda$mutateIn$0(MutateInAccessor.java:50)
      		at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
      		at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
      		at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2143)
      		at com.couchbase.client.core.msg.BaseRequest.succeed(BaseRequest.java:149)
      		at com.couchbase.client.core.io.netty.kv.KeyValueMessageHandler.decodeAndComplete(KeyValueMessageHandler.java:372)
      		at com.couchbase.client.core.io.netty.kv.KeyValueMessageHandler.decode(KeyValueMessageHandler.java:351)
      		at com.couchbase.client.core.io.netty.kv.KeyValueMessageHandler.channelRead(KeyValueMessageHandler.java:276)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
      		at com.couchbase.client.core.io.netty.kv.MemcacheProtocolVerificationHandler.channelRead(MemcacheProtocolVerificationHandler.java:85)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
      		at com.couchbase.client.core.deps.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
      		at com.couchbase.client.core.deps.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
      		at com.couchbase.client.core.deps.io.netty.handler.flush.FlushConsolidationHandler.channelRead(FlushConsolidationHandler.java:152)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
      		at com.couchbase.client.core.deps.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
      		at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
      		at com.couchbase.client.core.deps.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
      		at com.couchbase.client.core.deps.io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795)
      		at com.couchbase.client.core.deps.io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480)
      		at com.couchbase.client.core.deps.io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
      		at com.couchbase.client.core.deps.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
      		at com.couchbase.client.core.deps.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
      		at com.couchbase.client.core.deps.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      		at java.base/java.lang.Thread.run(Thread.java:831)
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            david.nault David Nault
            lefteris Lefteris Katiforis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty