Bug 470791

Summary: Upgrading issues from 02 to 03
Product: [Community] Spacewalk Reporter: Jan Pazdziora <jpazdziora>
Component: InstallationAssignee: Jan Pazdziora <jpazdziora>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 0.3CC: jesusr, msuchy, romain.pelissier
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-22 16:30:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 456551, 456552    

Description Jan Pazdziora 2008-11-10 10:29:26 UTC
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:

Comment 1 Jan Pazdziora 2008-11-10 10:31:58 UTC
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

Comment 2 Jan Pazdziora 2008-11-10 10:33:26 UTC
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.

Comment 3 Jan Pazdziora 2008-11-10 19:14:45 UTC
*** Bug 470887 has been marked as a duplicate of this bug. ***

Comment 4 Jan Pazdziora 2008-11-11 13:47:51 UTC
Fix committed to RELEASE-0.3 in commit 714d65c51bfba73f8da6ff406694dc171e00e4ee
and to master in commit e88eb34029f434c08e6775c14ab79b668bbd5336.

Comment 5 Jan Pazdziora 2008-11-11 13:55:19 UTC
Packages spacewalk-schema-0.3.7-1.el4.sw and spacewalk-schema-0.3.7-1.el5.sw were built.

Comment 6 Jan Pazdziora 2008-11-11 13:57:45 UTC
For the record, the mailing list thread can be found at https://www.redhat.com/archives/spacewalk-list/2008-November/msg00048.html

Comment 7 Miroslav Suchý 2009-01-15 14:10:29 UTC
No error in log after upgrade from 0.1 -> 0.2 -> 0.4
VERIFIED