SYMPTOM: Installing Ranger Admin with Ambari 2.2.1, I got the following exception during the installation
Ranger Admin installation failed - xa_audit_db_postgres.sql DB schema import failed!
ERROR:
###
2016-05-10 10:25:47,952 - Execute['python /usr/hdp/current/ranger-admin/db_setup.py'] {'logoutput': True, 'environment': {'RANGER_ADMIN_HOME': '/usr/hdp/current/ranger-admin', 'JAVA_HOME': '/usr/lib/jvm/jre-1.7.0-openjdk.x86_64'}, 'user': 'ranger'}
2016-05-10 10:25:48,081 [I] DB FLAVOR :POSTGRES
2016-05-10 10:25:48,081 [I] --------- Verifying Ranger DB connection ---------
2016-05-10 10:25:48,081 [I] Checking connection
2016-05-10 10:25:48,332 [I] connection success
2016-05-10 10:25:48,332 [I] --------- Verifying Ranger DB tables ---------
2016-05-10 10:25:48,332 [I] Verifying table x_portal_user in database ranger
2016-05-10 10:25:48,583 [I] Table x_portal_user already exists in database ranger
2016-05-10 10:25:48,583 [I] --------- Verifying upgrade history table ---------
2016-05-10 10:25:48,583 [I] Verifying table x_db_version_h in database ranger
2016-05-10 10:25:48,834 [I] Table x_db_version_h already exists in database ranger
2016-05-10 10:25:48,834 [I] --------- Applying Ranger DB patches ---------
2016-05-10 10:25:48,834 [I] No patches to apply!
2016-05-10 10:25:48,835 [I] --------- Starting Audit Operation ---------
2016-05-10 10:25:48,835 [I] --------- Check admin user connection ---------
2016-05-10 10:25:48,835 [I] Checking connection
2016-05-10 10:25:49,080 [I] connection success
2016-05-10 10:25:49,081 [I] --------- Check audit user connection ---------
2016-05-10 10:25:49,081 [I] Checking connection
2016-05-10 10:25:49,327 [I] connection success
2016-05-10 10:25:49,327 [I] --------- Check table ---------
2016-05-10 10:25:49,327 [I] Verifying table xa_access_audit in database audit
2016-05-10 10:25:49,575 [I] Table xa_access_audit does not exist in database audit
2016-05-10 10:25:49,576 [I] Importing db schema to database audit from file: xa_audit_db_postgres.sql
SQLException : SQL state: 3F000 org.postgresql.util.PSQLException: ERROR: no schema has been selected to create in ErrorCode: 0
SQLException : SQL state: 3F000 org.postgresql.util.PSQLException: ERROR: no schema has been selected to create in ErrorCode: 0
2016-05-10 10:25:49,813 [E] xa_audit_db_postgres.sql DB schema import failed!
###
ROOT CAUSE: Customer has set below parameter to "NO" , since user has already created the database and the database users and properly configured the connection of the users through the pg_hba.conf.
Setup Database and Database User=No
RESOLUTION: Setting up below value to YES and re-ran the installation resolved the issue