Created 04-06-2016 06:01 PM
Hello- I the process of upgrading Ambari to 2.2.1.1 I hit the following error after $ ambari-server upgrade:
06 Apr 2016 13:22:52,129 ERROR [main] SchemaUpgradeHelper:315 - Exception occurred during 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.SchemaUpgradeHelper.executePreDMLUpdates(SchemaUpgradeHelper.java:215) at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:302) Caused by: org.apache.ambari.server.AmbariException: Errors found while populating the upgrade table with values for columns upgrade_type and upgrade_package.
Took a look at my (external) Postgres database and found the ambari database does not have an "upgrade" table. I checked another cluster with a similar external Postgres instance and it does have that table.
Should I create the table manually? If so, anyone have the appropriate create statement for the table? If there's a more ambari-friendly way get the tables straight, that would be preferable. Thanks.
Created 04-07-2016 11:14 PM
This happened because a record may be missing in the repo_version table. If you insert the record before performing the Ambari Upgrade it should work. You can make sure you have a record for each one of the versions.
SELECT from_version, to_version FROM upgrade; -- Assuming 2.2.0.0-2041 is missing INSERT INTO repo_version (repo_version_id, version, display_name, upgrade_package, repositories, stack_id) VALUES (1, '2.2.0.0-2041', 'HDP-2.2.0.0-2041', 'upgrade-2.2', '', (SELECT stack_id FROM stack WHERE stack_version = '2.2'));
Created 04-06-2016 06:03 PM
From what ambari version are you upgrading?
Created 04-06-2016 06:07 PM
Ambari 2.1.2.1
Created 04-07-2016 09:09 PM
I believe, the failure seems to be caused while setting "upgrade_package" column for existing entries in the upgrade DB because there is no repo_version DB entry that matches with the from_version entry for a DOWNGRADE entry in the upgrade table.
However, I do believe the upgrade DB table should exist as it also existed in 2.1.2.1 and we dont delete the table. You can check your DB dump before the upgrade to verify if the table existed
Created 04-06-2016 06:14 PM
This is happening during the upgrade to Ambari 2.2.0 https://github.com/apache/ambari/blob/release-2.2.1-rc2/ambari-server/src/main/java/org/apache/ambar...
What is the output of running,
SELECT upgrade_id, cluster_id, from_version, to_version, direction, upgrade_package, upgrade_type FROM upgrade;
Basically, you have to populate the upgrade_type and upgrade_pack columns based on the versions used.
Created 04-06-2016 06:31 PM
Thanks, but since I don't have an "upgrade" table I can't run a select.
Created 04-07-2016 11:14 PM
This happened because a record may be missing in the repo_version table. If you insert the record before performing the Ambari Upgrade it should work. You can make sure you have a record for each one of the versions.
SELECT from_version, to_version FROM upgrade; -- Assuming 2.2.0.0-2041 is missing INSERT INTO repo_version (repo_version_id, version, display_name, upgrade_package, repositories, stack_id) VALUES (1, '2.2.0.0-2041', 'HDP-2.2.0.0-2041', 'upgrade-2.2', '', (SELECT stack_id FROM stack WHERE stack_version = '2.2'));
Created on 04-11-2016 09:40 AM - edited 08-18-2019 05:06 AM
I have this in the ambari database, if correct??? because i cant finish the upgrade maybe because ambary detect somenthing wrong into the database, please help me.
ambari=> SELECT from_version, to_version, direction, skip_failures, skip_sc_failures FROM upgrade; from_version | to_version | direction | skip_failures | skip_sc_failures --------------+--------------+-----------+---------------+------------------ 2.3.2.0-2950 | 2.4.0.0-169 | UPGRADE | 1 | 0 2.3.2.0-2950 | 2.3.2.0-2950 | DOWNGRADE | 0 | 0 2.3.2.0-2950 | 2.4.0.0-169 | UPGRADE | 1 | 1
i need to delete somenthing??
Created 04-11-2016 06:16 PM
Accepting @Alejandro Fernandez 's answer as this is what we essentially did, but I definitely recommend treading cautiously and of course backup your database before making changes. This does appear to be a bug.
Created 04-12-2016 07:42 AM
Hi:
I need to know if i can delete from database the extra row, also the skip_sc_failures column with value =1 is error or ok??
ambari=> select * from upgrade; upgrade_id | cluster_id | request_id | from_version | to_version | direction | downgrade_allowed | skip_failures | skip_sc_failures | upgrade_pac kage | upgrade_type ------------+------------+------------+--------------+--------------+-----------+-------------------+---------------+------------------+--------------- ---------+-------------- 1 | 2 | 820 | 2.3.2.0-2950 | 2.4.0.0-169 | UPGRADE | 1 | 1 | 0 | nonrolling-upg rade-2.4 | NON_ROLLING 2 | 2 | 821 | 2.3.2.0-2950 | 2.3.2.0-2950 | DOWNGRADE | 1 | 0 | 0 | nonrolling-upg rade-2.4 | NON_ROLLING 3 | 2 | 894 | 2.3.2.0-2950 | 2.4.0.0-169 | UPGRADE | 1 | 1 | 1 | nonrolling-upg rade-2.4 | NON_ROLLING