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

PyPi hosted repository doesn't update index file after uploading new version of existing component

Details

    • 0
    • 2

    Description

      In the latest 3.15.2 version some changes were made to PyPiHostedFacetImpl to store the simple index html file in the blobstore instead of creating the file on the fly.

      This introduced a bug.  When uploading a new version of an existing component the deleteIndex function does not delete the file.  This causes the file to remain in the initial state when it was created and fetching the latest version of a component does not work correctly.

      3.15.2-01 Patch:

      A patch is attached to this issue which fixes this problem for 3.15.2-01.  Note that this patch is only applicable to that version, do not try to install it in any other version.

      To apply this patch, shut down Nexus, and replace the following jar file with the one attached on this issue which has the same file name.

      nexus-3.15.2-01/system/org/sonatype/nexus/plugins/nexus-repository-pypi/3.15.2-01/nexus-repository-pypi-3.15.2-01.jar

      3.16.0-01 Patch:

      A patch is attached to this issue which fixes this problem for 3.16.0-01.  Note that this patch is only applicable to that version, do not try to install it in any other version.

      To apply this patch, shut down Nexus, and replace the following jar file with the one attached on this issue which has the same file name.

      nexus-3.16.0-01/system/org/sonatype/nexus/plugins/nexus-repository-pypi/3.16.0-01/nexus-repository-pypi-3.16.0-01.jar

      3.16.1-02 Patch

      A patch is attached to this issue which fixes this problem for 3.16.1-02.  Note that this patch is only applicable to that version, do not try to install it in any other version.

      To apply this patch, shut down Nexus, and replace the following jar file with the one attached on this issue which has the same file name.

      nexus-3.16.1-02/system/org/sonatype/nexus/plugins/nexus-repository-pypi/3.16.1-02/nexus-repository-pypi-3.16.1-02.jar

      3.16.2-01 Patch

      A patch is attached to this issue which fixes this problem for 3.16.2-01.  Note that this patch is only applicable to that version, do not try to install it in any other version.

      To apply this patch, shut down Nexus, and replace the following jar file with the one attached on this issue which has the same file name.

      nexus-3.16.1-02/system/org/sonatype/nexus/plugins/nexus-repository-pypi/3.16.1-02/nexus-repository-pypi-3.16.1-02.jar

      Diagnosis

      We found that this was caused by characters in the package names that needed to be normalized (https://www.python.org/dev/peps/pep-0503/#normalized-names). The caching mechanism works be generating and saving the index when it is fetched and then deleting the index file whenever the contents of the repository change. In some cases the delete failed because it was looking for an index using a non-normalized name.

      Once this fix is released changes to the repository will correctly remove the index and the updated index will be available on the next fetch. After upgrade there may be a small number of cases where new packages (that contain . or _ characters in there name) have been uploaded and the index hasn't been invalidated, this will be obvious because the latest version of that package won't be available. Both uploading a new version of the package or deleting the index file in these cases will fix the problem.

      To delete an index use the browse function in the UI and find the corresponding index file under the /simple/ tree node and then delete the asset.

      Attachments

        Issue Links

          Activity

            People

              jstephens Joseph Stephens
              bartdevriendt Bart Devriendt
              Michael Oliverio Michael Oliverio
              NXRM - Cypher
              Votes:
              2 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                tigCommentSecurity.panel-title