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 32645116BD for ; Tue, 29 Jul 2014 00:19:39 +0000 (UTC) Received: (qmail 20560 invoked by uid 500); 29 Jul 2014 00:19:38 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 20536 invoked by uid 500); 29 Jul 2014 00:19: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 20355 invoked by uid 99); 29 Jul 2014 00:19:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jul 2014 00:19:38 +0000 Date: Tue, 29 Jul 2014 00:19:38 +0000 (UTC) From: "Alejandro Fernandez (JIRA)" To: dev@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AMBARI-6602) Error upgrading from 1.6.0 to 1.6.1 using external Postgres DB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-6602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alejandro Fernandez updated AMBARI-6602: ---------------------------------------- Description: Error upgrading from 1.6.0 to 1.6.1 using external Postgres DB If a user has an external postgres database either without a schema, or a schema whose name is different from the database name, then running "ambari-server upgrade" fails. The most common case is for an embedded postgres database, in which the database and schema name are the same, so this is not an issue. However, when using an external postgres database, it's likely that the schema is empty, so the upgrade fails due to a bug in which it expects the schema name to be the same as the database name. The fix is to prompt the user for the schema name whenever installing a postgres database (either embedded or external). The schema name is then saved in ambari.properties, so that AbstractUpgradeCatalog.java can check for postgres database type, nonempty username, and nonempty schema name before attempting the grant schema ownership to the account during an upgrade. {code} 14:16:57,584 INFO [main] SchemaUpgradeHelper:224 - Upgrading schema to target version = 1.6.1 14:16:57,620 INFO [main] SchemaUpgradeHelper:233 - Upgrading schema from source version = 1.6.0 14:16:57,623 INFO [main] SchemaUpgradeHelper:142 - Upgrade path: [{ ugradeCatalog: sourceVersion = 1.6.0, targetVersion = 1.6.1 }] 14:16:57,623 INFO [main] SchemaUpgradeHelper:173 - Executing DDL upgrade... 14:16:57,630 INFO [main] DBAccessorImpl:472 - Executing query: ALTER SCHEMA postgres OWNER TO "******; 14:16:57,645 WARN [main] DBAccessorImpl:478 - Error executing query: ALTER SCHEMA postgres OWNER TO "*****"; org.postgresql.util.PSQLException: ERROR: schema "******" does not exist 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:475) at org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImpl.java:461) at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.changePostgresSearchPath(AbstractUpgradeCatalog.java:169) at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:252) at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:178) at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:238) {code} was: Error upgrading from 1.6.0 to 1.6.1 using external Postgres DB If a user has an external postgres database either without a schema, or a schema whose name is different from the database name, then running "ambari-server upgrade" fails. The most common case is for an embedded postgres database, in which the database and schema name are the same, so this is not an issue. However, when using an external postgres database, it's likely that the schema is empty, so the upgrade fails due to a bug in which it expects the schema name to be the same as the database name. {code} 14:16:57,584 INFO [main] SchemaUpgradeHelper:224 - Upgrading schema to target version = 1.6.1 14:16:57,620 INFO [main] SchemaUpgradeHelper:233 - Upgrading schema from source version = 1.6.0 14:16:57,623 INFO [main] SchemaUpgradeHelper:142 - Upgrade path: [{ ugradeCatalog: sourceVersion = 1.6.0, targetVersion = 1.6.1 }] 14:16:57,623 INFO [main] SchemaUpgradeHelper:173 - Executing DDL upgrade... 14:16:57,630 INFO [main] DBAccessorImpl:472 - Executing query: ALTER SCHEMA postgres OWNER TO "******; 14:16:57,645 WARN [main] DBAccessorImpl:478 - Error executing query: ALTER SCHEMA postgres OWNER TO "*****"; org.postgresql.util.PSQLException: ERROR: schema "******" does not exist 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:475) at org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImpl.java:461) at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.changePostgresSearchPath(AbstractUpgradeCatalog.java:169) at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:252) at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:178) at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:238) {code} > Error upgrading from 1.6.0 to 1.6.1 using external Postgres DB > -------------------------------------------------------------- > > Key: AMBARI-6602 > URL: https://issues.apache.org/jira/browse/AMBARI-6602 > Project: Ambari > Issue Type: Bug > Affects Versions: 1.7.0 > Reporter: Mahadev konar > Assignee: Myroslav Papirkovskyy > Fix For: 1.7.0 > > > Error upgrading from 1.6.0 to 1.6.1 using external Postgres DB > If a user has an external postgres database either without a schema, or a schema whose name is different from the database name, then running "ambari-server upgrade" fails. > The most common case is for an embedded postgres database, in which the database and schema name are the same, so this is not an issue. > However, when using an external postgres database, it's likely that the schema is empty, so the upgrade fails due to a bug in which it expects the schema name to be the same as the database name. > The fix is to prompt the user for the schema name whenever installing a postgres database (either embedded or external). The schema name is then saved in ambari.properties, so that AbstractUpgradeCatalog.java can check for postgres database type, nonempty username, and nonempty schema name before attempting the grant schema ownership to the account during an upgrade. > {code} > 14:16:57,584 INFO [main] SchemaUpgradeHelper:224 - Upgrading schema to target version = 1.6.1 > 14:16:57,620 INFO [main] SchemaUpgradeHelper:233 - Upgrading schema from source version = 1.6.0 > 14:16:57,623 INFO [main] SchemaUpgradeHelper:142 - Upgrade path: [{ ugradeCatalog: sourceVersion = 1.6.0, targetVersion = 1.6.1 }] > 14:16:57,623 INFO [main] SchemaUpgradeHelper:173 - Executing DDL upgrade... > 14:16:57,630 INFO [main] DBAccessorImpl:472 - Executing query: ALTER SCHEMA postgres OWNER TO "******; > 14:16:57,645 WARN [main] DBAccessorImpl:478 - Error executing query: ALTER SCHEMA postgres OWNER TO "*****"; > org.postgresql.util.PSQLException: ERROR: schema "******" does not exist > 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:475) > at org.apache.ambari.server.orm.DBAccessorImpl.executeQuery(DBAccessorImpl.java:461) > at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.changePostgresSearchPath(AbstractUpgradeCatalog.java:169) > at org.apache.ambari.server.upgrade.AbstractUpgradeCatalog.upgradeSchema(AbstractUpgradeCatalog.java:252) > at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.executeUpgrade(SchemaUpgradeHelper.java:178) > at org.apache.ambari.server.upgrade.SchemaUpgradeHelper.main(SchemaUpgradeHelper.java:238) > {code} -- This message was sent by Atlassian JIRA (v6.2#6252)