Failed to install schema using Sonar and MySQL 5.6 on windows

I have installed Sonar 3.4.1 and Mysql 5.6.10 on a windows machine.

I created a mysql schema "sonar" and gave all permissions to it to the "sonar" user. I have configured my sonar to use this user. I did this by following the instructions on the code-behind sonar page .

When the sonar starts, it starts creating tables in the diagram. At some point, an error occurs indicating that "The specified key was too long, the maximum key length is 767 bytes" (complete error message at the end).

As per this question, index length is limited in mysql. Since this is documented, I would expect Sonar to not create indexes longer than the limit. He's obviously trying to do it.

Am I missing some important configuration or are the two versions of sonar and mysql incompatible? What can I do to get it to work with these versions?

Complete error message:

INFO | jvm 1 | 2013/02/11 11:28:25 |
INFO | jvm 1 | 2013/02/11 11:28:25 | == CreateProperties: migrating ============================================ ==
INFO | jvm 1 | 2013/02/11 11:28:25 | - create_table ("properties")
INFO | jvm 1 | 2013/02/11 11:28:25 | -> 0.0320s
INFO | jvm 1 | 2013/02/11 11:28:25 | -> 0 rows
INFO | jvm 1 | 2013/02/11 11:28:25 | - add_index (: properties,: prop_key, {: name => "properties_key"})
2013.02.11 11:28:25 ERROR jruby.rack unable to create shared application instance
org.jruby.rack.RackInitializationException: An error has occurred, all later migrations canceled:

ActiveRecord :: JDBCError: Specified key was too long; max key length is 767 bytes: CREATE INDEX `properties_key` ON` properties` (`prop_key`)
    from D: /Programs/sonar-3.4.1/war/sonar-server/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb: 183: in ` execute '
[stacktrace omitted]
org.jruby.exceptions.RaiseException: (StandardError) An error has occurred, all later migrations canceled:

ActiveRecord :: JDBCError: Specified key was too long; max key length is 767 bytes: CREATE INDEX `properties_key` ON` properties` (`prop_key`)
2013.02.11 11:28:25 ERROR jruby.rack Error: application initialization failed
org.jruby.rack.RackInitializationException: An error has occurred, all later migrations canceled:

ActiveRecord :: JDBCError: Specified key was too long; max key length is 767 bytes: CREATE INDEX `properties_key` ON` properties` (`prop_key`)
    from D: /Programs/sonar-3.4.1/war/sonar-server/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/jdbc/adapter.rb: 183: in ` execute '
[stacktrace omitted]
org.jruby.exceptions.RaiseException: (StandardError) An error has occurred, all later migrations canceled:

ActiveRecord :: JDBCError: Specified key was too long; max key length is 767 bytes: CREATE INDEX `properties_key` ON` properties` (`prop_key`)
INFO | jvm 1 | 2013/02/11 11:28:25 | 2013-02-11 11: 28: 25.421: INFO :: Started SelectChannelConnector@0.0.0.0 : 9000
+3


source to share


1 answer


You are correct, some indexes are created with a length greater than the maximum limit. The problem is that MySQL 5.6 no longer truncates indexes. This behavior doesn't seem to be expected (see http://dev.mysql.com/doc/refman/5.6/en/innodb-restrictions.html and the error http://bugs.mysql.com/bug.php?id = 68453 ).



Anything to say that Sonar 3.5 fixes this problem by creating indexes with the correct length (see http://jira.codehaus.org/browse/SONAR-4137 ).

+2


source







All Articles