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

Nexus Repository 3 may not be installable / upgradable if it uses PostgreSQL with non "public" schema

    Details

    • Sprint:
      NXRM Sentinels Sprint 28
    • Notability:
      2
    • InvestmentLayer:
      support-escalated
    • Aha Concept:
      non-concept

      Description

      SYMPTOM:

      As per https://help.sonatype.com/repomanager3/installation-and-upgrades/migrating-to-a-new-database, the migrator jar accept the schema name with "&currentSchema=nexus", but after doing this and re-starting NXRM 3.37, it fails with below:

      2021-12-01 18:58:06,235+1000 ERROR [FelixStartLevel]  *SYSTEM org.flywaydb.core.internal.command.DbMigrate - Migration of schema "nexus" to version "1.3 - JobDescriptionMigrationStep_1_3" failed! Changes successfully rolled back.
      2021-12-01 18:58:06,238+1000 ERROR [FelixStartLevel]  *SYSTEM org.sonatype.nexus.upgrade.datastore.internal.UpgradeServiceImpl - Failed transition: NEW -> STARTED
      org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: SQL State  : 42P01
      Error Code : 0
      Message    : ERROR: relation "public.qrtz_job_details" does not exist
      

      REPRODUCE STEPS:

      1. Install a new NXRM 3.37 with OrientDB
      2. Prepare PostgreSQL with a new database (eg: nxrm), a new schema (eg: nexus), and a DB user for nexus
      3. Run the migrator with "&currentSchema=nexus", and confirm it completes without any error
      4. Prepaire nexus-store.properties file, which includes the line "schema=nexus"
      5. Start Nexus normally

      EXPECTED RESULT:

      It should start successfully as this works with previous versions.

      POTENTIAL CAUSE:

      In the org.sonatype.nexus.quartz.internal.upgrades.JobDescriptionMigrationStep_1_3, we use the following:

        private static final String STATEMENT = "ALTER TABLE public.%s ALTER COLUMN description TYPE text";
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mshevelov Mykyta Shevelov
              Reporter:
              hosako Hajime Osako
              Last Updated By:
              Nicholas Blair Nicholas Blair
              Team:
              NXRM - Sentinels
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title