Description of problem: The upgrade from schema version 2.91 to version 2.92 failed for me with the following: [dbupgrade] Upgrading: [2.91] -> [2.92] [schemaSpec] Executing the task [class org.rhq.core.db.ant.dbupgrade.SST_DirectSQL] in schema spec version [2.92] [statement] Executing direct SQL. Description=[Upgrading configuration permissions] : SQL=[ [statement] INSERT INTO RHQ_PERMISSION (ROLE_ID, OPERATION) [statement] SELECT PERM.ROLE_ID, 13 [statement] FROM RHQ_PERMISSION PERM [statement] WHERE PERM.OPERATION = 11 [statement] ] [DEBUG] {DatabaseType.executing-sql}Executing the following SQL: INSERT INTO RHQ_PERMISSION (ROLE_ID, OPERATION) SELECT PERM.ROLE_ID, 13 FROM RHQ_PERMISSION PERM WHERE PERM.OPERATION = 11 [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error executing ant tasks Embedded error: The following error occurred while executing this line: /home/metlos/Projects/java/jon/git/rhq/modules/core/dbutils/src/main/scripts/dbsetup-build.xml:282: The following error occurred while executing this line: /home/metlos/Projects/java/jon/git/rhq/modules/core/dbutils/src/main/scripts/dbsetup-build.xml:306: The following error occurred while executing this line: /home/metlos/Projects/java/jon/git/rhq/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml:27: Failed to upgrade - error in spec version [2.92]. Cause: Error executing the task [org.rhq.core.db.ant.dbupgrade.SST_DirectSQL] in schema spec version [2.92]. Cause: The schema spec task [DirectSQL] has encountered an error. Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "rhq_permission_pk" Steps to Reproduce: 1. mvn install -Ddb=dev -Ddbsetup-upgrade Actual results: Can't upgrade the database. Expected results: Database upgraded.
Git history shows Joe as the one who committed db.upgrade rev2.92
Root cause is: ERROR: duplicate key value violates unique constraint "rhq_permission_pk" Any idea how you might have hit that?
was there a time when we introduced the new privs in release-3.0.0 and then removed them again? maybe that's how the privs got in in db version < 2.92? which would mean this is a non-issue.
did you work in two different branches - release and master - and switch back and forth between them? if so, there's a possibility that schemaSpec X was schemaSpec X+offset in the other branch, which would cause upgrade issues like you're seeing.