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

Setting "NEXUS_SEARCH_INDEX_REBUILD_ON_STARTUP" environment variable does not rebuild indexes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.37.0, 3.37.3
    • Fix Version/s: 3.38.0
    • Component/s: Search
    • Story Points:
      2
    • Sprint:
      NXRM Sentinels Sprint 27
    • Notability:
      3
    • InvestmentLayer:
      support-escalated

      Description

      SYMPTOM:

      As per https://help.sonatype.com/repomanager3/planning-your-implementation/resiliency-and-high-availability/single-data-center-on-premises-deployment-example-using-kubernetes#SingleDataCenterOnPremisesDeploymentExampleUsingKubernetes-ExampleYAMLFiles, set "NEXUS_SEARCH_INDEX_REBUILD_ON_STARTUP" with the value "ture", but the repository.rebuild-index task was not run.

      REPRODUCE STEPS:

      Would not need to prepare K8s environment.

      1. Install NXRM 3.37.x
      2. Before starting "export NEXUS_SEARCH_INDEX_REBUILD_ON_STARTUP=true"
      3. Start Nexus

      EXPECTED BEHAVIOUR:

      • If new installation (or a new Pod starting), regardless of NEXUS_SEARCH_INDEX_REBUILD_ON_STARTUP, Nexus should rebuild the index because of "nexus.elasticsearch.autoRebuild" uses "true" for default.
      • If all indexes are empty, then with NEXUS_SEARCH_INDEX_REBUILD_ON_STARTUP=true, Nexus should rebuild indexes.

      POTENTIAL CAUSE:

      • It seems Nexus is supposed to check if index is empty, but checking if index exists. Because indexes are created during the startup from SearchIndexServiceImpl#createIndex (but empty), the SearchIndexServiceImpl#indexExist becomes true.
      • If one repository returns true from the indexExist, it looks like Nexus stops checking other repositories.

        Attachments

          Activity

            People

            Assignee:
            oshiyanbade Olu Shiyanbade
            Reporter:
            hosako Hajime Osako
            Last Updated By:
            Michael Oliverio Michael Oliverio
            Team:
            NXRM - Sentinels
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title