Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-15253

Ambari upgrade fails if there is incorrect version in upgrade table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.2.2
    • 2.2.2
    • ambari-upgrade
    • None

    Description

      Upgrade Ambari from 2.1.2.1 to 2.2 fails:

      Fixing database objects owner 
      Ambari Server configured for Embedded Postgres. Confirm you have made a backup of the Ambari Server database [y/n] (y)? 
      Upgrading database schema 
      Error output from schema upgrade command: 
      java.lang.NullPointerException 
      at org.apache.ambari.server.upgrade.UpgradeCatalog213.calculateUpgradePackage(UpgradeCatalog213.java:630) 
      at org.apache.ambari.server.upgrade.UpgradeCatalog213.populateUpgradeTable(UpgradeCatalog213.java:563) 
      
      5 Feb 2016 21:19:55,871  INFO [main] UpgradeCatalog213:532 - Populating rows for the upgrade table record with upgrade_id: 3, cluster_id: 2, from_version: 2.2.0.0-2041, to_version: 2.2.4.2, direction: UPGRADE
      15 Feb 2016 21:19:55,871  INFO [main] UpgradeCatalog213:538 - Updating the record's upgrade_type to ROLLING
      15 Feb 2016 21:19:55,871  INFO [main] DBAccessorImpl:718 - Executing query: UPDATE upgrade SET upgrade_type = 'ROLLING' WHERE upgrade_id = 3
      15 Feb 2016 21:19:55,874 ERROR [main] UpgradeCatalog213:580 - Unable to populate the upgrade_type and upgrade_package columns of the upgrade table. java.lang.NullPointerException
      15 Feb 2016 21:19:55,875 ERROR [main] SchemaUpgradeHelper:214 - Upgrade failed. 
      org.apache.ambari.server.AmbariException: Errors found while populating the upgrade table with values for columns upgrade_type and upgrade_package.
      	at org.apache.ambari.server.upgrade.UpgradeCatalog213.executeStackUpgradeDDLUpdates(UpgradeCatalog213.java:443)
      	at org.apache.ambari.server.orm.AmbariJpaLocalTxnInterceptor.invoke(AmbariJpaLocalTxnInterceptor.java:68)
      
       select * from upgrade;
       upgrade_id | cluster_id | request_id | from_version |  to_version  | direction
      ------------+------------+------------+--------------+--------------+-----------
                1 |          2 |       1295 | 2.2.0.0-2041 | 2.2.4.2-2    | UPGRADE
                2 |          2 |       1296 | 2.2.0.0-2041 | 2.2.0.0-2041 | DOWNGRADE
                3 |          2 |       1299 | 2.2.0.0-2041 | 2.2.4.2      | UPGRADE
                4 |          2 |       1300 | 2.2.0.0-2041 | 2.2.0.0-2041 | DOWNGRADE
                5 |          2 |       1331 | 2.2.0.0-2041 | 2.2.4.2-2    | UPGRADE
                6 |          2 |       1332 | 2.2.0.0-2041 | 2.2.0.0-2041 | DOWNGRADE
                7 |          2 |       1333 | 2.2.0.0-2041 | 2.2.4.2-2    | UPGRADE
                8 |          2 |       1334 | 2.2.0.0-2041 | 2.2.0.0-2041 | DOWNGRADE
                9 |          2 |       1335 | 2.2.0.0-2041 | 2.2.4.2-2    | UPGRADE
               10 |          2 |       1336 | 2.2.0.0-2041 | 2.2.0.0-2041 | DOWNGRADE
               11 |          2 |       1347 | 2.2.0.0-2041 | 2.2.4.2-2    | UPGRADE
      (11 rows)
      

      The upgrade failed because of missing -2 which could not match the correct repo_version.

      Attachments

        1. AMBARI-15253.patch
          10 kB
          Jonathan Hurley

        Issue Links

          Activity

            People

              jonathanhurley Jonathan Hurley
              jonathanhurley Jonathan Hurley
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: