[ https://issues.apache.org/jira/browse/AMBARI-21883?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dmitry Lysnichenko updated AMBARI-21883: ---------------------------------------- Status: Patch Available (was: Open) > Upgrade to Ambari 2.6.0 fails with DB constraint violation on > fk_sc_history_upgrade_id > -------------------------------------------------------------------------------------- > > Key: AMBARI-21883 > URL: https://issues.apache.org/jira/browse/AMBARI-21883 > Project: Ambari > Issue Type: Bug > Components: ambari-server > Reporter: Dmitry Lysnichenko > Assignee: Dmitry Lysnichenko > Priority: Blocker > Attachments: AMBARI-21883.patch > > > When performing an Ambari upgrade to Ambari 2.6.0 using {{ambari-server > upgrade}}, the process fails with the following error: > {noformat} > 01 Sep 2017 14:36:24,340 ERROR [main] DBAccessorImpl:882 - Error executing > query: DELETE FROM upgrade > org.postgresql.util.PSQLException: ERROR: update or delete on table "upgrade" > violates foreign key constraint "fk_sc_history_upgrade_id" on table > "servicecomponent_history" > Detail: Key (upgrade_id)=(1) is still referenced from table > "servicecomponent_history". > at > org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161) > at > org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890) > at > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:559) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403) > at > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:395) > at > org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImpl.java:879) > at > org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImpl.java:871) > at > org.apache.ambari.server.orm.DBAccessorImpl.clearTable(DBAccessorImpl.java:1502) > at > org.apache.ambari.server.upgrade.UpgradeCatalog260.updateUpgradeTable(UpgradeCatalog260.java:225) > at > org.apache.ambari.server.upgrade.UpgradeCatalog260.executeDDLUpdates(UpgradeCatalog260.java:153) > at > org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:923) > at > org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:197) > at > org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:415) > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)