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 443A318818 for ; Fri, 24 Jul 2015 22:04:05 +0000 (UTC) Received: (qmail 7851 invoked by uid 500); 24 Jul 2015 22:04:05 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 7793 invoked by uid 500); 24 Jul 2015 22:04:05 -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 7734 invoked by uid 99); 24 Jul 2015 22:04:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jul 2015 22:04:05 +0000 Date: Fri, 24 Jul 2015 22:04:04 +0000 (UTC) From: "Alejandro Fernandez (JIRA)" To: dev@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AMBARI-12520) ambari-server upgrade from 2.0.1 to 2.1.0 failed in postgres while deleting foreign keys MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-12520?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alejandro Fernandez updated AMBARI-12520: ----------------------------------------- Attachment: (was: AMBARI-12520.branch-2.1.1.patch) > ambari-server upgrade from 2.0.1 to 2.1.0 failed in postgres while deleti= ng foreign keys > -------------------------------------------------------------------------= --------------- > > Key: AMBARI-12520 > URL: https://issues.apache.org/jira/browse/AMBARI-12520 > Project: Ambari > Issue Type: Bug > Components: ambari-server > Affects Versions: 2.1.0 > Reporter: Alejandro Fernandez > Assignee: Alejandro Fernandez > Priority: Blocker > Fix For: 2.1.1 > > > This was reported by the community: > {noformat} > Hi, > I have a issue with upgrade from Ambari 2.0.1 to 2.1.0, I changed the JDK= from 1.6 to 1.7 from =E2=80=9Cambari-server setup=E2=80=9D. When I do =E2= =80=9Cambari-server upgrade=E2=80=9D, the result is: > Using python /usr/bin/python2.6 > Upgrading ambari-server > Updating properties in ambari.properties =E2=80=A6 > WARNING: Can not find ambari.properties.rpmsave file from previous versio= n, skipping import of settings > Fixing database objects owner > Upgrading database schema > ERROR: Error executing schema upgrade, please check the server logs. > ERROR: Ambari server upgrade failed. Please look at /var/log/ambari-serve= r/ambari-server.log, for more details. > ERROR: Exiting with exit code 11. > REASON: Schema upgrade failed. > When I see the /var/log/ambari-server/ambari-server.log: > 23 Jul 2015 11:37:15,724 INFO [main] Configuration:594 =E2=80=93 Reading = password from existing file > 23 Jul 2015 11:37:15,738 INFO [main] Configuration:864 =E2=80=93 Hosts Ma= pping File null > 23 Jul 2015 11:37:15,738 INFO [main] HostsMap:60 =E2=80=93 Using hostsmap= file null > 23 Jul 2015 11:37:16,229 INFO [main] ControllerModule:185 =E2=80=93 Detec= ted POSTGRES as the database type from the JDBC URL > 23 Jul 2015 11:37:17,669 INFO [main] ControllerModule:558 =E2=80=93 Bindi= ng and registering notification dispatcher class org.apache.ambari.server.n= otifications.dispatchers.AlertScriptDispatcher > 23 Jul 2015 11:37:17,677 INFO [main] ControllerModule:558 =E2=80=93 Bindi= ng and registering notification dispatcher class org.apache.ambari.server.n= otifications.dispatchers.EmailDispatcher > 23 Jul 2015 11:37:17,731 INFO [main] ControllerModule:558 =E2=80=93 Bindi= ng and registering notification dispatcher class org.apache.ambari.server.n= otifications.dispatchers.SNMPDispatcher > 23 Jul 2015 11:37:20,479 INFO [main] SchemaUpgradeHelper:277 =E2=80=93 Up= grading schema to target version =3D 2.1.0 > 23 Jul 2015 11:37:20,500 INFO [main] SchemaUpgradeHelper:286 =E2=80=93 Up= grading schema from source version =3D 2.0.1 > 23 Jul 2015 11:37:20,502 INFO [main] SchemaUpgradeHelper:150 =E2=80=93 Up= grade path: [{ upgradeCatalog: sourceVersion =3D 2.0.0, targetVersion =3D 2= .1.0 }, { upgradeCatalog: sourceVersion =3D null, targetVersion =3D 2.1.0 }= ] > 23 Jul 2015 11:37:20,502 INFO [main] SchemaUpgradeHelper:185 =E2=80=93 Ex= ecuting DDL upgrade=E2=80=A6 > 23 Jul 2015 11:37:20,502 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: ALTER SCHEMA ambari OWNER TO =E2=80=9Cambari=E2=80=9D; > 23 Jul 2015 11:37:20,503 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: ALTER ROLE =E2=80=9Cambari=E2=80=9D SET search_path to =E2=80=98a= mbari'; > 23 Jul 2015 11:37:20,506 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: ALTER TABLE alert_current ALTER COLUMN latest_text TYPE TEXT > 23 Jul 2015 11:37:20,516 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: ALTER TABLE alert_history ALTER COLUMN alert_text TYPE TEXT > 23 Jul 2015 11:37:20,582 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: UPDATE hosts SET host_id =3D 1 WHERE host_name =3D =E2=80=98hm1.c= lapix.com=E2=80=99 > 23 Jul 2015 11:37:20,585 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: UPDATE hosts SET host_id =3D 2 WHERE host_name =3D =E2=80=98hm2.c= lapix.com=E2=80=99 > 23 Jul 2015 11:37:20,586 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: UPDATE hosts SET host_id =3D 3 WHERE host_name =3D =E2=80=98hs1.c= lapix.com=E2=80=99 > 23 Jul 2015 11:37:20,586 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: UPDATE hosts SET host_id =3D 4 WHERE host_name =3D =E2=80=98hs2.c= lapix.com=E2=80=99 > 23 Jul 2015 11:37:20,587 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: UPDATE hosts SET host_id =3D 5 WHERE host_name =3D =E2=80=98hs3.c= lapix.com=E2=80=99 > 23 Jul 2015 11:37:20,588 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: UPDATE hosts SET host_id =3D 6 WHERE host_name =3D =E2=80=98hs4.c= lapix.com=E2=80=99 > 23 Jul 2015 11:37:20,589 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: UPDATE hosts SET host_id =3D 7 WHERE host_name =3D =E2=80=98hs5.c= lapix.com=E2=80=99 > 23 Jul 2015 11:37:20,590 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: UPDATE hosts SET host_id =3D 8 WHERE host_name =3D =E2=80=98hs6.c= lapix.com=E2=80=99 > 23 Jul 2015 11:37:20,590 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: UPDATE hosts SET host_id =3D 9 WHERE host_name =3D =E2=80=98hs7.c= lapix.com=E2=80=99 > 23 Jul 2015 11:37:20,592 WARN [main] AbstractUpgradeCatalog:140 =E2=80=93= Sequence host_id_seq already exists, skipping > 23 Jul 2015 11:37:20,592 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: ALTER TABLE hosts ALTER COLUMN host_id TYPE BIGINT > 23 Jul 2015 11:37:20,621 WARN [main] DBAccessorImpl:288 =E2=80=93 FK host= componentstate_host_name not found for table hostcomponentstate > 23 Jul 2015 11:37:20,621 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int hostcomponentstate_host_name from hostcomponentstate table not found, n= othing to drop > 23 Jul 2015 11:37:20,640 WARN [main] DBAccessorImpl:288 =E2=80=93 FK fk_h= ostcomponentstate_host_name not found for table hostcomponentstate > 23 Jul 2015 11:37:20,640 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int fk_hostcomponentstate_host_name from hostcomponentstate table not found= , nothing to drop > 23 Jul 2015 11:37:20,657 WARN [main] DBAccessorImpl:288 =E2=80=93 FK hstc= mponentdesiredstatehstname not found for table hostcomponentdesiredstate > 23 Jul 2015 11:37:20,658 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int hstcmponentdesiredstatehstname from hostcomponentdesiredstate table not= found, nothing to drop > 23 Jul 2015 11:37:20,673 WARN [main] DBAccessorImpl:288 =E2=80=93 FK fk_h= ostcomponentdesiredstate_host_name not found for table hostcomponentdesired= state > 23 Jul 2015 11:37:20,673 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int fk_hostcomponentdesiredstate_host_name from hostcomponentdesiredstate t= able not found, nothing to drop > 23 Jul 2015 11:37:20,690 WARN [main] DBAccessorImpl:288 =E2=80=93 FK fk_h= ost_role_command_host_name not found for table host_role_command > 23 Jul 2015 11:37:20,690 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int FK_host_role_command_host_name from host_role_command table not found, = nothing to drop > 23 Jul 2015 11:37:20,704 WARN [main] DBAccessorImpl:288 =E2=80=93 FK fk_h= oststate_host_name not found for table hoststate > 23 Jul 2015 11:37:20,704 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int FK_hoststate_host_name from hoststate table not found, nothing to drop > 23 Jul 2015 11:37:20,718 WARN [main] DBAccessorImpl:288 =E2=80=93 FK fk_h= ost_version_host_name not found for table host_version > 23 Jul 2015 11:37:20,718 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int FK_host_version_host_name from host_version table not found, nothing to= drop > 23 Jul 2015 11:37:20,732 WARN [main] DBAccessorImpl:288 =E2=80=93 FK fk_c= ghm_hname not found for table configgrouphostmapping > 23 Jul 2015 11:37:20,732 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int FK_cghm_hname from configgrouphostmapping table not found, nothing to d= rop > 23 Jul 2015 11:37:20,746 WARN [main] DBAccessorImpl:288 =E2=80=93 FK fk_c= onfiggrouphostmapping_host_name not found for table configgrouphostmapping > 23 Jul 2015 11:37:20,746 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int fk_configgrouphostmapping_host_name from configgrouphostmapping table n= ot found, nothing to drop > 23 Jul 2015 11:37:20,759 WARN [main] DBAccessorImpl:288 =E2=80=93 FK fk_k= rb_pr_host_hostname not found for table kerberos_principal_host > 23 Jul 2015 11:37:20,759 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int FK_krb_pr_host_hostname from kerberos_principal_host table not found, n= othing to drop > 23 Jul 2015 11:37:20,773 WARN [main] DBAccessorImpl:288 =E2=80=93 FK fk_k= erberos_principal_host_host_name not found for table kerberos_principal_hos= t > 23 Jul 2015 11:37:20,774 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int fk_kerberos_principal_host_host_name from kerberos_principal_host table= not found, nothing to drop > 23 Jul 2015 11:37:20,789 WARN [main] DBAccessorImpl:288 =E2=80=93 FK fk_k= rb_pr_host_principalname not found for table kerberos_principal_host > 23 Jul 2015 11:37:20,789 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int FK_krb_pr_host_principalname from kerberos_principal_host table not fou= nd, nothing to drop > 23 Jul 2015 11:37:20,806 WARN [main] DBAccessorImpl:288 =E2=80=93 FK fk_h= ostconfmapping_host_name not found for table hostconfigmapping > 23 Jul 2015 11:37:20,807 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int FK_hostconfmapping_host_name from hostconfigmapping table not found, no= thing to drop > 23 Jul 2015 11:37:20,820 WARN [main] DBAccessorImpl:288 =E2=80=93 FK clus= terhostmapping_host_name not found for table clusterhostmapping > 23 Jul 2015 11:37:20,820 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int ClusterHostMapping_host_name from ClusterHostMapping table not found, n= othing to drop > 23 Jul 2015 11:37:20,833 WARN [main] DBAccessorImpl:288 =E2=80=93 FK fk_c= lusterhostmapping_host_name not found for table clusterhostmapping > 23 Jul 2015 11:37:20,833 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int fk_clusterhostmapping_host_name from ClusterHostMapping table not found= , nothing to drop > 23 Jul 2015 11:37:20,846 WARN [main] DBAccessorImpl:288 =E2=80=93 FK clus= terhostmapping_cluster_id not found for table clusterhostmapping > 23 Jul 2015 11:37:20,846 WARN [main] DBAccessorImpl:748 =E2=80=93 Constra= int ClusterHostMapping_cluster_id from ClusterHostMapping table not found, = nothing to drop > 23 Jul 2015 11:37:20,859 INFO [main] DBAccessorImpl:422 =E2=80=93 Foreign= Key constraint FK_clhostmapping_cluster_id already exists, skipping > 23 Jul 2015 11:37:20,863 INFO [main] DBAccessorImpl:691 =E2=80=93 Executi= ng query: ALTER TABLE hosts DROP CONSTRAINT hosts_pkey > 23 Jul 2015 11:37:20,869 ERROR [main] DBAccessorImpl:697 =E2=80=93 Error = executing query: ALTER TABLE hosts DROP CONSTRAINT hosts_pkey > org.postgresql.util.PSQLException: ERROR: cannot drop constraint hosts_pk= ey on table hosts because other objects depend on it > Detail: constraint fk_hostconfigmapping_host_name on table hostconfigmapp= ing depends on index hosts_pkey > Hint: Use DROP =E2=80=A6 CASCADE to drop the dependent objects too. > at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExe= cutorImpl.java:2161) > at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorI= mpl.java:1890) > at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.jav= a:255) > at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2State= ment.java:559) > at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJ= dbc2Statement.java:403) > at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2State= ment.java:395) > at org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImp= l.java:694) > at org.apache.ambari.server.orm.DBAccessorImpl.dropPKConstraint(DBAccesso= rImpl.java:771) > at org.apache.ambari.server.upgrade.UpgradeCatalog210.executeHostsDDLUpda= tes(UpgradeCatalog210.java:425) > at org.apache.ambari.server.upgrade.UpgradeCatalog210.executeDDLUpdates(U= pgradeCatalog210.java:190) > at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(= AbstractUpgradeCatalog.java:526) > at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(Sc= hemaUpgradeHelper.java:190) > at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgrad= eHelper.java:291) > 23 Jul 2015 11:37:20,871 ERROR [main] SchemaUpgradeHelper:192 =E2=80=93 U= pgrade failed. > org.postgresql.util.PSQLException: ERROR: cannot drop constraint hosts_pk= ey on table hosts because other objects depend on it > Detail: constraint fk_hostconfigmapping_host_name on table hostconfigmapp= ing depends on index hosts_pkey > Hint: Use DROP =E2=80=A6 CASCADE to drop the dependent objects too. > at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExe= cutorImpl.java:2161) > at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorI= mpl.java:1890) > at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.jav= a:255) > at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2State= ment.java:559) > at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJ= dbc2Statement.java:403) > at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2State= ment.java:395) > at org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImp= l.java:694) > at org.apache.ambari.server.orm.DBAccessorImpl.dropPKConstraint(DBAccesso= rImpl.java:771) > at org.apache.ambari.server.upgrade.UpgradeCatalog210.executeHostsDDLUpda= tes(UpgradeCatalog210.java:425) > at org.apache.ambari.server.upgrade.UpgradeCatalog210.executeDDLUpdates(U= pgradeCatalog210.java:190) > at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(= AbstractUpgradeCatalog.java:526) > at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(Sc= hemaUpgradeHelper.java:190) > at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgrad= eHelper.java:291) > 23 Jul 2015 11:37:20,871 ERROR [main] SchemaUpgradeHelper:308 =E2=80=93 E= xception occurred during upgrade, failed > org.apache.ambari.server.AmbariException: ERROR: cannot drop constraint h= osts_pkey on table hosts because other objects depend on it > Detail: constraint fk_hostconfigmapping_host_name on table hostconfigmapp= ing depends on index hosts_pkey > Hint: Use DROP =E2=80=A6 CASCADE to drop the dependent objects too. > at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(Sc= hemaUpgradeHelper.java:193) > at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgrad= eHelper.java:291) > Caused by: org.postgresql.util.PSQLException: ERROR: cannot drop constrai= nt hosts_pkey on table hosts because other objects depend on it > Detail: constraint fk_hostconfigmapping_host_name on table hostconfigmapp= ing depends on index hosts_pkey > Hint: Use DROP =E2=80=A6 CASCADE to drop the dependent objects too. > at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExe= cutorImpl.java:2161) > at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorI= mpl.java:1890) > at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.jav= a:255) > at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2State= ment.java:559) > at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJ= dbc2Statement.java:403) > at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2State= ment.java:395) > at org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImp= l.java:694) > at org.apache.ambari.server.orm.DBAccessorImpl.dropPKConstraint(DBAccesso= rImpl.java:771) > at org.apache.ambari.server.upgrade.UpgradeCatalog210.executeHostsDDLUpda= tes(UpgradeCatalog210.java:425) > at org.apache.ambari.server.upgrade.UpgradeCatalog210.executeDDLUpdates(U= pgradeCatalog210.java:190) > at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(= AbstractUpgradeCatalog.java:526) > at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(Sc= hemaUpgradeHelper.java:190) > =E2=80=A6 1 more > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)