Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-28277

Fetching group npm package metadata concurrently can cause OConcurrentModificationException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.30.0, 3.31.0
    • Fix Version/s: 3.33.0
    • Component/s: NPM
    • Labels:
    • Sprint:
      NXRM Trinity Sprint 12

      Description

      Problem

      Under a high load of requests to an NPM Group repository for NPM package metadata, the following types of the problems may be noticed in the nexus.log

      2021-04-21 16:51:57,918+0000 INFO  [qtp1386560287-95] node *UNKNOWN org.sonatype.nexus.repository.npm.internal.orient.OrientNpmGroupDataFacet - Missing blob example@ECCD5192-0C832296-599116CF-97A001CF-285413DE:f02341cf-70db-4460-9c4d-923e9309d02a containing cached metadata example, deleting asset and triggering rebuild.
      

      These as well:

      2021-04-16 13:51:50,438+0000 WARN  [qtp1003325215-90363] node *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: GET /repository/example_npm_group/combined-stream
      com.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot UPDATE the record #61:7522609 because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v2 your=v1)
       DB name="component"
       at org.sonatype.nexus.orient.entity.ConflictHook.onUpdate(ConflictHook.java:154)
       at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.checkAndIncrementVersion(OAbstractPaginatedStorage.java:4545)
       at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.doUpdateRecord(OAbstractPaginatedStorage.java:4022)
       at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commitEntry(OAbstractPaginatedStorage.java:4607)
       at com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.commit(OAbstractPaginatedStorage.java:1857)
       at com.orientechnologies.orient.core.tx.OTransactionOptimistic.doCommit(OTransactionOptimistic.java:541)
       at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:99)
       at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2908)
       at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:2870)
       at org.sonatype.nexus.repository.storage.StorageTxImpl.commit(StorageTxImpl.java:195)
      

      The inbound requests that trigger this error may get a 500 response from NXRM and this will potentially fail NPM builds.

      Cause

      The npm group repo implementation was not using the same cooperation key for operations that manipulate the same package root metadata, Like "Build package root" and "Handle missing blob for package root". These processes must do the same operation - build metadata with the valid blob and therefore must use the same cooperation key.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mlukaretkyi Maksym Lukaretkyi
              Reporter:
              mlukaretkyi Maksym Lukaretkyi
              Last Updated By:
              Peter Lynch Peter Lynch
              Team:
              NXRM - Trinity
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title