Red Hat Bugzilla – Bug 751778
Upgrade from rhq4.1.0 to rhq4.2.0 fails with error : relation "rhq_drift_def_template" does not exist
Last modified: 2012-11-27 18:39:51 EST
Description of problem:
Upgrading from rhq4.1.0 to rhq4.2.0 on postgres displays below error in server log:
"ERROR: relation "rhq_drift_def_template" does not exist".
After upgrade, clicking on platform name displays mesage "Resource with id  does not exist or is not accessible" in UI and the server log displays the errors "ERROR: relation "rhq_drift_def_template" does not exist".
Please find attached the server log.
Version-Release number of selected component (if applicable):
Java version "1.6.0_18"
Steps to Reproduce:
1. Install rhq4.1.0.
2. Upgrade to rhq4.2.0.
3. See the server log. It has errors like "ERROR: relation "rhq_drift_def_template" does not exist".
4. After upgrade, navigate to the 'Inventory->Platforms'.
5. Click on the platform.
6. It displays message "Resource with id  does not exist or is not accessible" and error "relation "rhq_drift_def_template" does not exist" in server log.
Upgrade from rhq4.1.0 to rhq4.2.0 fails with error "relation "rhq_drift_def_template" does not exist"
Upgrade should succeed.
Created attachment 532057 [details]
I also confirm this issue happening to me, although I'm on PostgreSQL 9.1.
The problem is not immediately obvious, I'll have to suck down the distros and try to recreate...
OK, I finally understand what is wrong with the upgrade from 4.1 to 4.2.
The problem is that we basically forgot about the fact that an initial
drift implementation actually went out with 4.1. As such we continued
to update schema spec 2.111 with data model changes when actually the
4.1 dbs are already at 2.114. So, basically, no schema changes are applied
during a 4.1 to 4.2 upgrade.
We need to revert 2.111 steps to the 4.1 version, and then make 2.115
perform the necessary updates.
This needed to be addressed for JON3, at least partially. Given that to
repair the upgrade for the RHQ 4.3 release we need to revert schema
spec 2.111 back to its RHQ 4.1 state, we could not release JON3 with
the current, incorrect, 2.111 even though for JON3 purposes it would
have worked (at least temporarily). Doing so would have left JON3 dbs
in a broken state for subsequent jon release upgrades.
master commit: 0034ed67e8d978e4599dfac2fd023ad77ea5a880
release_jon3.x commit: a34c91781076786d01102cd39dd8f828a368bbb3
RHQ 4.3 db upgrade testing should be performed with fully populated
drift-related data, and should wait until bug 753866 is on_qa (
basically, defer testing until you get on_qa for 753866)
JON3 db upgrade testing should be performed and then all drift testing
should take place on the upgraded db.
jon 3 db upgrade testing complete:
libor ---> postgres
mfoley ---> oracle
verification blocked by 753866 (per comment #5).
adding depends on 753866
There are some more complications with RHQ43 upgrades. RHQ 4.2 was
released with the wrong schema version (2.114, the same as RHQ 4.1).
This means that new 4.2 installs install a schema that is marked
as schema version 2.114 but whose schema actually reflects 2.115.
So,upgrades (meaning, installs choosing to keep existing data) from 4.1
to 4.2 are broken. And upgrades from 4.2 to 4.3 are/will be broken.
I think upgrades from 4.1 to 4.3 will work.
Also, if a 4.2 install has its schema version manually updated to
2.115 then an upgrade to 4.3 may work.
See 753866 for more...
...tested RHQ 4.1 upgrade to 4.3. observed upgrade error. adding attachments to document the failure.
Created attachment 546278 [details]
image of upgrade error
Created attachment 546279 [details]
text of upgrade error
Created attachment 546286 [details]
log of upgrade error
*** Bug 753866 has been marked as a duplicate of this bug. ***
master commit 04000903b57864003ee41a86e013ddcc39ec4789
Fix query syntax for Oracle compatibility
This was an oracle issue. Please re-test - the upgrade issues are mainly
drift related. Having drift data (some definitions with snapshots) in
the db is needed.