[jira] [Commented] (RANGER-2234) Cannot add or update a child row,a foreign key constraint fails when installing ranger-admin

2019-01-23 Thread Pradeep Agrawal (JIRA)


[ 
https://issues.apache.org/jira/browse/RANGER-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16749685#comment-16749685
 ] 

Pradeep Agrawal commented on RANGER-2234:
-

Patch committed to master branch : 
https://github.com/apache/ranger/commit/14d20f88ad012ed5054dc81583be7419b553688c

> 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: Akash Pawale
>Priority: Major
>  Labels: patch
> Fix For: 2.0.0
>
> Attachments: RANGER-2234-02.patch, RANGER-2234-03.patch, 
> RANGER-2234_Cannot add or update a child row,a foreign key constraint fails 
> when installing ranger-admin.patch
>
>
> 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)


[jira] [Commented] (RANGER-2234) Cannot add or update a child row,a foreign key constraint fails when installing ranger-admin

2018-09-26 Thread Velmurugan Periasamy (JIRA)


[ 
https://issues.apache.org/jira/browse/RANGER-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16628749#comment-16628749
 ] 

Velmurugan Periasamy commented on RANGER-2234:
--

[~Seymour Xu] - this probably is caused by DB config (auto increment value). I 
am moving this out of 1.2.0. Let's get a fix for next release. 

ping [~pradeepagrawal8184]/[~vishal.suvagia]

> 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
>
> Attachments: RANGER-2234_Cannot add or update a child row,a foreign 
> key constraint fails when installing ranger-admin.patch
>
>
> 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)


[jira] [Commented] (RANGER-2234) Cannot add or update a child row,a foreign key constraint fails when installing ranger-admin

2018-09-26 Thread Haihui Xu (JIRA)


[ 
https://issues.apache.org/jira/browse/RANGER-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16628485#comment-16628485
 ] 

Haihui Xu commented on RANGER-2234:
---

The same error may be occurs when executing  
ranger_core_db_postgres.sql/ranger_core_db_sqlanywhere.sql

> 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
>
> Attachments: RANGER-2234_Cannot add or update a child row,a foreign 
> key constraint fails when installing ranger-admin.patch
>
>
> 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)


[jira] [Commented] (RANGER-2234) Cannot add or update a child row,a foreign key constraint fails when installing ranger-admin

2018-09-26 Thread Haihui Xu (JIRA)


[ 
https://issues.apache.org/jira/browse/RANGER-2234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16628472#comment-16628472
 ] 

Haihui Xu commented on RANGER-2234:
---

when 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); 
user_id value is 2, but the table x_portal_user does not exists id=2 row data. 
The cause is the primary key  auto_increment may not add 1 each time.

> 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)