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

Unable to Upload npm package with long buildnumber

    Details

      Description

      After updating to 3.42.0 yesterday I had to roll back to 3.41.0 due to problems with uploading new npm artifacts because of changes in the handling of prerelease build numbers. This was not an issue on 3.41.0.

      We're using a timestamp as a buildnumber in our unstable artifacts, for example "1.3.0-SNAPSHOT.20220926175845174" which seems to be the cause of this issue.

      When I try to upload a artifact with the Version-Number 1.3.0-SNAPSHOT.20220926175845174 the artifact gets rejected because a NumberFormatException in Nexus (Full Stacktrace attached)

      According to the Regex mentioned on semver.org this version should be valid.

      https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string

      2022-09-26 19:58:45,892+0200 WARN  [qtp1430297586-609]  deployment com.sonatype.nexus.repository.npm.internal.NpmHandlers - Error: PUT /@example/example-js: Status{successful=false, code=400, message='null'} - For input string: "20220926175845174"
      java.lang.NumberFormatException: For input string: "20220926175845174"
              at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
              at java.lang.Integer.parseInt(Integer.java:583)
              at java.lang.Integer.valueOf(Integer.java:766)
              at com.sonatype.nexus.repository.npm.internal.NpmFormatAttributesExtractor.getSearchNormalizedVersion(NpmFormatAttributesExtractor.java:297)
              at com.sonatype.nexus.repository.npm.internal.NpmFormatAttributesExtractor.copyFormatAttributes(NpmFormatAttributesExtractor.java:112)
              at com.sonatype.nexus.repository.npm.internal.orient.NpmFacetImpl.maybeExtractFormatAttributes(NpmFacetImpl.java:188)
              at com.sonatype.nexus.repository.npm.internal.orient.NpmFacetImpl.putTarball(NpmFacetImpl.java:158)
              at com.sonatype.nexus.repository.npm.internal.orient.NpmFacetImpl.putTarball(NpmFacetImpl.java:132)
              at com.sonatype.nexus.repository.npm.internal.orient.OrientNpmHostedFacetImpl.putTarball(OrientNpmHostedFacetImpl.java:453)
              at com.sonatype.nexus.repository.npm.internal.orient.OrientNpmHostedFacetImpl.putPublishRequest(OrientNpmHostedFacetImpl.java:323)
              at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:58)
              at org.sonatype.nexus.transaction.TransactionInterceptor.proceedWithTransaction(TransactionInterceptor.java:66)
              at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
              at com.sonatype.nexus.repository.npm.internal.orient.OrientNpmHostedFacetImpl.putPackage(OrientNpmHostedFacetImpl.java:179)
              at com.sonatype.nexus.repository.npm.internal.NpmHandlers$3.handle(NpmHandlers.java:121)
              at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
              at org.sonatype.nexus.repository.storage.UnitOfWorkHandler.handle(UnitOfWorkHandler.java:39)
              at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
              at org.sonatype.nexus.repository.view.handlers.ContentHeadersHandler.handle(ContentHeadersHandler.java:46)
              at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
              at org.sonatype.nexus.repository.view.handlers.ConditionalRequestHandler.handle(ConditionalRequestHandler.java:67)
              at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
              at com.sonatype.nexus.clm.internal.orient.FirewallContributedHandler.handle(FirewallContributedHandler.java:105)
              at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
              at org.sonatype.nexus.repository.view.handlers.HandlerContributor.handle(HandlerContributor.java:67)
              at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
              at com.sonatype.nexus.repository.npm.internal.NpmHandlers$1.handle(NpmHandlers.java:53)
              at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
              at org.sonatype.nexus.repository.security.SecurityHandler.handle(SecurityHandler.java:51)
              at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
              at com.sonatype.analytics.internal.handler.AnalyticsMeteringHandler.handle(AnalyticsMeteringHandler.java:69)
              at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
              at org.sonatype.nexus.repository.view.handlers.TimingHandler.handle(TimingHandler.java:58)
              at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
              at org.sonatype.nexus.repository.view.Context.start(Context.java:179)
              at org.sonatype.nexus.repository.view.Router.dispatch(Router.java:65)
              at org.sonatype.nexus.repository.view.ConfigurableViewFacet.dispatch(ConfigurableViewFacet.java:52)
              at org.sonatype.nexus.repository.view.ConfigurableViewFacet.dispatch(ConfigurableViewFacet.java:43)
              at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.dispatchAndSend(ViewServlet.java:212)
              at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.doService(ViewServlet.java:174)
              at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.service(ViewServlet.java:126)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
              at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:290)

       

       

      Acceptance

      • You should be able to upload the package with the above name format without getting the above exception

       

        Attachments

          Activity

            People

            Assignee:
            orudyk Oleksii Rudyk
            Reporter:
            Schleuse René Schleusner
            Last Updated By:
            blast past blast past
            Team:
            NXRM - Sentinels
            Owner:
            Oleksii Rudyk Oleksii Rudyk
            Votes:
            8 Vote for this issue
            Watchers:
            16 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title