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

npm proxy attempts network access when in blocked state, results in 500 response

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.11.2
    • Fix Version/s: 2.11.3
    • Component/s: NPM
    • Labels:
      None
    • Sprint:
      Sprint 39

      Description

      As reported by an end user, if you have an npm proxy repository which is temporarily failing due to UnknownHostException this causes a 500 response to be returned from Nexus.

      This is true even if the repository is in automatic or manual block mode. The DNS lookup is still attempted. If the proxy having the problem is in an npm group repository this problem causes all queries to the group to fail with 500 error.

      Nexus should not be attempting any network access to the remote if it is in blocked mode.

      I've attached a work directory which can be used to simulate this problem. It has an npm group repository which contains a proxy to the npmjs registry. I first made a request for "/-/all" to the npm proxy to populate the metadata, then changed the remote to http://registrie.npmjs.org to cause a DNS lookup failure. If you load this configuration you'll see the DNS lookup is done even when the repository is in blocked mode.

      Caused by: java.net.UnknownHostException: registrie.npmjs.org: unknown error
      at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) ~[na:1.8.0_40]
      at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:907) ~[na:1.8.0_40]
      at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1302) ~[na:1.8.0_40]
      at java.net.InetAddress.getAllByName0(InetAddress.java:1255) ~[na:1.8.0_40]
      at java.net.InetAddress.getAllByName(InetAddress.java:1171) ~[na:1.8.0_40]
      at java.net.InetAddress.getAllByName(InetAddress.java:1105) ~[na:1.8.0_40]
      at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:44) ~[httpclient-4.3.6.jar:4.3.6]
      at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:102) ~[httpclient-4.3.6.jar:4.3.6]
      at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:319) ~[httpclient-4.3.6.jar:4.3.6]
      at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363) ~[httpclient-4.3.6.jar:4.3.6]
      at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219) ~[httpclient-4.3.6.jar:4.3.6]
      at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195) ~[httpclient-4.3.6.jar:4.3.6]
      at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86) ~[httpclient-4.3.6.jar:4.3.6]
      at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108) ~[httpclient-4.3.6.jar:4.3.6]
      at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) ~[httpclient-4.3.6.jar:4.3.6]
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) ~[httpclient-4.3.6.jar:4.3.6]
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57) ~[httpclient-4.3.6.jar:4.3.6]
      at com.bolyuba.nexus.plugin.npm.service.internal.proxy.HttpProxyMetadataTransport.fetchPackageRoot(HttpProxyMetadataTransport.java:137) ~[na:na]
      at com.bolyuba.nexus.plugin.npm.service.internal.ProxyMetadataServiceImpl.mayUpdatePackageRoot(ProxyMetadataServiceImpl.java:203) ~[na:na]
      at com.bolyuba.nexus.plugin.npm.service.internal.ProxyMetadataServiceImpl.doGeneratePackageRoot(ProxyMetadataServiceImpl.java:189) ~[na:na]
      at com.bolyuba.nexus.plugin.npm.service.internal.GeneratorSupport.generatePackageRoot(GeneratorSupport.java:108) ~[na:na]
      at com.bolyuba.nexus.plugin.npm.service.internal.GroupMetadataServiceImpl.doGeneratePackageRoot(GroupMetadataServiceImpl.java:68) ~[na:na]
      at com.bolyuba.nexus.plugin.npm.service.internal.GeneratorSupport.generatePackageRoot(GeneratorSupport.java:108) ~[na:na]
      at com.bolyuba.nexus.plugin.npm.service.internal.GeneratorSupport.producePackageRoot(GeneratorSupport.java:77) ~[na:na]
      at com.bolyuba.nexus.plugin.npm.group.DefaultNpmGroupRepository.doRetrieveLocalItem(DefaultNpmGroupRepository.java:134) ~[na:na]
      ... 98 common frames omitted

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jtom Joe Tom
              Reporter:
              rseddon Rich Seddon
              Last Updated By:
              Peter Lynch Peter Lynch
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title