Bug 470887 - Upgrade from 0.2 to 03 issue updatin versioninfo
Summary: Upgrade from 0.2 to 03 issue updatin versioninfo
Keywords:
Status: CLOSED DUPLICATE of bug 470791
Alias: None
Product: Spacewalk
Classification: Community
Component: Installation
Version: 0.3
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jan Pazdziora (Red Hat)
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space04
TreeView+ depends on / blocked
 
Reported: 2008-11-10 19:08 UTC by Romain
Modified: 2012-03-06 08:45 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-11-10 19:14:45 UTC
Embargoed:


Attachments (Terms of Use)

Description Romain 2008-11-10 19:08:51 UTC
Description of problem:
When upgrading from 02 to 03 using the /usr/bin/spacewalk-schema-upgrade script the error below appear:

'ORA-00001: unique constraint (SPACEWALK.RHN_VERSIONINFO_LABEL_UQ) violated'

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


How reproducible:


Steps to Reproduce:
1.Install 0.1

2.Upgrade to 0.2

3.Upgrade to 0.3
  
Actual results:
Cannot upgrade to 0.3 from 0.2

Expected results:
No issue during versioninfo update with the upgrade script.


Additional info:
I have asked for help in he IRC channel and cperry-afk was kind enought to help me with this.

Workaround:
He gave me a workaround that actually solve the issue:

- Edit the /usr/bin/spacewalk-schema-upgrade script
- search the script for 'schema-from' and change it for 'schema-from2'
- save the script and run it, The upgrade process should works this time.

Here is the chat transcript that we had on IRC about the issue:
	<romainpelissier>	Hi, I have a big issue when upgrading from 02 to 03 is anybody can help?
	<romainpelissier>	I have logged my issue in the forum : https://www.redhat.com/archives/spacewalk-list/2008-November/msg00048.html
	<romainpelissier>	Anybody here?
	<romainpelissier>	Please?
	<romainpelissier>	still nobody?
	<cperry-afk>	reading
	<romainpelissier>	thanks!
	<cperry-afk>	kinda slow, helping someone else atm in another channel.. I assume you did follow the upgrade docs?
	<cperry-afk>	https://fedorahosted.org/spacewalk/wiki/HowToUpgrade romainpelissier ?
	<romainpelissier>	Yes, I fact the first try I have used only yum upgrade spacewalk since I only wanted to update spacewalk. Then I have follwed the reaming step. At the point of upgrading the schema is says that it is the same version
	<romainpelissier>	then I have check the rpm version on my system versus the one on the repo and see that the rpm schema was not the same
	<romainpelissier>	so I have used yum upgrade this time
	<romainpelissier>	All was utpdate of course
	<romainpelissier>	then tested the command /usr/bin/spacewalk-schema-upgrade
	<romainpelissier>	but it fail with the error : Upgrade failed
	<romainpelissier>	I have post the content of var/log/spacewalk/schema-upgrade/20081107-154334-begin.log
	<romainpelissier>	the error is : ORA-00001: unique constraint (SPACEWALK.RHN_VERSIONINFO_LABEL_UQ) violated
	<romainpelissier>	really don't know what to do...
	<cperry-afk>	*nod* k...
	<cperry-afk>	(done with other person... just reading now.. I did not test the upgrades... so not overly familiar with them as written:)
	<romainpelissier>	thank anyway ;-)
	<cperry-afk>	ok - so first email was indeed because "yum upgrade spacewalk" did not upgrade all packages needed, thus the schema and chkconfig steps failed.. you seem to notice that... (still reading/reviewing 2nd one now and docs/process) :)
	<romainpelissier>	yes, I am not very familiar with yum and I thought that only use yum upgrade spacewalk will update spacewalk which not seems to be the case...
	<romainpelissier>	but I did the upgrade after I saw my mistake
	<cperry-afk>	going to look at the upgrade package... see what SQL is was tryign to run to throw that error
	<cperry-afk>	romainpelissier, was the 0.2 a clean 0.2 install, or upgrade from 0.1?
	<romainpelissier>	an upgrade from 0.1
	<romainpelissier>	but the upgrade from 0.1 to 0.2 was fine
	<cperry-afk>	k ..
	<cperry-afk>	anyone got an 0.3 SW I can login to confirm an SQL query before asking romainpelissier to run it?
	<cperry-afk>	weshay? :)
	<cperry-afk>	we seem to be trying to insert a duplicate label entry to table, not sure why, where going wrong :)
	<cperry-afk>	ooo...
	<cperry-afk>	my $start = $start_schema_norm;
	<cperry-afk>	my $in = <<EOF;
	<cperry-afk>	spool /var/log/spacewalk/schema-upgrade/$stamp-begin.log append
	<cperry-afk>	whenever sqlerror exit sql.sqlcode
	<cperry-afk>	update rhnVersionInfo
	<cperry-afk>	set label = 'schema-from', modified = sysdate
	<cperry-afk>	where label = 'schema';
	<cperry-afk>	commit;
	<cperry-afk>	EOF
	<cperry-afk>	you did an 0.1 -> 0.2 upgrade - we created an entry for 'schema-from' - your now trying to do an 0.2 -> 0.3 and create a second (duplicate entry)... our code does not remove/rename the old upgrade 'from' label
	<cperry-afk>	okay romainpelissier I think I see what is happening..
	<romainpelissier>	I see...
	<romainpelissier>	Is there a way to to the upgrade anyway withour removeing/upgrading the from label?
	<cperry-afk>	as a quick 'hack' edit the usr/bin/spacewalk-schema-upgrade script and change 'schema-from' to 'schema-from-2' and try again
	<romainpelissier>	I do this right now.
	<cperry-afk>	our code needs to take into consideration multiple upgraded systems, which it does not do right now - we only tested an 0.2 install upgrade to 0.3 - which is why we did not catch it :/
	* cperry-afk	waits though for feedback before doing the bug report
	<romainpelissier>	Yes ! The database schema was upgraded to version [spacewalk-schema-0.3.6-1.el5.sw]
	<romainpelissier>	starting spacewalk now
	<romainpelissier>	cperry-afk? Do you want me to fill the bug report?
	<romainpelissier>	Spacewalk release 0.3 is now display in the web interface
	<romainpelissier>	seems to be ok so far. but the login logout page is buggy....
	<romainpelissier>	AFK fro 5 mns, sorry
	<cperry-afk>	romainpelissier, back (I needed a drink myself) - yes, please file the bug report, copy this IRC session in it, reply to the email with Bugzilla # :)
	<romainpelissier>	perfect! I will (not today but very soon) Thanks again cperry-afk! have a nice we!

Comment 1 Jan Pazdziora (Red Hat) 2008-11-10 19:14:45 UTC

*** This bug has been marked as a duplicate of bug 470791 ***


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