Description of problem: From spacewalk-list: I have check what are the rpm package version are installed vs what are available on the new repository for 0.3 and found that I was not up to date. I have done: Yum upgrade Then, when I run: [root@spacew up2date]# /usr/bin/spacewalk-schema-upgrade Schema upgrade: [spacewalk-schema-0.2.5-1.el5.sw] -> [spacewalk-schema-0.3.6-1.el5.sw] Searching for upgrade path: [spacewalk-schema-0.2.5-1] -> [spacewalk-schema-0.3.6-1] Searching for upgrade path: [spacewalk-schema-0.2.5] -> [spacewalk-schema-0.3.6] Searching for upgrade path: [spacewalk-schema-0.2] -> [spacewalk-schema-0.3] The path: [spacewalk-schema-0.2] -> [spacewalk-schema-0.3] Planing to run sqlplus with [/var/log/spacewalk/schema-upgrade/20081107-150935-script.sql] Hit Enter to continue or Ctrl+C to interrupt: Executing sqlplus, the logs are in /var/log/spacewalk/schema-upgrade/20081107-150935-*. Upgrade failed, please see log in [/var/log/spacewalk/schema-upgrade/]. Here is the content of /var/log/spacewalk/schema-upgrade/20081107-150401-begin.log SQL> whenever sqlerror exit sql.sqlcode SQL> SQL> update rhnVersionInfo 2 set label = 'schema-from', modified = sysdate 3 where label = 'schema'; update rhnVersionInfo * ERROR at line 1: ORA-00001: unique constraint (SPACEWALK.RHN_VERSIONINFO_LABEL_UQ) violated [...] Romain Version-Release number of selected component (if applicable): Upgrade from 0.1 to 0.2 and then from 0.2 to 0.3. How reproducible: Seems deterministic. Steps to Reproduce: 1. Install Spacewalk 0.1. 2. Upgrade to 0.2. 3. Try to upgrade to 0.3. Actual results: Error above. Expected results: No error. Additional info:
Cliff P. further said: Just to follow up quickly - issue was because of previous upgrade from 0.1 -> 0.2 - we attempt to create a duplicate entry. Gave a short term work around solution on IRC. We need to address/fix code for the /usr/bin/spacewalk-schema-upgrade command to not attempt to create duplicate 'schema-from' entries in the DB, but maybe delete the old upgrade entry or sequentially bump them up. Cliff
My original idea about the code was to have the full history of schema upgrades there. So I'd rather not delete them. I'm proposing to name the label schema-from-YYYYMMDD-HH24MISS, which should be unique-ish enough.
*** Bug 470887 has been marked as a duplicate of this bug. ***
Fix committed to RELEASE-0.3 in commit 714d65c51bfba73f8da6ff406694dc171e00e4ee and to master in commit e88eb34029f434c08e6775c14ab79b668bbd5336.
Packages spacewalk-schema-0.3.7-1.el4.sw and spacewalk-schema-0.3.7-1.el5.sw were built.
For the record, the mailing list thread can be found at https://www.redhat.com/archives/spacewalk-list/2008-November/msg00048.html
No error in log after upgrade from 0.1 -> 0.2 -> 0.4 VERIFIED