Bug 1262348 - when migrating (no upgrade involved) spacewalk-dump-schema creates wrong dump when rhn-upgrade is installed
when migrating (no upgrade involved) spacewalk-dump-schema creates wrong dump...
Status: CLOSED ERRATA
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server (Show other bugs)
570
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tomáš Kašpárek
Radovan Drazny
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-11 09:16 EDT by Jan Hutař
Modified: 2015-11-23 04:02 EST (History)
5 users (show)

See Also:
Fixed In Version: spacewalk-utils-2.3.2-23
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-23 04:02:24 EST
Type: Bug
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 Jan Hutař 2015-09-11 09:16:43 EDT
Description of problem:
When migrating (no upgrade involved) spacewalk-dump-schema creates wrong dump when rhn-upgrade is installed. It is because it appends some SQL scripts from rhn-upgrade package which conflicts with schema itself.


Version-Release number of selected component (if applicable):
spacewalk-utils-2.3.2-22.el6sat.noarch


How reproducible:
always


Steps to Reproduce:
1. Follow guide linked from bug 1261847


Actual results:
Dump fails when you are restoring it.

# spacewalk-sql -i < /tmp/migrate-to-postgresql-with-rhn-upgrade-installed.sql
[...]
ERROR:  more than one row returned by a subquery used as an expression


Expected results:
spacewalk-dump-schema should ensure user do not created invalid dump


Additional info:
Doc bug 1261847 was reported as well
Comment 1 Tomáš Kašpárek 2015-10-12 08:42:49 EDT
spacewalk.git(master): 6e4d41e922778a8e5795c630114c374fcfdc3a84
Comment 4 Radovan Drazny 2015-11-12 05:15:01 EST
Went through whole upgrade cycle:

1. installed Satellite 5.6 with the Oracle DB backend
2. installed rhn-upgrade packege
3. did an upgrade to Satellite 5.7
4. did a DB dump for migration without removing rhn-upgrade package using "spacewalk-dump-schema --to=postgresql > migrate-to-postgresql.sql" command. Dump was created without any problems.
5. updated to spacewalk-utils-2.3.2-23.el6sat
6. again did a DB dump using same command as in step 4. Dump wasn't performed this time, and ended with an error message "Package rhn-upgrade detected, which may lead to errors during dump process. Please remove rhn-upgrade package and proceed with dump."
7. removed rhn-upgrade package
8. did a dump again, this time succesfuly.
9. attempted to import dump created in step 4 into different Satellite 5.7 DB. Failed with error message "more than one row returned by a subquery used as an expression", as expected.
10. imported the dump created in step 8 into different Satellite 5.7 DB. The import was successful.
Verified.
Comment 7 errata-xmlrpc 2015-11-23 04:02:24 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2503.html

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