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

Review DB schema for max key length restrictions - MySQL

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.5.0
    • Fix Version/s: 0.7.0
    • Component/s: admin
    • Labels:
      None

      Description

      Ranger DB schema creation failed with error "Specified key was too long; max key length is 767 bytes", while installing ranger-0.5 against MySQL 5.5 with Tungsten Replication enabled.

      2015-09-10 14:03:43,123 I Executing patch on ranger from file: 009-updated_schema.sql
      Error executing: CREATE TABLE `x_service` ( `id` bigint(20) NOT NULL AUTO_INCREMENT , `guid` varchar(1024) DEFAULT NULL, `create_time` datetime DEFAULT NULL, `update_time` datetime DEFAULT NULL, `added_by_id` bigint(20) DEFAULT NULL, `upd_by_id` bigint(20) DEFAULT NULL, `version` bigint(20) DEFAULT NULL, `type` bigint(20) DEFAULT NULL, `name` varchar(512) DEFAULT NULL, `policy_version` bigint(20) DEFAULT NULL, `policy_update_time`datetime DEFAULT NULL, `description` varchar(1024) DEFAULT NULL, `is_enabled` tinyint(1) NOT NULL DEFAULT '0', primary key (`id`), UNIQUE KEY `X_service_name` (`name`), KEY `x_service_added_by_id` (`added_by_id`), KEY `x_service_upd_by_id` (`upd_by_id`), KEY `x_service_cr_time` (`create_time`), KEY `x_service_up_time` (`update_time`), KEY `x_service_type` (`type`), CONSTRAINT `x_service_FK_added_by_id` FOREIGN KEY (`added_by_id`) REFERENCES `x_portal_user` (`id`), CONSTRAINT `x_service_FK_upd_by_id` FOREIGN KEY (`upd_by_id`) REFERENCES `x_portal_user` (`id`), CONSTRAINT `x_service_FK_type` FOREIGN KEY (`type`) REFERENCES `x_service_def` (`id`) );
      com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes
      SQLException : SQL state: 42000 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes ErrorCode: 1071
      2015-09-10 14:03:43,787 E 009-updated_schema.sql import failed!

      To get the installation to succeed, ranger databases were pre-created by explicitly specifying 'latin1' CHARACTER SET, as shown below:

      create database ranger CHARACTER SET=latin1;
      create database ranger_audit CHARACTER SET=latin1;

      Ranger DB schema (and/or schema documentation or creation scripts) should be reviewed to address this issue.

        Attachments

          Activity

            People

            • Assignee:
              pradeep Pradeep Agrawal
              Reporter:
              madhan Madhan Neethiraj
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: