[
https://issues.apache.org/jira/browse/RANGER-2459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
lpz updated RANGER-2459:
------------------------
Description:
Installing ranger-admin use mysql as the database,execute setup.sh, in progress
something happend, the error logs are as flowing:[^install.properties]
2019-06-05 10:18:11,332 [I] Importing db schema to database rangerw from file:
ranger_core_db_mysql.sql
2019-06-05 10:18:11,333 [JISQL] /usr/bin/java -cp
/usr/share/java/mysql-connector-java.jar:/usr/hdp/3.1.0.0-78/ranger-admin/jisql/lib/*
org.apache.util.sql.Jisql -driver mysqlconj -cstring
jdbc:mysql://192.168.128.54:3306/rangerw -u 'dtdream' -p '********' -noheader
-trim -c \; -input
/usr/hdp/3.1.0.0-78/ranger-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8
Error executing: INSERT INTO
x_portal_user_role(create_time,update_time,added_by_id,upd_by_id,user_id,user_role,status)
VALUES (UTC_TIMESTAMP(),UTC_TIMESTAMP(),NULL,NULL,3,'ROLE_KEY_ADMIN',1);
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Cannot add or update a child row: a foreign key constraint fails
(`rangerw`.`x_portal_user_role`, CONSTRAINT `x_portal_user_role_FK_user_id`
FOREIGN KEY (`user_id`) REFERENCES `x_portal_user` (`id`))
SQLException : SQL state: 23000
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Cannot add or update a child row: a foreign key constraint fails
(`rangerw`.`x_portal_user_role`, CONSTRAINT `x_portal_user_role_FK_user_id`
FOREIGN KEY (`user_id`) REFERENCES `x_portal_user` (`id`)) ErrorCode: 1452
2019-06-05 10:18:15,743 [E] ranger_core_db_mysql.sql file import failed!
2019-06-05 10:18:15,743 [I] Unable to create DB schema, Please drop the
database and try again
2019-06-05 10:18:15,743 [JISQL] /usr/bin/java -cp
/usr/share/java/mysql-connector-java.jar:/usr/hdp/3.1.0.0-78/ranger-admin/jisql/lib/*
org.apache.util.sql.Jisql -driver mysqlconj -cstring
jdbc:mysql://192.168.128.54:3306/rangerw -u 'dtdream' -p '********' -noheader
-trim -c \; -query "delete from x_db_version_h where version='CORE_DB_SCHEMA'
and active='N' and updated_by='a74c221a2b48';"
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8
2019-06-05 10:18:16,251 [E] CORE_DB_SCHEMA import failed!
was:
2019-06-05 10:18:11,332 [I] Importing db schema to database rangerw from file:
ranger_core_db_mysql.sql
2019-06-05 10:18:11,333 [JISQL] /usr/bin/java -cp
/usr/share/java/mysql-connector-java.jar:/usr/hdp/3.1.0.0-78/ranger-admin/jisql/lib/*
org.apache.util.sql.Jisql -driver mysqlconj -cstring
jdbc:mysql://192.168.128.54:3306/rangerw -u 'dtdream' -p '********' -noheader
-trim -c \; -input
/usr/hdp/3.1.0.0-78/ranger-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8
Error executing: INSERT INTO
x_portal_user_role(create_time,update_time,added_by_id,upd_by_id,user_id,user_role,status)
VALUES (UTC_TIMESTAMP(),UTC_TIMESTAMP(),NULL,NULL,3,'ROLE_KEY_ADMIN',1);
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Cannot add or update a child row: a foreign key constraint fails
(`rangerw`.`x_portal_user_role`, CONSTRAINT `x_portal_user_role_FK_user_id`
FOREIGN KEY (`user_id`) REFERENCES `x_portal_user` (`id`))
SQLException : SQL state: 23000
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Cannot add or update a child row: a foreign key constraint fails
(`rangerw`.`x_portal_user_role`, CONSTRAINT `x_portal_user_role_FK_user_id`
FOREIGN KEY (`user_id`) REFERENCES `x_portal_user` (`id`)) ErrorCode: 1452
2019-06-05 10:18:15,743 [E] ranger_core_db_mysql.sql file import failed!
2019-06-05 10:18:15,743 [I] Unable to create DB schema, Please drop the
database and try again
2019-06-05 10:18:15,743 [JISQL] /usr/bin/java -cp
/usr/share/java/mysql-connector-java.jar:/usr/hdp/3.1.0.0-78/ranger-admin/jisql/lib/*
org.apache.util.sql.Jisql -driver mysqlconj -cstring
jdbc:mysql://192.168.128.54:3306/rangerw -u 'dtdream' -p '********' -noheader
-trim -c \; -query "delete from x_db_version_h where version='CORE_DB_SCHEMA'
and active='N' and updated_by='a74c221a2b48';"
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8
2019-06-05 10:18:16,251 [E] CORE_DB_SCHEMA import failed!
> [E] ranger_core_db_mysql.sql file import failed!
> ------------------------------------------------
>
> Key: RANGER-2459
> URL: https://issues.apache.org/jira/browse/RANGER-2459
> Project: Ranger
> Issue Type: Bug
> Components: admin, Ranger
> Affects Versions: 1.2.0
> Environment: docker centos7.2 java1.8
> ranger_3_1_0_0_78-admin-1.2.0.3.1.0.0-78.x86_64
> Reporter: lpz
> Priority: Major
> Labels: patch
> Attachments: install.properties
>
>
> Installing ranger-admin use mysql as the database,execute setup.sh, in
> progress something happend, the error logs are as
> flowing:[^install.properties]
>
> 2019-06-05 10:18:11,332 [I] Importing db schema to database rangerw from
> file: ranger_core_db_mysql.sql
> 2019-06-05 10:18:11,333 [JISQL] /usr/bin/java -cp
> /usr/share/java/mysql-connector-java.jar:/usr/hdp/3.1.0.0-78/ranger-admin/jisql/lib/*
> org.apache.util.sql.Jisql -driver mysqlconj -cstring
> jdbc:mysql://192.168.128.54:3306/rangerw -u 'dtdream' -p '********' -noheader
> -trim -c \; -input
> /usr/hdp/3.1.0.0-78/ranger-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
> Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8
> Error executing: INSERT INTO
> x_portal_user_role(create_time,update_time,added_by_id,upd_by_id,user_id,user_role,status)
> VALUES (UTC_TIMESTAMP(),UTC_TIMESTAMP(),NULL,NULL,3,'ROLE_KEY_ADMIN',1);
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
> Cannot add or update a child row: a foreign key constraint fails
> (`rangerw`.`x_portal_user_role`, CONSTRAINT `x_portal_user_role_FK_user_id`
> FOREIGN KEY (`user_id`) REFERENCES `x_portal_user` (`id`))
> SQLException : SQL state: 23000
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
> Cannot add or update a child row: a foreign key constraint fails
> (`rangerw`.`x_portal_user_role`, CONSTRAINT `x_portal_user_role_FK_user_id`
> FOREIGN KEY (`user_id`) REFERENCES `x_portal_user` (`id`)) ErrorCode: 1452
> 2019-06-05 10:18:15,743 [E] ranger_core_db_mysql.sql file import failed!
> 2019-06-05 10:18:15,743 [I] Unable to create DB schema, Please drop the
> database and try again
> 2019-06-05 10:18:15,743 [JISQL] /usr/bin/java -cp
> /usr/share/java/mysql-connector-java.jar:/usr/hdp/3.1.0.0-78/ranger-admin/jisql/lib/*
> org.apache.util.sql.Jisql -driver mysqlconj -cstring
> jdbc:mysql://192.168.128.54:3306/rangerw -u 'dtdream' -p '********' -noheader
> -trim -c \; -query "delete from x_db_version_h where version='CORE_DB_SCHEMA'
> and active='N' and updated_by='a74c221a2b48';"
> Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8
> 2019-06-05 10:18:16,251 [E] CORE_DB_SCHEMA import failed!
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)