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

NPM group REST API missing when using Postgres/H2 database

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.35.0, 3.36.0
    • Fix Version/s: None
    • Component/s: Datastore, NPM, REST
    • Environment:
      PostgreSQL/H2

      Description

      Nexus using Postgres and H2 database, is missing the following REST API is missing. This means that npm group cannot be created by REST API.

      service/rest/v1/repositories/npm/group

      Nexus using Orient the above API is present.

      Steps to reproduce:

      1) Start fresh install of Nexus using default Orient database.

      2) Go to Administration -> System -> API -> Repository Management and should see the following two REST API for npm group present:

      *GET ​/v1​/repositories​/npm​/group*
      *POST ​/v1​/repositories​/npm​/group*

      3) Stop Nexus.

      4) Configure Nexus to use H2 database

      https://help.sonatype.com/repomanager3/new-database-options/migrating-to-a-new-database#MigratingtoaNewDatabase-EnablingtheNewDatabaseArchitecture

      5) Start Nexus with H2 database

      6) Go to Administration -> System -> API -> Repository Management and should see the following two REST API for npm group missing:

      *GET ​/v1​/repositories​/npm​/group*
      *POST ​/v1​/repositories​/npm​/group*

      If you try to use that REST API, you get 404 response.
       

      curl -v -u admin:admin123 -X 'POST' \
       'http://localhost:8081/service/rest/v1/repositories/npm/group' \
        -H 'accept: application/json' \
        -H 'Content-Type: application/json' \
        -d @./test.json
      Note: Unnecessary use of -X or --request, POST is already inferred.
      *  Trying 127.0.0.1...
      * TCP_NODELAY set
      * Connected to localhost (127.0.0.1) port 8081 ([#0|https://sonatype.zendesk.com/agent/tickets/0])
      * Server auth using Basic with user 'admin'
      > POST /service/rest/v1/repositories/npm/group HTTP/1.1
      > Host: localhost:8081
      > Authorization: Basic YWRtaW46YWRtaW4xMjM=
      > User-Agent: curl/7.64.
      > accept: application/json
      > Content-Type: application/json
      > Content-Length: 228
      >
      * upload completely sent off: 228 out of 228 bytes
      < HTTP/1.1 404 Not Found
      

      nexus.log shows

      2021-10-27 13:37:14,362+0100 ERROR [qtp1883007075-642] *UNKNOWN com.sonatype.analytics.internal.filter.AnalyticsMeteringFilter - Error metering request RESTEASY003210: Could not find resource for full path: http://localhost:8081/service/rest/v1/repositories/npm/group
      
      2021-10-27 13:37:14,372+0100 WARN  [qtp1883007075-642] admin org.sonatype.nexus.siesta.internal.WebappExceptionMapper - (ID e6623466-c858-4f38-8228-86a2e50f258b) Response: [404] (no entity/body); mapped from: javax.ws.rs.NotFoundException: RESTEASY003210: Could not find resource for full path: http://localhost:8081/service/rest/v1/repositories/npm/group
      

      Expected Behaviour:
      The npm group REST API should be present on all Nexus database variants.

      All other API endpoints should also be checked to see if present in Nexus with H2/Postgres.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            msurani Mahendra Surani
            Last Updated By:
            Vijay Swaminathan Vijay Swaminathan
            Team:
            NXRM - Sentinels
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Date of First Response:

                tigCommentSecurity.panel-title