Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 93678190D8 for ; Tue, 1 Mar 2016 22:00:38 +0000 (UTC) Received: (qmail 9145 invoked by uid 500); 1 Mar 2016 22:00:38 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 9108 invoked by uid 500); 1 Mar 2016 22:00:38 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 9093 invoked by uid 99); 1 Mar 2016 22:00:38 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2016 22:00:38 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 7054A2E74FA; Tue, 1 Mar 2016 22:00:37 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============0587910386554823565==" MIME-Version: 1.0 Subject: Re: Review Request 44228: Ambari upgrade fails if there is incorrect version in upgrade table From: Robert Nettleton To: Robert Levas , Alejandro Fernandez , Robert Nettleton Cc: Jonathan Hurley , Ambari Date: Tue, 01 Mar 2016 22:00:37 -0000 Message-ID: <20160301220037.26940.85343@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Robert Nettleton X-ReviewGroup: Ambari X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/44228/ X-Sender: Robert Nettleton X-ReviewBoard-ShipIt: 1 References: <20160301213547.26940.2158@reviews.apache.org> In-Reply-To: <20160301213547.26940.2158@reviews.apache.org> X-ReviewBoard-ShipIt-Only: 1 Reply-To: Robert Nettleton X-ReviewRequest-Repository: ambari --===============0587910386554823565== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/44228/#review121512 ----------------------------------------------------------- Ship it! Ship It! - Robert Nettleton On March 1, 2016, 9:35 p.m., Jonathan Hurley wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/44228/ > ----------------------------------------------------------- > > (Updated March 1, 2016, 9:35 p.m.) > > > Review request for Ambari, Alejandro Fernandez, Robert Levas, and Robert Nettleton. > > > Bugs: AMBARI-15253 > https://issues.apache.org/jira/browse/AMBARI-15253 > > > Repository: ambari > > > Description > ------- > > Upgrade Ambari from 2.1.2.1 to 2.2 fails because of missing -2 which could not match the correct {{repo_version}}. Because the upgrade pack is bound to the major HDP stack version, we can use a 2nd query to get all versions for the stack, and just use that if the query by version fails. > > {code} > 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) > {code} > > {code} > 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) > {code} > > {code} > 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) > {code} > > > Diffs > ----- > > ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java 8489486 > ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog220.java 2330a21 > > Diff: https://reviews.apache.org/r/44228/diff/ > > > Testing > ------- > > Ran through an upgrade on the problem database. Unit tests pending. > > > Thanks, > > Jonathan Hurley > > --===============0587910386554823565==--