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

ArrayIndexOutOfBoundsException on PyPiIndexUtils.java if the URL ends with "/simple/"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.18.0, 3.29.1
    • Fix Version/s: None
    • Component/s: PyPI
    • Labels:
    • Notability:
      3

      Description

      SYMPTOM:

      If one of pypi proxy repositories in a group repo uses an incorrect remote URL, then accessing /repisotry/pypi-group/simple/ generates "java.lang.ArrayIndexOutOfBoundsException: 1".

      2020-12-31 06:19:07,742+0000 WARN  [qtp2104572464-2744] node-nxrm-ha1.standalone.localdomain hosako org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: GET /repository/pypi-group/simple/
      java.lang.ArrayIndexOutOfBoundsException: 1
              at org.sonatype.nexus.repository.pypi.internal.PyPiIndexUtils.maybeRewriteRootLink(PyPiIndexUtils.java:220)
              at org.sonatype.nexus.repository.pypi.internal.PyPiIndexUtils.makeLinksRelative(PyPiIndexUtils.java:153)
              at org.sonatype.nexus.repository.pypi.internal.PyPiIndexUtils.makeRootIndexLinksRelative(PyPiIndexUtils.java:213)
              at org.sonatype.nexus.repository.pypi.internal.PyPiIndexUtils.makeRootIndexRelative(PyPiIndexUtils.java:206)
              at org.sonatype.nexus.repository.pypi.orient.internal.OrientPyPiProxyFacetImpl.putRootIndex(OrientPyPiProxyFacetImpl.java:351)
              at org.sonatype.nexus.repository.pypi.orient.internal.OrientPyPiProxyFacetImpl.store(OrientPyPiProxyFacetImpl.java:156)
              at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.doGet(ProxyFacetSupport.java:277)
              at org.sonatype.nexus.repository.proxy.ProxyFacetSupport.lambda$1(ProxyFacetSupport.java:251)
      

      REPRODUCE STEPS:

      1. Create a pypi-proxy repo which uses a wrong remote URL. eg: https://pypi.python.org/pypi (adding "/pypi")
      2. Add this pypi-proxy repo into a pypi-group repo.
      3. Access "http://NEXUS_HOST:8081/repository/pypi-group/simple/"

      EXPECTED BEHAVIOUR:

      maybeRewriteRootLink() should check the count of 'split'.
      Nexus.log (and UI) should show more user understandable message.

      ACTUAL BEHAVIOUR:

      Only "Failure servicing: ..." message and the exception is logged, so that it does not indicate this error was caused by some remote URL.
      Also, it is a bit hard to find which pypi proxy in the group repo is causing this issue.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            hosako Hajime Osako
            Last Updated By:
            Nicholas Blair Nicholas Blair
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                tigCommentSecurity.panel-title