Bug 480618 - Spacewalk 0.3 - 0.4: spacewalk-schema-upgrade fails
Summary: Spacewalk 0.3 - 0.4: spacewalk-schema-upgrade fails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Installation
Version: 0.4
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space05
TreeView+ depends on / blocked
 
Reported: 2009-01-19 13:44 UTC by Brian Beaudoin
Modified: 2012-03-06 09:00 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-05-12 12:24:58 UTC
Embargoed:


Attachments (Terms of Use)

Description Brian Beaudoin 2009-01-19 13:44:36 UTC
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 13:51:32 UTC
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 13:56:24 UTC
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 14:05:09 UTC
That fixed the issue with that column.  Thank you!

Comment 4 Jan Pazdziora 2009-01-29 14:26:02 UTC
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.