This is in upgrade step 2.144: <schema-createSequence name="RHQ_AGENT_INSTALL_SEQ" initial="10001" /> this is the wrong name. It should have _ID_ in the name: <schema-createSequence name="RHQ_AGENT_INSTALL_ID_SEQ" initial="10001" /> I am going to fix this directly in 2.144 rather than in a new db upgrade step. Here's why. the dbsetup (for those people installing to a clean, empty DB) get the good sequence name. The problem ONLY happens if you upgrade from an earlier RHQ schema to 2.144. Therefore, those folks that install clean will have a GOOD sequence name and don't need any fix. If I create a new db upgrade step to rename or delete the bad sequence, those users where nothing is wrong will get errors when they attempt to later upgrade to RHQ 4.12. For those users where there is a problem (where they upgraded from an older schema to this one with the bad sequence name) they are broken bad - agents won't be able to register. So they need a quick fix - they will have to rename the sequence manually through direct SQL. At this point, they will have a good sequence name, and no further db upgrade steps will be needed for them (just like those folks that installed to a clean DB). So fixing schema 2.144 will fix people upgrading from 4.10 or earlier to 4.12. 4.11 db upgrade is just bad and requires a manual SQL to fix. For postgres, the SQL is: alter sequence rhq_agent_install_seq rename to rhq_agent_install_id_seq For oracle, the SQL is: rename rhq_agent_install_seq rename to rhq_agent_install_id_seq
> If I create a new db upgrade step to rename or delete the bad sequence, those > users where nothing is wrong will get errors when they attempt to later upgrade > to RHQ 4.12. Jay reminded me we can do ignoreErrors=true to avoid errors. But I still think its easier and cleaner to fix schema 2.144 inline rather than make another db upgrade step, because that isn't going to help anyone anyway. Those that already upgraded to 4.11 will need to manually apply the SQL regardless. Those that installed 4.11 clean it doesn't matter - they get to schema 2.144 with the good name and any future db upgrade will be fine.
git commit to master: a77dc95
In the description, I gave a bad Oracle SQL statement. Here's how to manually fix: For postgres, the SQL is: alter sequence rhq_agent_install_seq rename to rhq_agent_install_id_seq For oracle, the SQL is: rename rhq_agent_install_seq to rhq_agent_install_id_seq
Hey thanks for the heads-up. Would it be possible for me to change it directly in rhq-core-dbutils-4.11.0.jar by modifying db-upgrade.xml before doing the upgrade? This way I could avoid doing changes directly to the DB after the fact? The file is located two places so not sure if any difference: org\rhq\rhq-installer-util\main\rhq-core-dbutils-4.11.0.jar org\rhq\server-startup\main\deployments\rhq.ear\lib\rhq-core-dbutils-4.11.0.jar
(In reply to Stian Lund from comment #4) > Hey thanks for the heads-up. > > Would it be possible for me to change it directly in > rhq-core-dbutils-4.11.0.jar by modifying db-upgrade.xml before doing the > upgrade? This way I could avoid doing changes directly to the DB after the > fact? > > The file is located two places so not sure if any difference: > org\rhq\rhq-installer-util\main\rhq-core-dbutils-4.11.0.jar > org\rhq\server-startup\main\deployments\rhq.ear\lib\rhq-core-dbutils-4.11.0. > jar Yes, if you go into the db-upgrade.xml and change the schema 2.144 upgrade step, rename the sequence to the proper name and your upgrade should work. I think the important one to change is the one in the rhq-installer-util's jar. You can change that one, test it to make sure it works on a test machine, and then you know for your real upgrades. Otherwise, just change both. But since I believe its the installer that is the thing that upgrades the schema, I would think its the install-util's jar that has to change.
This issue still persists in 4.12. Release notes have been updated to reflect this. I will reissue the patch to 4.13 (the previous patch was overridden with a bad merge).
Fixed in master: commit c7d22c367a373dfd51485b13c814565bb0818287 Author: Michael Burman <miburman> Date: Thu Aug 14 19:01:34 2014 +0300 [BZ 1095970] Reapplying patch to fix incorrect sequence name
Bulk close of items fixed in RHQ 4.12 If you think this is not solved, then please open a *new* BZ and link to this one.