Bug 1320119 - Schema upgrade to nightly failed
Summary: Schema upgrade to nightly failed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Installation
Version: 2.4
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: spacewalk-review space27
TreeView+ depends on / blocked
 
Reported: 2016-03-22 10:49 UTC by Jiri Precechtel
Modified: 2017-09-28 18:06 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-06-16 07:33:00 UTC
Embargoed:


Attachments (Terms of Use)

Description Jiri Precechtel 2016-03-22 10:49:55 UTC
Description of problem:
Upgrade of schema fails when upgrading to spacewalk nightly

Steps to Reproduce:
1. have installed Spacewalk 2.4
2. enable spacewalk nightly repo
3. update spacewalk-schema package
4. execute command spacewalk-schema-upgrade

Actual results:
# spacewalk-schema-upgrade 
Schema upgrade: [spacewalk-schema-2.4.24-1.el7] -> [spacewalk-schema-2.5.19-1.el7]
Searching for upgrade path: [spacewalk-schema-2.4.24-1] -> [spacewalk-schema-2.5.19-1]
Searching for upgrade path: [spacewalk-schema-2.4.24] -> [spacewalk-schema-2.5.19]
Searching for upgrade path: [spacewalk-schema-2.4] -> [spacewalk-schema-2.5]
The path: [spacewalk-schema-2.4] -> [spacewalk-schema-2.5]
Planning to run spacewalk-sql with [/var/log/spacewalk/schema-upgrade/20160322-061140-script.sql]

Plase make sure you have a valid backup of your database before continuing.

Hit Enter to continue or Ctrl+C to interrupt: 
Executing spacewalk-sql, the log is in [/var/log/spacewalk/schema-upgrade/20160322-061140-to-spacewalk-schema-2.5.log].
Upgrade failed, please see log [/var/log/spacewalk/schema-upgrade/20160322-061140-to-spacewalk-schema-2.5.log].

Additional info:
Part of log file containing error:

                                          ?column?
--------------------------------------------------------------------------------------------
 spacewalk-schema-2.4-to-spacewalk-schema-2.5/167-remove_virt_sub_level_refs.sql.postgresql
(1 řádka)

DELETE 1
DELETE 1
psql:/var/log/spacewalk/schema-upgrade/20160322-061140-script.sql:9331: ERROR:  update or delete on table "rhnvirtsublevel" violates foreign key constraint "rhn_cfvsl_vslid_fk" on table "rhnchannelfamilyvirtsublevel"
DETAIL:  Key (id)=(1) is still referenced from table "rhnchannelfamilyvirtsublevel".

RHEL 7 channel synced.

Comment 1 Jiri Precechtel 2016-04-14 15:27:06 UTC
Fixed: Added script to delete corresponding data in referenced table (rhnchannelfamilyvirtsublevel) at first.

Spacewalk-git-commit: 130e11fe3ae9173877853a6f296d1529de6217fa

Comment 4 Tomáš Kašpárek 2016-06-16 07:33:00 UTC
Spacewalk 2.5 was released.

Comment 5 Eric Herget 2017-09-28 18:06:12 UTC
This BZ closed some time during 2.5, 2.6 or 2.7.  Adding to 2.7 tracking bug.


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