Support Questions
Find answers, ask questions, and share your expertise

ranger won't start patch 28 already being applied by some other process

Explorer

I was upgrading to HDP 3.0 and keep getting a timeout error when trying to start Ranger:

Python script has been killed due to timeout after waiting 600 secs
 stdout:
2018-08-06 19:21:53,314 - Stack Feature Version Info: Cluster Stack=3.0, Command Stack=None, Command Version=3.0.0.0-1634, Upgrade Direction=upgrade -> 3.0.0.0-1634
2018-08-06 19:21:53,336 - Using hadoop conf dir: /usr/hdp/3.0.0.0-1634/hadoop/conf
2018-08-06 19:21:53,679 - Stack Feature Version Info: Cluster Stack=3.0, Command Stack=None, Command Version=3.0.0.0-1634, Upgrade Direction=upgrade -> 3.0.0.0-1634
2018-08-06 19:21:53,688 - Using hadoop conf dir: /usr/hdp/3.0.0.0-1634/hadoop/conf
2018-08-06 19:21:53,690 - Group['ranger'] {}
2018-08-06 19:21:53,692 - Group['hdfs'] {}
2018-08-06 19:21:53,692 - Group['hadoop'] {}
2018-08-06 19:21:53,693 - Group['users'] {}
2018-08-06 19:21:53,694 - User['yarn-ats'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-08-06 19:21:53,697 - User['infra-solr'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-08-06 19:21:53,699 - User['zookeeper'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-08-06 19:21:53,700 - User['atlas'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-08-06 19:21:53,702 - User['ams'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-08-06 19:21:53,703 - User['ranger'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['ranger', 'hadoop'], 'uid': None}
2018-08-06 19:21:53,705 - User['logsearch'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-08-06 19:21:53,706 - User['ambari-qa'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop', 'users'], 'uid': None}
2018-08-06 19:21:53,707 - User['kafka'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-08-06 19:21:53,709 - User['hdfs'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hdfs', 'hadoop'], 'uid': None}
2018-08-06 19:21:53,710 - Modifying user hdfs
2018-08-06 19:21:53,732 - User['yarn'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-08-06 19:21:53,735 - User['mapred'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-08-06 19:21:53,737 - User['hbase'] {'gid': 'hadoop', 'fetch_nonlocal_groups': True, 'groups': ['hadoop'], 'uid': None}
2018-08-06 19:21:53,739 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2018-08-06 19:21:53,742 - Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa 0'] {'not_if': '(test $(id -u ambari-qa) -gt 1000) || (false)'}
2018-08-06 19:21:53,751 - Skipping Execute['/var/lib/ambari-agent/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa 0'] due to not_if
2018-08-06 19:21:53,752 - Directory['/tmp/hbase-hbase'] {'owner': 'hbase', 'create_parents': True, 'mode': 0775, 'cd_access': 'a'}
2018-08-06 19:21:53,754 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2018-08-06 19:21:53,756 - File['/var/lib/ambari-agent/tmp/changeUid.sh'] {'content': StaticFile('changeToSecureUid.sh'), 'mode': 0555}
2018-08-06 19:21:53,758 - call['/var/lib/ambari-agent/tmp/changeUid.sh hbase'] {}
2018-08-06 19:21:53,772 - call returned (0, '65549')
2018-08-06 19:21:53,773 - Execute['/var/lib/ambari-agent/tmp/changeUid.sh hbase /home/hbase,/tmp/hbase,/usr/bin/hbase,/var/log/hbase,/tmp/hbase-hbase 65549'] {'not_if': '(test $(id -u hbase) -gt 1000) || (false)'}
2018-08-06 19:21:53,782 - Skipping Execute['/var/lib/ambari-agent/tmp/changeUid.sh hbase /home/hbase,/tmp/hbase,/usr/bin/hbase,/var/log/hbase,/tmp/hbase-hbase 65549'] due to not_if
2018-08-06 19:21:53,783 - Group['hdfs'] {}
2018-08-06 19:21:53,783 - User['hdfs'] {'fetch_nonlocal_groups': True, 'groups': ['hdfs', 'hadoop', 'hadoop', u'hdfs']}
2018-08-06 19:21:53,784 - Modifying user hdfs
2018-08-06 19:21:53,800 - FS Type: HDFS
2018-08-06 19:21:53,801 - Directory['/etc/hadoop'] {'mode': 0755}
2018-08-06 19:21:53,829 - File['/usr/hdp/3.0.0.0-1634/hadoop/conf/hadoop-env.sh'] {'content': InlineTemplate(...), 'owner': 'hdfs', 'group': 'hadoop'}
2018-08-06 19:21:53,830 - Directory['/var/lib/ambari-agent/tmp/hadoop_java_io_tmpdir'] {'owner': 'hdfs', 'group': 'hadoop', 'mode': 01777}
2018-08-06 19:21:53,859 - Execute[('setenforce', '0')] {'not_if': '(! which getenforce ) || (which getenforce && getenforce | grep -q Disabled)', 'sudo': True, 'only_if': 'test -f /selinux/enforce'}
2018-08-06 19:21:53,875 - Skipping Execute[('setenforce', '0')] due to only_if
2018-08-06 19:21:53,876 - Directory['/var/log/hadoop'] {'owner': 'root', 'create_parents': True, 'group': 'hadoop', 'mode': 0775, 'cd_access': 'a'}
2018-08-06 19:21:53,880 - Directory['/var/run/hadoop'] {'owner': 'root', 'create_parents': True, 'group': 'root', 'cd_access': 'a'}
2018-08-06 19:21:53,881 - Directory['/var/run/hadoop/hdfs'] {'owner': 'hdfs', 'cd_access': 'a'}
2018-08-06 19:21:53,882 - Directory['/tmp/hadoop-hdfs'] {'owner': 'hdfs', 'create_parents': True, 'cd_access': 'a'}
2018-08-06 19:21:53,889 - File['/usr/hdp/3.0.0.0-1634/hadoop/conf/commons-logging.properties'] {'content': Template('commons-logging.properties.j2'), 'owner': 'hdfs'}
2018-08-06 19:21:53,892 - File['/usr/hdp/3.0.0.0-1634/hadoop/conf/health_check'] {'content': Template('health_check.j2'), 'owner': 'hdfs'}
2018-08-06 19:21:53,902 - File['/usr/hdp/3.0.0.0-1634/hadoop/conf/log4j.properties'] {'content': InlineTemplate(...), 'owner': 'hdfs', 'group': 'hadoop', 'mode': 0644}
2018-08-06 19:21:53,918 - File['/usr/hdp/3.0.0.0-1634/hadoop/conf/hadoop-metrics2.properties'] {'content': Template('hadoop-metrics2.properties.j2'), 'owner': 'hdfs', 'group': 'hadoop'}
2018-08-06 19:21:53,920 - File['/usr/hdp/3.0.0.0-1634/hadoop/conf/task-log4j.properties'] {'content': StaticFile('task-log4j.properties'), 'mode': 0755}
2018-08-06 19:21:53,921 - File['/usr/hdp/3.0.0.0-1634/hadoop/conf/configuration.xsl'] {'owner': 'hdfs', 'group': 'hadoop'}
2018-08-06 19:21:53,927 - File['/etc/hadoop/conf/topology_mappings.data'] {'owner': 'hdfs', 'content': Template('topology_mappings.data.j2'), 'only_if': 'test -d /etc/hadoop/conf', 'group': 'hadoop', 'mode': 0644}
2018-08-06 19:21:53,932 - File['/etc/hadoop/conf/topology_script.py'] {'content': StaticFile('topology_script.py'), 'only_if': 'test -d /etc/hadoop/conf', 'mode': 0755}
2018-08-06 19:21:53,937 - Skipping unlimited key JCE policy check and setup since the Java VM is not managed by Ambari
2018-08-06 19:21:54,340 - Stack Feature Version Info: Cluster Stack=3.0, Command Stack=None, Command Version=3.0.0.0-1634, Upgrade Direction=upgrade -> 3.0.0.0-1634
2018-08-06 19:21:54,393 - File['/var/lib/ambari-agent/tmp/mysql-jdbc-driver.jar'] {'content': DownloadSource('http://r7u07.thanos.gotgdt.net:8080/resources/mysql-jdbc-driver.jar'), 'mode': 0644}
2018-08-06 19:21:54,394 - Not downloading the file from http://r7u07.thanos.gotgdt.net:8080/resources/mysql-jdbc-driver.jar, because /var/lib/ambari-agent/tmp/mysql-jdbc-driver.jar already exists
2018-08-06 19:21:54,395 - Execute[('cp', '--remove-destination', u'/var/lib/ambari-agent/tmp/mysql-jdbc-driver.jar', u'/usr/hdp/current/ranger-admin/ews/lib')] {'path': ['/bin', '/usr/bin/'], 'sudo': True}
2018-08-06 19:21:54,407 - File['/usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar'] {'mode': 0644}
2018-08-06 19:21:54,407 - Changing permission for /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar from 600 to 644
2018-08-06 19:21:54,408 - ModifyPropertiesFile['/usr/hdp/current/ranger-admin/install.properties'] {'owner': 'ranger', 'properties': ...}
2018-08-06 19:21:54,409 - Modifying existing properties file: /usr/hdp/current/ranger-admin/install.properties
2018-08-06 19:21:54,419 - File['/usr/hdp/current/ranger-admin/install.properties'] {'owner': 'ranger', 'content': ..., 'group': None, 'mode': None, 'encoding': 'utf-8'}
2018-08-06 19:21:54,420 - Writing File['/usr/hdp/current/ranger-admin/install.properties'] because contents don't match
2018-08-06 19:21:54,421 - ModifyPropertiesFile['/usr/hdp/current/ranger-admin/install.properties'] {'owner': 'ranger', 'properties': {'SQL_CONNECTOR_JAR': u'/usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar'}}
2018-08-06 19:21:54,421 - Modifying existing properties file: /usr/hdp/current/ranger-admin/install.properties
2018-08-06 19:21:54,422 - File['/usr/hdp/current/ranger-admin/install.properties'] {'owner': 'ranger', 'content': ..., 'group': None, 'mode': None, 'encoding': 'utf-8'}
2018-08-06 19:21:54,423 - ModifyPropertiesFile['/usr/hdp/current/ranger-admin/install.properties'] {'owner': 'ranger', 'properties': {'audit_store': u'solr'}}
2018-08-06 19:21:54,423 - Modifying existing properties file: /usr/hdp/current/ranger-admin/install.properties
2018-08-06 19:21:54,425 - File['/usr/hdp/current/ranger-admin/install.properties'] {'owner': 'ranger', 'content': ..., 'group': None, 'mode': None, 'encoding': 'utf-8'}
2018-08-06 19:21:54,425 - Setting up Ranger DB and DB User
2018-08-06 19:21:54,425 - Execute['ambari-python-wrap /usr/hdp/current/ranger-admin/dba_script.py -q'] {'logoutput': True, 'environment': {'RANGER_ADMIN_HOME': u'/usr/hdp/current/ranger-admin', 'JAVA_HOME': u'/usr/java/default'}, 'user': 'ranger'}
2018-08-06 19:21:54,643  [I] Running DBA setup script. QuiteMode:True
2018-08-06 19:21:54,643  [I] Using Java:/usr/java/default/bin/java
2018-08-06 19:21:54,643  [I] DB FLAVOR:MYSQL
2018-08-06 19:21:54,643  [I] DB Host:r7u07.thanos.gotgdt.net
2018-08-06 19:21:54,643  [I] ---------- Verifying DB root password ---------- 
2018-08-06 19:21:54,644  [I] DBA root user password validated
2018-08-06 19:21:54,644  [I] ---------- Verifying Ranger Admin db user password ---------- 
2018-08-06 19:21:54,644  [I] admin user password validated
2018-08-06 19:21:54,644  [I] ---------- Creating Ranger Admin db user ---------- 
2018-08-06 19:21:54,644  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/mysql -u root -p '********' -noheader -trim -c \; -query "SELECT version();"
2018-08-06 19:21:55,093  [I] Verifying user rangeradmin for Host %
2018-08-06 19:21:55,093  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/mysql -u root -p '********' -noheader -trim -c \; -query "select user from mysql.user where user='rangeradmin' and host='%';"
2018-08-06 19:21:55,528  [I] MySQL user rangeradmin already exists for host %
2018-08-06 19:21:55,528  [I] Verifying user rangeradmin for Host localhost
2018-08-06 19:21:55,528  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/mysql -u root -p '********' -noheader -trim -c \; -query "select user from mysql.user where user='rangeradmin' and host='localhost';"
2018-08-06 19:21:55,992  [I] MySQL user rangeradmin already exists for host localhost
2018-08-06 19:21:55,993  [I] Verifying user rangeradmin for Host r7u07.thanos.gotgdt.net
2018-08-06 19:21:55,993  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/mysql -u root -p '********' -noheader -trim -c \; -query "select user from mysql.user where user='rangeradmin' and host='r7u07.thanos.gotgdt.net';"
2018-08-06 19:21:56,429  [I] MySQL user rangeradmin already exists for host r7u07.thanos.gotgdt.net
2018-08-06 19:21:56,430  [I] ---------- Creating Ranger Admin database ----------
2018-08-06 19:21:56,430  [I] Verifying database ranger
2018-08-06 19:21:56,430  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/mysql -u root -p '********' -noheader -trim -c \; -query "show databases like 'ranger';"
2018-08-06 19:21:56,888  [I] Database ranger already exists.
2018-08-06 19:21:56,889  [I] ---------- Granting permission to Ranger Admin db user ----------
2018-08-06 19:21:56,889  [I] ---------- Granting privileges TO user 'rangeradmin'@'%' on db 'ranger'----------
2018-08-06 19:21:56,889  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/mysql -u root -p '********' -noheader -trim -c \; -query "grant all privileges on ranger.* to 'rangeradmin'@'%' with grant option;"
2018-08-06 19:21:57,337  [I] ---------- FLUSH PRIVILEGES ----------
2018-08-06 19:21:57,338  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/mysql -u root -p '********' -noheader -trim -c \; -query "FLUSH PRIVILEGES;"
2018-08-06 19:21:57,820  [I] Privileges granted to 'rangeradmin' on 'ranger'
2018-08-06 19:21:57,820  [I] ---------- Granting privileges TO user 'rangeradmin'@'localhost' on db 'ranger'----------
2018-08-06 19:21:57,821  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/mysql -u root -p '********' -noheader -trim -c \; -query "grant all privileges on ranger.* to 'rangeradmin'@'localhost' with grant option;"
2018-08-06 19:21:58,267  [I] ---------- FLUSH PRIVILEGES ----------
2018-08-06 19:21:58,267  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/mysql -u root -p '********' -noheader -trim -c \; -query "FLUSH PRIVILEGES;"
2018-08-06 19:21:58,715  [I] Privileges granted to 'rangeradmin' on 'ranger'
2018-08-06 19:21:58,715  [I] ---------- Granting privileges TO user 'rangeradmin'@'r7u07.thanos.gotgdt.net' on db 'ranger'----------
2018-08-06 19:21:58,716  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/mysql -u root -p '********' -noheader -trim -c \; -query "grant all privileges on ranger.* to 'rangeradmin'@'r7u07.thanos.gotgdt.net' with grant option;"
2018-08-06 19:21:59,197  [I] ---------- FLUSH PRIVILEGES ----------
2018-08-06 19:21:59,197  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/mysql -u root -p '********' -noheader -trim -c \; -query "FLUSH PRIVILEGES;"
2018-08-06 19:21:59,642  [I] Privileges granted to 'rangeradmin' on 'ranger'
2018-08-06 19:21:59,642  [I] ---------- Ranger Policy Manager DB and User Creation Process Completed..  ---------- 
2018-08-06 19:21:59,660 - Execute['ambari-python-wrap /usr/hdp/current/ranger-admin/db_setup.py'] {'logoutput': True, 'environment': {'PATH': '/usr/sbin:/sbin:/usr/lib/ambari-server/*:/usr/lib64/qt-3.3/bin:/opt/anaconda/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin::/opt/bro/bin:/root/bin:/var/lib/ambari-agent', 'RANGER_ADMIN_HOME': u'/usr/hdp/current/ranger-admin', 'JAVA_HOME': u'/usr/java/default'}, 'user': 'ranger'}
2018-08-06 19:22:00,135  [I] DB FLAVOR :MYSQL
2018-08-06 19:22:00,136  [I] --------- Verifying Ranger DB connection ---------
2018-08-06 19:22:00,136  [I] Checking connection..
2018-08-06 19:22:00,136  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "SELECT version();"
2018-08-06 19:22:00,744  [I] Checking connection passed.
2018-08-06 19:22:00,744  [I] --------- Verifying version history table ---------
2018-08-06 19:22:00,745  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "show tables like 'x_db_version_h';"
2018-08-06 19:22:01,203  [I] Table x_db_version_h already exists in database 'ranger'
2018-08-06 19:22:01,203  [I] --------- Importing Ranger Core DB Schema ---------
2018-08-06 19:22:01,203  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = 'CORE_DB_SCHEMA' and active = 'Y';"
2018-08-06 19:22:01,666  [I] CORE_DB_SCHEMA is already imported
2018-08-06 19:22:01,666  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = 'DB_PATCHES' and inst_by = 'Ranger 1.1.0.3.0.0.0-1634' and active='Y';"
2018-08-06 19:22:02,097  [I] --------- Applying Ranger DB patches ---------
2018-08-06 19:22:02,097  [I] Executing patch on  ranger from file: 001-groupsource.sql
2018-08-06 19:22:02,098  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '001' and active = 'Y';"
2018-08-06 19:22:02,519  [I] Patch 001-groupsource.sql is already applied
2018-08-06 19:22:02,520  [I] Executing patch on  ranger from file: 002-policyname.sql
2018-08-06 19:22:02,520  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '002' and active = 'Y';"
2018-08-06 19:22:02,943  [I] Patch 002-policyname.sql is already applied
2018-08-06 19:22:02,943  [I] Executing patch on  ranger from file: 003-knoxrepo.sql
2018-08-06 19:22:02,943  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '003' and active = 'Y';"
2018-08-06 19:22:03,407  [I] Patch 003-knoxrepo.sql is already applied
2018-08-06 19:22:03,408  [I] Executing patch on  ranger from file: 004-assetconfigsize.sql
2018-08-06 19:22:03,408  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '004' and active = 'Y';"
2018-08-06 19:22:03,836  [I] Patch 004-assetconfigsize.sql is already applied
2018-08-06 19:22:03,837  [I] Executing patch on  ranger from file: 005-xtrxlogcolumnsize.sql
2018-08-06 19:22:03,837  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '005' and active = 'Y';"
2018-08-06 19:22:04,258  [I] Patch 005-xtrxlogcolumnsize.sql is already applied
2018-08-06 19:22:04,259  [I] Executing patch on  ranger from file: 006-createdefaultpublicgroup.sql
2018-08-06 19:22:04,259  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '006' and active = 'Y';"
2018-08-06 19:22:04,689  [I] Patch 006-createdefaultpublicgroup.sql is already applied
2018-08-06 19:22:04,690  [I] Executing patch on  ranger from file: 007-updateBlankPolicyName.sql
2018-08-06 19:22:04,690  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '007' and active = 'Y';"
2018-08-06 19:22:05,134  [I] Patch 007-updateBlankPolicyName.sql is already applied
2018-08-06 19:22:05,134  [I] Executing patch on  ranger from file: 008-removeTrailingSlash.sql
2018-08-06 19:22:05,134  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '008' and active = 'Y';"
2018-08-06 19:22:05,590  [I] Patch 008-removeTrailingSlash.sql is already applied
2018-08-06 19:22:05,591  [I] Executing patch on  ranger from file: 009-updated_schema.sql
2018-08-06 19:22:05,591  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '009' and active = 'Y';"
2018-08-06 19:22:06,029  [I] Patch 009-updated_schema.sql is already applied
2018-08-06 19:22:06,030  [I] Executing patch on  ranger from file: 010-users-and-groups-visibility.sql
2018-08-06 19:22:06,030  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '010' and active = 'Y';"
2018-08-06 19:22:06,453  [I] Patch 010-users-and-groups-visibility.sql is already applied
2018-08-06 19:22:06,454  [I] Executing patch on  ranger from file: 012-createusersyncuser.sql
2018-08-06 19:22:06,454  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '012' and active = 'Y';"
2018-08-06 19:22:06,908  [I] Patch 012-createusersyncuser.sql is already applied
2018-08-06 19:22:06,909  [I] Executing patch on  ranger from file: 013-permissionmodel.sql
2018-08-06 19:22:06,909  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '013' and active = 'Y';"
2018-08-06 19:22:07,387  [I] Patch 013-permissionmodel.sql is already applied
2018-08-06 19:22:07,388  [I] Executing patch on  ranger from file: 014-createkeyadmin.sql
2018-08-06 19:22:07,388  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '014' and active = 'Y';"
2018-08-06 19:22:07,834  [I] Patch 014-createkeyadmin.sql is already applied
2018-08-06 19:22:07,835  [I] Executing patch on  ranger from file: 016-updated-schema-for-tag-based-policy.sql
2018-08-06 19:22:07,835  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '016' and active = 'Y';"
2018-08-06 19:22:08,310  [I] Patch 016-updated-schema-for-tag-based-policy.sql is already applied
2018-08-06 19:22:08,310  [I] Executing patch on  ranger from file: 018-createtagsyncuser.sql
2018-08-06 19:22:08,311  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '018' and active = 'Y';"
2018-08-06 19:22:08,764  [I] Patch 018-createtagsyncuser.sql is already applied
2018-08-06 19:22:08,765  [I] Executing patch on  ranger from file: 019-create-indexes.sql
2018-08-06 19:22:08,765  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '019' and active = 'Y';"
2018-08-06 19:22:09,264  [I] Patch 019-create-indexes.sql is already applied
2018-08-06 19:22:09,264  [I] Executing patch on  ranger from file: 020-datamask-policy.sql
2018-08-06 19:22:09,265  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '020' and active = 'Y';"
2018-08-06 19:22:09,716  [I] Patch 020-datamask-policy.sql is already applied
2018-08-06 19:22:09,717  [I] Executing patch on  ranger from file: 021-update-tag-for-owner.sql
2018-08-06 19:22:09,717  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '021' and active = 'Y';"
2018-08-06 19:22:10,142  [I] Patch 021-update-tag-for-owner.sql is already applied
2018-08-06 19:22:10,143  [I] Executing patch on  ranger from file: 022-split-service-table.sql
2018-08-06 19:22:10,143  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '022' and active = 'Y';"
2018-08-06 19:22:10,569  [I] Patch 022-split-service-table.sql is already applied
2018-08-06 19:22:10,570  [I] Executing patch on  ranger from file: 023-add-unique-constraint-on-table-x_user.sql
2018-08-06 19:22:10,570  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '023' and active = 'Y';"
2018-08-06 19:22:11,014  [I] Patch 023-add-unique-constraint-on-table-x_user.sql is already applied
2018-08-06 19:22:11,014  [I] Executing patch on  ranger from file: 024-sortorder-column-size.sql
2018-08-06 19:22:11,015  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '024' and active = 'Y';"
2018-08-06 19:22:11,447  [I] Patch 024-sortorder-column-size.sql is already applied
2018-08-06 19:22:11,448  [I] Executing patch on  ranger from file: 025-create-schema-for-plugin-info.sql
2018-08-06 19:22:11,448  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '025' and active = 'Y';"
2018-08-06 19:22:11,893  [I] Patch 025-create-schema-for-plugin-info.sql is already applied
2018-08-06 19:22:11,893  [I] Executing patch on  ranger from file: 026-add-column-in-x_policy_export_audit.sql
2018-08-06 19:22:11,893  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '026' and active = 'Y';"
2018-08-06 19:22:12,360  [I] Patch 026-add-column-in-x_policy_export_audit.sql is already applied
2018-08-06 19:22:12,360  [I] Executing patch on  ranger from file: 027-sortorder-column-size.sql
2018-08-06 19:22:12,360  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '027' and active = 'Y';"
2018-08-06 19:22:12,816  [I] Patch 027-sortorder-column-size.sql is already applied
2018-08-06 19:22:12,816  [I] Executing patch on  ranger from file: 028-delete-xgroup-duplicate-references.sql
2018-08-06 19:22:12,816  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '028' and active = 'Y';"
2018-08-06 19:22:13,299  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '028' and active = 'N';"
2018-08-06 19:22:13,734  [I] Patch 028-delete-xgroup-duplicate-references.sql is being applied by some other process
2018-08-06 19:24:13,773  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '028' and active = 'N';"
2018-08-06 19:24:14,236  [I] Patch 028-delete-xgroup-duplicate-references.sql is being applied by some other process
2018-08-06 19:26:14,332  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '028' and active = 'N';"
2018-08-06 19:26:14,799  [I] Patch 028-delete-xgroup-duplicate-references.sql is being applied by some other process
2018-08-06 19:28:14,899  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '028' and active = 'N';"
2018-08-06 19:28:15,402  [I] Patch 028-delete-xgroup-duplicate-references.sql is being applied by some other process
2018-08-06 19:30:15,482  [JISQL] /usr/java/default/bin/java  -cp /usr/hdp/current/ranger-admin/ews/lib/mysql-jdbc-driver.jar:/usr/hdp/current/ranger-admin/jisql/lib/* org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://r7u07.thanos.gotgdt.net/ranger -u 'rangeradmin' -p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version = '028' and active = 'N';"
2018-08-06 19:30:15,970  [I] Patch 028-delete-xgroup-duplicate-references.sql is being applied by some other process

Command failed after 1 tries
2 REPLIES 2

Contributor

Was the upgrade performed from pre HDP 2.6.3? if so you might want to follow below document to remove duplicates from Ranger db.

HDP 2.6.3 introduces unique constraints on a few tables in Ranger DB. Depending upon your environment, Ranger DB may contain duplicate data in these tables prior to the upgrade. To make the upgrade faster, you can manually delete this duplicate data in Ranger DB before performing the upgrade.

These steps are optional, but recommended, and only needed for Ranger users. These should be performed after registering and installing the target HDP version but before actually performing the upgrade.

Ref: https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.2.2/bk_ambari-upgrade/content/upgrade_remove_du...

Contributor

@Aaron Bossert Please let me know if the above helps?