| Issue 2046: | Error during schema upgrade 73 to 74 - 'Duplicate entry' for a primary key in account groups | |
| 3 people starred this issue and may be notified of changes. | Back to list |
************************************************************ ***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW ***** ***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL ***** ***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC. ***** ***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS! ***** ************************************************************ Affected Version: What steps will reproduce the problem? 1. I have an existing gerrit DB (MySQL) with schema version 73 (gerrit 2.5.6). 2. I stopped gerrit, replaced gerrit.war with a link to 2.6.1 gerrit.war, and run "java -jar ./gerrit-2.6.1.war init --batch -d /srv/gerrit". What is the expected output? What do you see instead? - I expect schema upgrades from 73 to 74 (and then further). - Instead, I see this error during the 73->74 upgrade: Upgrading database schema from version 73 to 74 ... Exception in thread "main" com.google.gwtorm.server.OrmException: insert failure on account_group_includes_by_uuid at com.google.gwtorm.schema.sql.SqlDialect.convertError(SqlDialect.java:151) at com.google.gwtorm.jdbc.JdbcAccess.convertError(JdbcAccess.java:448) .... Caused by: java.sql.BatchUpdateException: Duplicate entry '9-214a46be33d2e356f3a71a53ea9aa4e1d8d2b4c1' for key 'PRIMARY' at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:2054) at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1467) .... Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '9-214a46be33d2e356f3a71a53ea9aa4e1d8d2b4c1' for key 'PRIMARY' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) I see an account group with group uuid "214a46be33d2e356f3a71a53ea9aa4e1d8d2b4c1" (without the leading "9-") in my DB. If I remove that specific group, it will just throw the same error on the next account group uuid. Please provide any additional information below. - I see the same error when trying to upgrade to 2.6 first (which is not surprising as it would run through the same schema upgrades)
Aug 5, 2013
#1
schniede...@gmail.com
Aug 5, 2013
Workaround that seems to work for me: - While at schema 73 (v2.5.6), truncate table account_group_includes - Then run the schema upgrades After that, the account group includes are still intact (they migrated to the new account_group_includes_uuid table). |
|
| ► Sign in to add a comment |