ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Haihui Xu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (RANGER-2234) Cannot add or update a child row,a foreign key constraint fails when installing ranger-admin
Date Wed, 26 Sep 2018 09:25:00 GMT

     [ https://issues.apache.org/jira/browse/RANGER-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Haihui Xu updated RANGER-2234:
------------------------------
    Description: 
Installing ranger-admin use mysql as the database,execute setup.sh, in progress something
happend, the error logs are as flowing:

2018-09-26 17:17:08,539 [I] Table xa_access_audit does not exist in database ranger
2018-09-26 17:17:08,539 [I] Importing db schema to database ranger from file: ranger_core_db_mysql.sql
2018-09-26 17:17:08,540 [JISQL] /home/ranger/jdk1.8.0_121/bin/java -cp /usr/share/java/mysql-connector-java.jar:/home/ranger/ranger-1.1.0-admin/jisql/lib/*
org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://10.139.16.75/ranger -u 'root'
-p '********' -noheader -trim -c \; -input /home/ranger/ranger-1.1.0-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
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,2,'ROLE_SYS_ADMIN',1); 
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or
update a child row: a foreign key constraint fails (`ranger`.`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 (`ranger`.`x_portal_user_role`,
CONSTRAINT `x_portal_user_role_FK_user_id` FOREIGN KEY (`user_id`) REFERENCES `x_portal_user`
(`id`)) ErrorCode: 1452
2018-09-26 17:22:20,882 [E] ranger_core_db_mysql.sql file import failed!

  was:
Installing ranger-admin use mysql as the database,execute setup.sh, in progress something
happend, the error logs are as flowing:

2018-09-21 01:46:51,570 [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java -cp /usr/bch/current/ranger-admin/ews/lib/mysql-connector-java.jar:/usr/bch/3.0.0/ranger-admin/jisql/lib/*
org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://bigcloudhc5/ranger -u 'ranger'
-p '********' -noheader -trim -c \; -input /usr/bch/3.0.0/ranger-admin/db/mysql/patches/006-createdefaultpublicgroup.sql
 Error executing: call insert_public_group_in_x_group_table();
 com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or
update a child row: a foreign key constraint fails (`ranger`.`x_group`, CONSTRAINT `x_group_FK_added_by_id`
FOREIGN KEY (`added_by_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 (`ranger`.`x_group`, CONSTRAINT
`x_group_FK_added_by_id` FOREIGN KEY (`added_by_id`) REFERENCES `x_portal_user` (`id`)) ErrorCode:
1452
 2018-09-21 01:46:52,005 [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java -cp /usr/bch/current/ranger-admin/ews/lib/mysql-connector-java.jar:/usr/bch/3.0.0/ranger-admin/jisql/lib/*
org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://bigcloudhc5/ranger -u 'ranger'
-p '********' -noheader -trim -c \; -query "select version from x_db_version_h where version
= '006' and active = 'Y';"
 2018-09-21 01:46:52,575 [JISQL] /usr/jdk64/jdk1.8.0_112/bin/java -cp /usr/bch/current/ranger-admin/ews/lib/mysql-connector-java.jar:/usr/bch/3.0.0/ranger-admin/jisql/lib/*
org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://bigcloudhc5/ranger -u 'ranger'
-p '********' -noheader -trim -c \; -query "delete from x_db_version_h where version='006'
and active='N' and updated_by='bigcloudhc7';"
 2018-09-21 01:46:53,036 [E] 006-createdefaultpublicgroup.sql import failed!


> Cannot add or update a child row,a foreign key constraint fails when installing ranger-admin
> --------------------------------------------------------------------------------------------
>
>                 Key: RANGER-2234
>                 URL: https://issues.apache.org/jira/browse/RANGER-2234
>             Project: Ranger
>          Issue Type: Bug
>          Components: admin, Ranger
>    Affects Versions: 1.1.0
>            Reporter: Haihui Xu
>            Assignee: Haihui Xu
>            Priority: Major
>              Labels: patch
>             Fix For: 2.0.0, 1.2.0
>
>
> Installing ranger-admin use mysql as the database,execute setup.sh, in progress something
happend, the error logs are as flowing:
> 2018-09-26 17:17:08,539 [I] Table xa_access_audit does not exist in database ranger
> 2018-09-26 17:17:08,539 [I] Importing db schema to database ranger from file: ranger_core_db_mysql.sql
> 2018-09-26 17:17:08,540 [JISQL] /home/ranger/jdk1.8.0_121/bin/java -cp /usr/share/java/mysql-connector-java.jar:/home/ranger/ranger-1.1.0-admin/jisql/lib/*
org.apache.util.sql.Jisql -driver mysqlconj -cstring jdbc:mysql://10.139.16.75/ranger -u 'root'
-p '********' -noheader -trim -c \; -input /home/ranger/ranger-1.1.0-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql
> 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,2,'ROLE_SYS_ADMIN',1); 
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add
or update a child row: a foreign key constraint fails (`ranger`.`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 (`ranger`.`x_portal_user_role`,
CONSTRAINT `x_portal_user_role_FK_user_id` FOREIGN KEY (`user_id`) REFERENCES `x_portal_user`
(`id`)) ErrorCode: 1452
> 2018-09-26 17:22:20,882 [E] ranger_core_db_mysql.sql file import failed!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message