Uploaded image for project: 'mod-orders'
  1. mod-orders
  2. MODORDERS-209

Order placement hangs if create_inventory is not set.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • P2
    • Resolution: Done
    • 4.0.0
    • 5.0.0
    • folio-testing, folio-snapshot

    • ACQ Sprint 61
    • 2
    • Thunderjet

    Description

      Overview:
      Order creation hangs if poLine.physical.createInventory/poLine.eresource.createInventory are not specified in the order and the tenant-specific settings aren't present. This happens even when the order submitted is in Pending status.

      For example, the following will hang:

      $ curl "$OKAPI:9130/orders/composite-orders" -XPOST -w '\n' -H "X-Okapi-Token: $TOKEN" -H "Content-Type: application/json" --data-binary '{
      >   "approved" : true,
      >   "manualPo" : false,
      >   "notes" : [ "CMCNALLY Test" ],
      >   "poNumber" : "CAM003",
      >   "totalEstimatedPrice" : 0.0,
      >   "totalItems" : 1,
      >   "workflowStatus" : "Pending",
      >   "compositePoLines" : [ {
      >     "checkinItems" : false,
      >     "acquisitionMethod" : "Purchase At Vendor System",
      >     "alerts" : [ ],
      >     "claims" : [ {
      >       "claimed" : true
      >     } ],
      >     "collection" : false,
      >     "contributors" : [ {
      >       "contributor" : "Alfred Bester"
      >     } ],
      >     "cost" : {
      >       "listUnitPrice" : 0.0,
      >       "currency" : "USD",
      >       "discountType" : "percentage",
      >       "quantityPhysical" : 1,
      >       "poLineEstimatedPrice" : 0.0
      >     },
      >     "details" : {
      >       "receivingNote" : "Notify requester",
      >       "productIds" : [ ],
      >       "materialTypes" : [ "1a54b431-2e4f-452d-9cae-9cee66c9a892" ]
      >     },
      >     "fundDistribution" : [ {
      >       "code" : "17f589cc-b7be-48f8-851e-93911cbc29a3",
      >       "percentage" : 100.0
      >     } ],
      >     "locations" : [ {
      >       "locationId" : "f34d27c6-a8eb-461b-acd6-5dea81771e70",
      >       "quantity" : 1,
      >       "quantityPhysical" : 1
      >     } ],
      >     "orderFormat" : "Physical Resource",
      >     "owner" : "8910",
      >     "paymentStatus" : "Awaiting Payment",
      >     "physical" : {
      >       "volumes" : [ ]
      >     },
      >     "publicationDate" : "1974",
      >     "publisher" : "Penguin",
      >     "receiptStatus" : "Awaiting Receipt",
      >     "reportingCodes" : [ ],
      >     "requester" : "Ben Bishop",
      >     "source" : {
      >       "code" : "mod-gobi",
      >       "description" : "An order placed from GOBI Interface"
      >     },
      >     "tags" : [ ],
      >     "title" : "Tiger! Tiger!",
      >     "vendorDetail" : {
      >       "instructions" : "Unlisted Print Serial",
      >       "refNumber" : "99974828478",
      >       "refNumberType" : "Supplier'\''s unique order line reference number",
      >       "vendorAccount" : "891080"
      >     }
      >   } ]
      > }'
      

      And this error appears in the log:

      17:48:56.102 [vert.x-eventloop-thread-0] ERROR org.folio.rest.RestVerticle - Cannot construct instance of `org.folio.rest.jaxrs.model.Physical$CreateInventory`, problem: Instance,Holding
       at [Source: (String)"{
          "approved": true,
          "dateOrdered": "2018-09-05T15:38:55.000+0000",
          "manualPo": false,
          "notes": [],
          "orderType": "One-Time",
          "totalItems": 2,
          "workflowStatus": "Open",
          "compositePoLines": [
              {
                  "acquisitionMethod": "Purchase At Vendor System",
                  "alerts": [],
                  "claims": [
                      {
                          "claimed": true
                      }
                  ],
                  "collection": false,
                  "contributors": [
             "[truncated 2067 chars]; line: 59, column: 33] (through reference chain: org.folio.rest.jaxrs.model.CompositePurchaseOrder["compositePoLines"]->java.util.ArrayList[0]->org.folio.rest.jaxrs.model.CompositePoLine["physical"]->org.folio.rest.jaxrs.model.Physical["createInventory"])
      com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `org.folio.rest.jaxrs.model.Physical$CreateInventory`, problem: Instance,Holding
       at [Source: (String)"{
          "approved": true,
          "dateOrdered": "2018-09-05T15:38:55.000+0000",
          "manualPo": false,
          "notes": [],
          "orderType": "One-Time",
          "totalItems": 2,
          "workflowStatus": "Open",
          "compositePoLines": [
              {
                  "acquisitionMethod": "Purchase At Vendor System",
                  "alerts": [],
                  "claims": [
                      {
                          "claimed": true
                      }
                  ],
                  "collection": false,
                  "contributors": [
             "[truncated 2067 chars]; line: 59, column: 33] (through reference chain: org.folio.rest.jaxrs.model.CompositePurchaseOrder["compositePoLines"]->java.util.ArrayList[0]->org.folio.rest.jaxrs.model.CompositePoLine["physical"]->org.folio.rest.jaxrs.model.Physical["createInventory"])
      	at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.DeserializationContext.instantiationException(DeserializationContext.java:1601) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.DeserializationContext.handleInstantiationProblem(DeserializationContext.java:1072) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.std.FactoryBasedEnumDeserializer.deserialize(FactoryBasedEnumDeserializer.java:142) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:287) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:287) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:285) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:244) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:287) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4001) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2992) ~[mod-orders-fat.jar:?]
      	at org.folio.rest.RestVerticle.lambda$11(RestVerticle.java:1265) ~[mod-orders-fat.jar:?]
      	at java.util.Iterator.forEachRemaining(Iterator.java:116) ~[?:1.8.0_181]
      	at org.folio.rest.RestVerticle.parseParams(RestVerticle.java:1232) ~[mod-orders-fat.jar:?]
      	at org.folio.rest.RestVerticle.route(RestVerticle.java:432) ~[mod-orders-fat.jar:?]
      	at org.folio.rest.RestVerticle.lambda$12(RestVerticle.java:257) ~[mod-orders-fat.jar:?]
      	at io.vertx.ext.web.impl.RouteImpl.handleContext(RouteImpl.java:225) ~[mod-orders-fat.jar:?]
      	at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:120) ~[mod-orders-fat.jar:?]
      	at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:133) ~[mod-orders-fat.jar:?]
      	at io.vertx.ext.web.handler.impl.BodyHandlerImpl$BHandler.doEnd(BodyHandlerImpl.java:231) ~[mod-orders-fat.jar:?]
      	at io.vertx.ext.web.handler.impl.BodyHandlerImpl$BHandler.end(BodyHandlerImpl.java:211) ~[mod-orders-fat.jar:?]
      	at io.vertx.ext.web.handler.impl.BodyHandlerImpl.lambda$handle$0(BodyHandlerImpl.java:74) ~[mod-orders-fat.jar:?]
      	at io.vertx.core.http.impl.HttpServerRequestImpl.handleEnd(HttpServerRequestImpl.java:417) ~[mod-orders-fat.jar:?]
      	at io.vertx.core.http.impl.Http1xServerConnection.handleEnd(Http1xServerConnection.java:482) ~[mod-orders-fat.jar:?]
      	at io.vertx.core.http.impl.Http1xServerConnection.processMessage(Http1xServerConnection.java:456) ~[mod-orders-fat.jar:?]
      	at io.vertx.core.http.impl.Http1xServerConnection.handleMessage(Http1xServerConnection.java:144) ~[mod-orders-fat.jar:?]
      	at io.vertx.core.http.impl.HttpServerImpl$ServerHandlerWithWebSockets.handleMessage(HttpServerImpl.java:728) ~[mod-orders-fat.jar:?]
      	at io.vertx.core.http.impl.HttpServerImpl$ServerHandlerWithWebSockets.handleMessage(HttpServerImpl.java:619) ~[mod-orders-fat.jar:?]
      	at io.vertx.core.net.impl.VertxHandler.lambda$channelRead$1(VertxHandler.java:146) ~[mod-orders-fat.jar:?]
      	at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:337) ~[mod-orders-fat.jar:?]
      	at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:195) [mod-orders-fat.jar:?]
      	at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:144) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mod-orders-fat.jar:?]
      	at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mod-orders-fat.jar:?]
      	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [mod-orders-fat.jar:?]
      	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mod-orders-fat.jar:?]
      	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [mod-orders-fat.jar:?]
      	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [mod-orders-fat.jar:?]
      	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [mod-orders-fat.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [mod-orders-fat.jar:?]
      	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) [mod-orders-fat.jar:?]
      	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:141) [mod-orders-fat.jar:?]
      	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) [mod-orders-fat.jar:?]
      	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) [mod-orders-fat.jar:?]
      	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) [mod-orders-fat.jar:?]
      	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) [mod-orders-fat.jar:?]
      	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) [mod-orders-fat.jar:?]
      	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [mod-orders-fat.jar:?]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
      Caused by: java.lang.IllegalArgumentException: Instance,Holding
      	at org.folio.rest.jaxrs.model.Physical$CreateInventory.fromValue(Physical.java:224) ~[mod-orders-fat.jar:?]
      	at sun.reflect.GeneratedMethodAccessor233.invoke(Unknown Source) ~[?:?]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
      	at com.fasterxml.jackson.databind.introspect.AnnotatedMethod.callOnWith(AnnotatedMethod.java:122) ~[mod-orders-fat.jar:?]
      	at com.fasterxml.jackson.databind.deser.std.FactoryBasedEnumDeserializer.deserialize(FactoryBasedEnumDeserializer.java:134) ~[mod-orders-fat.jar:?]
      	... 64 more
      

      Expected Behavior:

      • The system default for createInventory will be used

      Actual Behavior:

      • The request hangs

      Acceptance Criteria:

      • The behavior is fixed to match the expected behavior above
      • Unit and API tests have been updated to exercise this scenario

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                cmcnally Craig McNally
                cmcnally Craig McNally
                Craig McNally Craig McNally
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases