Details
Description
If you have an npm proxy repository against a remote that is not an npm registry you'll get an NPE. This causes a 500 response from Nexus Repo, breaking builds. This is a regression from 3.29.2.
Can be reproduced with the remote https://maven.google.com
Request for example
http://localhost:8081/repository/npmp1/web-animations-js
Expected: Log an error, and skip processing of the proxy in the group. Continue to process the rest of the group members and return a valid result.
Expected: After some discussion we decided it would be safer just to fix this NPE. We may file another issue to reconsider how group processing should behave in the event of an unexpected exception.
2021-04-05 16:09:23,905-0400 WARN [qtp28609910-16739] *UNKNOWN org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: GET /nexus/repository/ae-npm-group/web-animations-js
java.lang.NullPointerException: null
at org.sonatype.nexus.repository.npm.internal.httpclient.NpmRedirectStrategy.getRedirect(NpmRedirectStrategy.java:52)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:126)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.sonatype.nexus.repository.httpclient.FilteredHttpClientSupport.lambda$0(FilteredHttpClientSupport.java:56)
at org.sonatype.nexus.repository.httpclient.internal.BlockingHttpClient.filter(BlockingHttpClient.java:124)
at org.sonatype.nexus.repository.httpclient.FilteredHttpClientSupport.doExecute(FilteredHttpClientSupport.java:56)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.execute(ProxyFacetSupport.java:529)
at org.sonatype.nexus.repository.npm.internal.orient.OrientNpmProxyFacet.execute(OrientNpmProxyFacet.java:125)
at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.fetch(ProxyFacetSupport.java:446)
at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.fetch(ProxyFacetSupport.java:416)
at org.sonatype.nexus.repository.npm.internal.orient.OrientNpmProxyFacet.fetch(OrientNpmProxyFacet.java:106)
at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.doGet(ProxyFacetSupport.java:283)
at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.lambda$1(ProxyFacetSupport.java:259)
at org.sonatype.nexus.common.io.CooperatingFuture.performCall(CooperatingFuture.java:122)
at org.sonatype.nexus.common.io.CooperatingFuture.call(CooperatingFuture.java:64)
at org.sonatype.nexus.common.io.ScopedCooperationFactorySupport$ScopedCooperation.cooperate(ScopedCooperationFactorySupport.java:99)
at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.get(ProxyFacetSupport.java:250)
at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.get(ProxyFacetSupport.java:239)
at org.sonatype.nexus.repository.proxy.ProxyHandler.handle(ProxyHandler.java:52)
at org.sonatype.nexus.repository.view.Context.proceed(Context.java:88)
at org.sonatype.nexus.repository.storage.LastDownloadedHandler.handle(LastDownloadedHandler.java:59)
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)--