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

Ambari upgrade to Ambari-1.6.0 from Ambari-1.5.1 logs PSQLException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6.0
    • 1.6.0
    • ambari-server
    • None

    Description

      Following upgrade documentation at http://docs.hortonworks.com/HDPDocuments/Ambari-1.5.1.0/bk_upgrading_Ambari/content/ambari-chap7_2x.html,
      On executing ambari-server upgrade, PSQLException is logged in
      ambari-server.log:

      21:36:20,498  INFO [main] SchemaUpgradeHelper:211 - Upgrading schema to target version = 1.6.0
      21:36:20,528  INFO [main] SchemaUpgradeHelper:220 - Upgrading schema from source version = 1.5.1.110
      21:36:20,530  INFO [main] SchemaUpgradeHelper:141 - Upgrade path: [{ org.apache.ambari.server.upgrade.UpgradeCatalog160$$EnhancerByGuice$$ff8a4f66: sourceVersion = null, targetVersion = 1.6.0 }]
      21:36:20,530  INFO [main] SchemaUpgradeHelper:171 - Executing DDL upgrade...
      21:36:20,533  INFO [main] DBAccessorImpl:463 - Executing query: ALTER SCHEMA ambari OWNER TO "ambari";
      21:36:20,534  INFO [main] DBAccessorImpl:463 - Executing query: ALTER ROLE "ambari" SET search_path to 'ambari';
      21:36:20,598  INFO [main] DBAccessorImpl:463 - Executing query: CREATE TABLE hostgroup_configuration (blueprint_name VARCHAR(255) NOT NULL, hostgroup_name VARCHAR(255) NOT NULL, type_name VARCHAR(255) NOT NULL, config_data BYTEA NOT NULL, PRIMARY KEY (blueprint_name, hostgroup_name, type_name))
      21:36:20,962  INFO [main] DBAccessorImpl:463 - Executing query: CREATE TABLE viewentity (id BIGINT NOT NULL, view_name VARCHAR(255) NOT NULL, view_instance_name VARCHAR(255) NOT NULL, class_name VARCHAR(255) NOT NULL, id_property VARCHAR(255), PRIMARY KEY (id))
      21:36:21,010  INFO [main] DBAccessorImpl:463 - Executing query: ALTER TABLE hostcomponentdesiredstate ADD restart_required BOOLEAN
      21:36:21,078  INFO [main] DBAccessorImpl:463 - Executing query: ALTER TABLE hostgroup_configuration ADD CONSTRAINT FK_hg_config_blueprint_name FOREIGN KEY (blueprint_name) REFERENCES hostgroup (blueprint_name)
      21:36:21,084  WARN [main] DBAccessorImpl:469 - Error executing query: ALTER TABLE hostgroup_configuration ADD CONSTRAINT FK_hg_config_blueprint_name FOREIGN KEY (blueprint_name) REFERENCES hostgroup (blueprint_name)
      org.postgresql.util.PSQLException: ERROR: there is no unique constraint matching given keys for referenced table "hostgroup"
              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:466)
              at org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImpl.java:452)
              at org.apache.ambari.server.orm.DBAccessorImpl.addFKConstraint(DBAccessorImpl.java:337)
              at org.apache.ambari.server.orm.DBAccessorImpl.addFKConstraint(DBAccessorImpl.java:321)
              at org.apache.ambari.server.upgrade.UpgradeCatalog160.executeDDLUpdates(UpgradeCatalog160.java:85)
              at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:250)
              at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:176)
              at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:225)
      21:36:21,089  WARN [main] DBAccessorImpl:339 - Add FK constraint failed, constraintName = FK_hg_config_blueprint_name, tableName = hostgroup_configuration
      org.postgresql.util.PSQLException: ERROR: there is no unique constraint matching given keys for referenced table "hostgroup"
              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:466)
              at org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImpl.java:452)
              at org.apache.ambari.server.orm.DBAccessorImpl.addFKConstraint(DBAccessorImpl.java:337)
              at org.apache.ambari.server.orm.DBAccessorImpl.addFKConstraint(DBAccessorImpl.java:321)
              at org.apache.ambari.server.upgrade.UpgradeCatalog160.executeDDLUpdates(UpgradeCatalog160.java:85)
              at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:250)
              at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:176)
              at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:225)
      

      Attachments

        Issue Links

          Activity

            People

              mpapirkovskyy Papirkovskyy Myroslav
              mpapirkovskyy Papirkovskyy Myroslav
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: