ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pradeep Agrawal <pradeepagrawal8...@gmail.com>
Subject Re: Review Request 69028: RANGER-2234 : Cannot add or update a child row, a foreign key constraint fails when installing ranger-admin
Date Mon, 15 Oct 2018 14:26:27 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/69028/#review209544
-----------------------------------------------------------




security-admin/db/mysql/patches/013-permissionmodel.sql
Line 28 (original), 28 (patched)
<https://reviews.apache.org/r/69028/#comment294058>

    try removing hard-coding of ID's from this table also.


- Pradeep Agrawal


On Oct. 15, 2018, 1:29 p.m., Akash Pawale wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69028/
> -----------------------------------------------------------
> 
> (Updated Oct. 15, 2018, 1:29 p.m.)
> 
> 
> Review request for ranger, Ankita Sinha, Don Bosco Durai, Gautam Borad, Abhay Kulkarni,
Madhan Neethiraj, Mehul Parikh, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, Sailaja
Polavarapu, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-2234
>     https://issues.apache.org/jira/browse/RANGER-2234
> 
> 
> Repository: ranger
> 
> 
> 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] 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!
> 
> 
> Diffs
> -----
> 
>   security-admin/db/mysql/optimized/current/ranger_core_db_mysql.sql 32cf6db 
>   security-admin/db/mysql/patches/013-permissionmodel.sql 381bb6f 
>   security-admin/db/oracle/optimized/current/ranger_core_db_oracle.sql 2e577f3 
>   security-admin/db/oracle/patches/013-permissionmodel.sql 4ac7901 
>   security-admin/db/oracle/patches/016-updated-schema-for-tag-based-policy.sql 12627f5

>   security-admin/db/postgres/optimized/current/ranger_core_db_postgres.sql bad32ef 
>   security-admin/db/sqlanywhere/optimized/current/ranger_core_db_sqlanywhere.sql 9482992

>   security-admin/db/sqlserver/optimized/current/ranger_core_db_sqlserver.sql 85f3285

>   security-admin/db/sqlserver/patches/016-updated-schema-for-tag-based-policy.sql 4b856d7

> 
> 
> Diff: https://reviews.apache.org/r/69028/diff/1/
> 
> 
> Testing
> -------
> 
> Done testing for all Db flavors
> DB_FLAVOR=MYSQL|ORACLE|POSTGRES|MSSQL|SQLA
> 
> ranger_core_db_mysql.sql, ranger_core_db_sqlserver.sql, ranger_core_db_oracle.sql, ranger_core_db_postgres.sql,
ranger_core_db_sqlanywhere.sql files importing successfully.
> 
> 
> Thanks,
> 
> Akash Pawale
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message