Uploaded image for project: 'mod-oai-pmh'
  1. mod-oai-pmh
  2. MODOAIPMH-231

NPE on ListRecords with metdataPrefix=marc21_withholdings

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • P2
    • Resolution: Done
    • None
    • 3.1.2
    • None
    • Gulfstream Sprint 97, Concorde - Sprint 98
    • 1
    • Concorde
    • Q2 2020 Hot Fix #3
    • 5 Colleges

    Description

      Overview:
      Fivecolleges reported an issue trying to harvest oai-pmh records. Request times out with a 504 in their environment. They are running mod-oai-pmh 3.0.4

      Steps to Reproduce:
      Request to

      https://edge-fivecolleges-sandbox.folio.ebsco.com/oai/{apiKey}?verb=ListRecords&metadataPrefix=marc21_withholdings&from=2020-06-23T18:16:52Z&until=2020-06-23T18:16:52Z
      

      results in a 504.

      Additional Information:
      1. Seems related to https://issues.folio.org/browse/MODOAIPMH-226
      2. On checking logs, source-record-storage makes calls to inventory-storage to get item info - specially item call number and effective location id
      3. Saw the below NPE in logs

      2020-09-16T20:29:45,918 INFO [vert.x-worker-thread-5 ] MarcWithHoldingsRequestHelper Request to SRS: {0}
      2020-09-16T20:29:46,116 ERROR [vert.x-eventloop-thread-0] MarcWithHoldingsRequestHelper null
      java.lang.NullPointerException: null
      at org.folio.oaipmh.helpers.records.RecordMetadataManager.lambda$addSubFieldGroup$6(RecordMetadataManager.java:220) ~[ms.jar:?]
      at java.util.Arrays$ArrayList.forEach(Arrays.java:3880) ~[?:1.8.0_242]
      at org.folio.oaipmh.helpers.records.RecordMetadataManager.addSubFieldGroup(RecordMetadataManager.java:218) ~[ms.jar:?]
      at org.folio.oaipmh.helpers.records.RecordMetadataManager.constructEffectiveLocationSubFieldsMap(RecordMetadataManager.java:206) ~[ms.jar:?]
      at org.folio.oaipmh.helpers.records.RecordMetadataManager.updateFieldsWithItemEffectiveLocationField(RecordMetadataManager.java:141) ~[ms.jar:?]
      at org.folio.oaipmh.helpers.records.RecordMetadataManager.lambda$populateMetadataWithItemsData$2(RecordMetadataManager.java:123) ~[ms.jar:?]
      at java.lang.Iterable.forEach(Iterable.java:75) ~[?:1.8.0_242]
      at org.folio.oaipmh.helpers.records.RecordMetadataManager.populateMetadataWithItemsData(RecordMetadataManager.java:122) ~[ms.jar:?]
      at org.folio.oaipmh.processors.MarcWithHoldingsRequestHelper.buildRecordsList(MarcWithHoldingsRequestHelper.java:228) ~[ms.jar:?]
      at org.folio.oaipmh.processors.MarcWithHoldingsRequestHelper.buildRecordsResponse(MarcWithHoldingsRequestHelper.java:180) ~[ms.jar:?]
      at org.folio.oaipmh.processors.MarcWithHoldingsRequestHelper.lambda$null$1(MarcWithHoldingsRequestHelper.java:139) ~[ms.jar:?]
      at io.vertx.core.Future.lambda$onSuccess$0(Future.java:146) ~[ms.jar:?]
      at io.vertx.core.impl.FutureImpl.dispatch(FutureImpl.java:102) ~[ms.jar:?]
      at io.vertx.core.impl.FutureImpl.tryComplete(FutureImpl.java:150) ~[ms.jar:?]
      at io.vertx.core.impl.FutureImpl.complete(FutureImpl.java:111) ~[ms.jar:?]
      at org.folio.oaipmh.processors.MarcWithHoldingsRequestHelper.lambda$null$10(MarcWithHoldingsRequestHelper.java:356) ~[ms.jar:?]
      at io.vertx.core.http.impl.HttpClientResponseImpl$BodyHandler.notifyHandler(HttpClientResponseImpl.java:292) ~[ms.jar:?]
      at io.vertx.core.http.impl.HttpClientResponseImpl.lambda$bodyHandler$0(HttpClientResponseImpl.java:193) ~[ms.jar:?]
      at io.vertx.core.http.impl.HttpClientResponseImpl.handleEnd(HttpClientResponseImpl.java:248) ~[ms.jar:?]
      
      

      4. Looks like https://github.com/folio-org/mod-oai-pmh/blob/v3.0.4/src/main/java/org/folio/oaipmh/helpers/records/RecordMetadataManager.java#L206 - code is not catching or checking for NPE
      5. In this particular case, there are thousands of items that do not have a callNumber - effective location and callNumber are not required fields per https://github.com/folio-org/mod-inventory-storage/blob/master/ramls/item.json and https://github.com/folio-org/mod-inventory/blob/master/ramls/item.json
      Interested parties:
      Anya N. Arnold

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                TotoroDev Illia Daliek
                sduvvuri Sobha Duvvuri
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases