[
https://issues.apache.org/jira/browse/AMBARI-1057?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tom Beerbower updated AMBARI-1057:
----------------------------------
Attachment: AMBARI-1057.patch
> Can't reset ambari-server due to fail drop/create database DDLs
> ----------------------------------------------------------------
>
> Key: AMBARI-1057
> URL: https://issues.apache.org/jira/browse/AMBARI-1057
> Project: Ambari
> Issue Type: Sub-task
> Reporter: Tom Beerbower
> Assignee: Tom Beerbower
> Attachments: AMBARI-1057.patch
>
>
> 1. Perform install
> 2. Stop ambari server
> 3. ambari-server reset (which calls drop and create DDLs)
> 4. setup and start ambari-server
> 5. Can't login, says invalid username/database combo
> If I run the drop script directly on the DB, I get the following errors. So
> it isn't successfully dropping the database, and doesn't successfully create
> after, leaving server db in invalid state. Think need to CASCADE to the DROP
> TABLE commands...for example: DROP TABLE ambari.clusters CASCADE; I tested
> after adding CASCADE manually and was able to drop the database tables.
> {code}
> ambarirca=> \i /var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql;
> psql (8.4.13)
> You are now connected to database "ambari".
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:2: ERROR:
> must be owner of relation clusterconfig
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:3: ERROR:
> must be owner of relation clusterservices
> ALTER TABLE
> ALTER TABLE
> ALTER TABLE
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:7: ERROR:
> must be owner of relation hostcomponentdesiredconfigmapping
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:8: ERROR:
> must be owner of relation hostcomponentdesiredconfigmapping
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:9: ERROR:
> must be owner of relation hostcomponentdesiredstate
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:10: ERROR:
> must be owner of relation hostcomponentdesiredstate
> ALTER TABLE
> ALTER TABLE
> ALTER TABLE
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:14: ERROR:
> must be owner of relation servicecomponentdesiredstate
> ALTER TABLE
> ALTER TABLE
> ALTER TABLE
> ALTER TABLE
> ALTER TABLE
> ALTER TABLE
> ALTER TABLE
> ALTER TABLE
> ALTER TABLE
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:24: ERROR:
> constraint "fk_user_roles_ldap_user" of relation "user_roles" does not exist
> ALTER TABLE
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:26: ERROR:
> cannot drop table ambari.clusters because other objects depend on it
> DETAIL: constraint fk_clusterconfig_cluster_id on table ambari.clusterconfig
> depends on table ambari.clusters
> constraint fk_clusterservices_cluster_id on table ambari.clusterservices
> depends on table ambari.clusters
> HINT: Use DROP ... CASCADE to drop the dependent objects too.
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:27: ERROR:
> cannot drop table ambari.clusterservices because other objects depend on it
> DETAIL: constraint fk_servicecomponentdesiredstate_service_name on table
> ambari.servicecomponentdesiredstate depends on table ambari.clusterservices
> HINT: Use DROP ... CASCADE to drop the dependent objects too.
> DROP TABLE
> DROP TABLE
> DROP TABLE
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:31: ERROR:
> cannot drop table ambari.hostcomponentdesiredstate because other objects
> depend on it
> DETAIL: constraint fk_hostcomponentdesiredconfigmapping_cluster_id on table
> ambari.hostcomponentdesiredconfigmapping depends on table
> ambari.hostcomponentdesiredstate
> HINT: Use DROP ... CASCADE to drop the dependent objects too.
> DROP TABLE
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:33: ERROR:
> cannot drop table ambari.hosts because other objects depend on it
> DETAIL: constraint fk_hostcomponentdesiredstate_host_name on table
> ambari.hostcomponentdesiredstate depends on table ambari.hosts
> HINT: Use DROP ... CASCADE to drop the dependent objects too.
> DROP TABLE
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:35: ERROR:
> cannot drop table ambari.servicecomponentdesiredstate because other objects
> depend on it
> DETAIL: constraint fk_hostcomponentdesiredstate_component_name on table
> ambari.hostcomponentdesiredstate depends on table
> ambari.servicecomponentdesiredstate
> HINT: Use DROP ... CASCADE to drop the dependent objects too.
> DROP TABLE
> DROP TABLE
> DROP TABLE
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:39: ERROR:
> cannot drop table ambari.users because other objects depend on it
> DETAIL: constraint fk_user_roles_user_id on table ambari.user_roles depends
> on table ambari.users
> HINT: Use DROP ... CASCADE to drop the dependent objects too.
> DROP TABLE
> DROP TABLE
> DROP TABLE
> DROP TABLE
> DROP TABLE
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:45: ERROR:
> cannot drop table ambari.clusterconfig because other objects depend on it
> DETAIL: constraint fk_hostcomponentdesiredconfigmapping_config_tag on table
> ambari.hostcomponentdesiredconfigmapping depends on table ambari.clusterconfig
> HINT: Use DROP ... CASCADE to drop the dependent objects too.
> DROP TABLE
> DROP SEQUENCE
> DROP SEQUENCE
> psql (8.4.13)
> You are now connected to database "ambarirca".
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:51: ERROR:
> must be owner of relation job
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:52: ERROR:
> must be owner of relation task
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:53: ERROR:
> must be owner of relation taskattempt
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:54: ERROR:
> must be owner of relation taskattempt
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:55: ERROR:
> must be owner of relation workflow
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:56: ERROR:
> must be owner of relation job
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:57: ERROR:
> must be owner of relation task
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:58: ERROR:
> must be owner of relation taskattempt
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:59: ERROR:
> must be owner of relation hdfsevent
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:60: ERROR:
> must be owner of relation mapreduceevent
> psql:/var/lib/ambari-server/resources/Ambari-DDL-Postgres-DROP.sql:61: ERROR:
> must be owner of relation clusterevent
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira