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

Metadata request returns HTTP 400 "No mapping for" response

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.14.20, 2.14.21, 2.15.0, 2.15.1
    • Fix Version/s: None
    • Component/s: NPM
    • Labels:
    • Notability:
      3

      Description

      Requesting https://registry.npmjs.org/openshift-rest-client directly via a proxy repo to https://registry.npmjs.org returns a 400 response with "No mapping for 'dist'"

      Setting TRACE logging on org.sonatype.nexus.content.internal.ContentServlet returns metadata validation errors:

      2022-05-31 16:48:56,668+0100 TRACE [qtp1493631574-104] admin org.sonatype.nexus.content.internal.ContentServlet - Exception
      java.lang.IllegalArgumentException: No mapping for 'dist' at com.google.common.base.Preconditions.checkArgument(Preconditions.java:125) at com.bolyuba.nexus.plugin.npm.service.PackageVersion.validate(PackageVersion.java:123) at com.bolyuba.nexus.plugin.npm.service.NpmJson.setRaw(NpmJson.java:45) at com.bolyuba.nexus.plugin.npm.service.PackageVersion.setRaw(PackageVersion.java:24) at com.bolyuba.nexus.plugin.npm.service.NpmJson.<init>(NpmJson.java:33) at com.bolyuba.nexus.plugin.npm.service.PackageVersion.<init>(PackageVersion.java:43) at com.bolyuba.nexus.plugin.npm.service.PackageRoot.wrapVersions(PackageRoot.java:208) at com.bolyuba.nexus.plugin.npm.service.PackageRoot.<init>(PackageRoot.java:44) at com.bolyuba.nexus.plugin.npm.service.internal.MetadataParser.parsePackageRoot(MetadataParser.java:195) at com.bolyuba.nexus.plugin.npm.service.internal.MetadataParser.parsePackageRoot(MetadataParser.java:127) at com.bolyuba.nexus.plugin.npm.service.internal.proxy.HttpProxyMetadataTransport.fetchPackageRoot(HttpProxyMetadataTransport.java:218) at com.bolyuba.nexus.plugin.npm.service.internal.ProxyMetadataServiceImpl.mayUpdatePackageRoot(ProxyMetadataServiceImpl.java:247) at com.bolyuba.nexus.plugin.npm.service.internal.ProxyMetadataServiceImpl.doGeneratePackageRoot(ProxyMetadataServiceImpl.java:207) at com.bolyuba.nexus.plugin.npm.service.internal.GeneratorSupport.generatePackageRoot(GeneratorSupport.java:113) at com.bolyuba.nexus.plugin.npm.service.internal.GeneratorSupport.producePackageRoot(GeneratorSupport.java:82) at com.bolyuba.nexus.plugin.npm.proxy.DefaultNpmProxyRepository.doRetrieveLocalItem(DefaultNpmProxyRepository.java:198) at org.sonatype.nexus.proxy.repository.AbstractRepository.doRetrieveItem(AbstractRepository.java:1248) at org.sonatype.nexus.proxy.repository.AbstractProxyRepository.doRetrieveItem(AbstractProxyRepository.java:996) at org.sonatype.nexus.proxy.repository.AbstractRepository.retrieveItem(AbstractRepository.java:760) at org.sonatype.nexus.proxy.repository.AbstractRepository.retrieveItem(AbstractRepository.java:592) at org.sonatype.nexus.proxy.router.DefaultRepositoryRouter.retrieveItem(DefaultRepositoryRouter.java:155) at org.sonatype.nexus.content.internal.ContentServlet.doGet(ContentServlet.java:386) at org.sonatype.nexus.content.internal.ContentServlet.service(ContentServlet.java:352) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
      

       And requesting the same metadata via a proxy to Repo 3 i.e. Repo 2 Proxy ---> Repo 3 Proxy ---> registry.npmjs.org, returns a 400 with  "No mapping for 'name'":

      2022-05-31 14:53:41,450+0100 TRACE [qtp1493631574-85] admin org.sonatype.nexus.content.internal.ContentServlet - Exception
      java.lang.IllegalArgumentException: No mapping for 'name'
       at com.google.common.base.Preconditions.checkArgument(Preconditions.java:125)
       at com.bolyuba.nexus.plugin.npm.service.PackageRoot.validate(PackageRoot.java:190)
       at com.bolyuba.nexus.plugin.npm.service.NpmJson.setRaw(NpmJson.java:45)
       at com.bolyuba.nexus.plugin.npm.service.PackageRoot.setRaw(PackageRoot.java:25)
       at com.bolyuba.nexus.plugin.npm.service.NpmJson.<init>(NpmJson.java:33)
       at com.bolyuba.nexus.plugin.npm.service.PackageRoot.<init>(PackageRoot.java:41)
       at com.bolyuba.nexus.plugin.npm.service.internal.MetadataParser.parsePackageRoot(MetadataParser.java:195)
       at com.bolyuba.nexus.plugin.npm.service.internal.MetadataParser.parsePackageRoot(MetadataParser.java:127)
       at com.bolyuba.nexus.plugin.npm.service.internal.proxy.HttpProxyMetadataTransport.fetchPackageRoot(HttpProxyMetadataTransport.java:218)
       at com.bolyuba.nexus.plugin.npm.service.internal.ProxyMetadataServiceImpl.mayUpdatePackageRoot(ProxyMetadataServiceImpl.java:247)
       at com.bolyuba.nexus.plugin.npm.service.internal.ProxyMetadataServiceImpl.doGeneratePackageRoot(ProxyMetadataServiceImpl.java:207)
       at com.bolyuba.nexus.plugin.npm.service.internal.GeneratorSupport.generatePackageRoot(GeneratorSupport.java:113)
       at com.bolyuba.nexus.plugin.npm.service.internal.GeneratorSupport.producePackageRoot(GeneratorSupport.java:82)
       at com.bolyuba.nexus.plugin.npm.proxy.DefaultNpmProxyRepository.doRetrieveLocalItem(DefaultNpmProxyRepository.java:198)
       at org.sonatype.nexus.proxy.repository.AbstractRepository.doRetrieveItem(AbstractRepository.java:1248)
       at org.sonatype.nexus.proxy.repository.AbstractProxyRepository.doRetrieveItem(AbstractProxyRepository.java:996)
       at org.sonatype.nexus.proxy.repository.AbstractRepository.retrieveItem(AbstractRepository.java:760)
       at org.sonatype.nexus.proxy.repository.AbstractRepository.retrieveItem(AbstractRepository.java:592)
       at org.sonatype.nexus.proxy.router.DefaultRepositoryRouter.retrieveItem(DefaultRepositoryRouter.java:155)
       at org.sonatype.nexus.content.internal.ContentServlet.doGet(ContentServlet.java:386)
       at org.sonatype.nexus.content.internal.ContentServlet.service(ContentServlet.java:352)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

      These fields are present in the source metadata. Also requesting the same metadata via Repo 3 does not result in similar validation errors.

      Expected
      Repo 2 is able to successfully validate and serve this metadata.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            hardeepn Hardeep Nagra
            Last Updated By:
            Hardeep Nagra Hardeep Nagra
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                tigCommentSecurity.panel-title