Bug 480618 - Spacewalk 0.3 - 0.4: spacewalk-schema-upgrade fails
Spacewalk 0.3 - 0.4: spacewalk-schema-upgrade fails
Status: CLOSED CURRENTRELEASE
Product: Spacewalk
Classification: Community
Component: Installation (Show other bugs)
0.4
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Milan Zázrivec
Red Hat Satellite QA List
:
Depends On:
Blocks: space05
  Show dependency treegraph
 
Reported: 2009-01-19 08:44 EST by Brian Beaudoin
Modified: 2012-03-06 04:00 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-12 08:24:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Brian Beaudoin 2009-01-19 08:44:36 EST
Description of problem:

/usr/bin/spacewalk-schema-upgrade returns "Upgrade failed, please see log in [/var/log/spacewalk/schema-upgrade/]".  The file /var/log/spacewalk/schema-upgrade/20090119-074852-to-spacewalk-schema-0.4.log ends as follows:

   4199 SQL> alter TABLE rhnPackage MODIFY (compat number(1));
   4200 alter TABLE rhnPackage MODIFY (compat number(1))
   4201                                *
   4202 ERROR at line 1:       
   4203 ORA-01440: column to be modified must be empty to decrease precision or         scale 
   4204 
   4205 


Version-Release number of selected component (if applicable):

    Spacewalk 0.4


How reproducible:

    Do not know -- probably


Additional info:

This appears towards the end of the script:

   3586 alter TABLE rhnPackage MODIFY (compat number(1));
   3587 show errors
   3588 commit;
   3589         spool /var/log/spacewalk/schema-upgrade/20090119-074852-end.log         append
   3590         whenever sqlerror exit sql.sqlcode
   3591 
   3592         insert into rhnVersionInfo
   3593                 ( label, name_id, evr_id, created, modified )
   3594         values ('schema', lookup_package_name('spacewalk-schema'),
   3595                 lookup_evr(null, '0.4.17' , '1.el5' ),
   3596                 sysdate, sysdate );
   3597         commit;
   3598 quit;

As the remaining SQL code doesn't appear to rely on the rhnPackage table I ran those statements manually.  The column in question is in-use but doesn't seem to be storing anything of value:

SQL> select compat from rhnPackage group by compat;

    COMPAT
----------
	 0

SQL> select count(compat) from rhnPackage;

COUNT(COMPAT)
-------------
	12444

SQL> desc rhnPackage;
 Name					   Null?    Type
 ----------------------------------------- -------- ----------------------------
 ID					   NOT NULL NUMBER
[...]
 PAYLOAD_FORMAT 				    VARCHAR2(32)
 COMPAT 					    NUMBER(38)
 PATH						    VARCHAR2(1000)
[...]
 HEADER_END				   NOT NULL NUMBER
Comment 1 Milan Zázrivec 2009-01-19 08:51:32 EST
This problem was fixed in spacewalk-0.4 branch:

http://git.fedorahosted.org/git/?p=spacewalk.git;a=commitdiff;h=76c6badd7ea8f3191513138cd46bc350d9c01cf4
Comment 2 Milan Zázrivec 2009-01-19 08:56:24 EST
Fix should go out for Spacewalk 0.4 in spacewalk-schema-0.4.18-1

Alternatively, you can update
/etc/sysconfig/rhn/schema-upgrade/spacewalk-0.3-spacewalk-0.4/156-rhnPackage-compat-number.sql
with the fix from the commit above.
Comment 3 Brian Beaudoin 2009-01-19 09:05:09 EST
That fixed the issue with that column.  Thank you!
Comment 4 Jan Pazdziora 2009-01-29 09:26:02 EST
I can see that spacewalk-schema-0.4.18-1.el5.noarch.rpm is now available on http://spacewalk.redhat.com/yum/0.4/rhel/5Server/i386/. Proposing moving to ON_QA, and as Brian confirms that it fixes the problem, maybe directly to VERIFIED and CLOSED.

Note You need to log in before you can comment on or make changes to this bug.