Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-2459

[E] ranger_core_db_mysql.sql file import failed!

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Implemented
    • Affects Version/s: 1.2.0
    • Fix Version/s: 2.0.0
    • Component/s: admin, Ranger
    • Labels:
    • Environment:
      docker centos7.2 java1.8 ranger_3_1_0_0_78-admin-1.2.0.3.1.0.0-78.x86_64

      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!

        Attachments

          Activity

            People

            • Assignee:
              pradeep Pradeep Agrawal
              Reporter:
              lpz lpz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: