Bug 1274583 - DB migration from 5.2.0@embOracle to 5.7.0@embPostgreSQL fails on import step: psql:<stdin>:10773: ERROR: more than one row returned by a subquery used as an expression
Summary: DB migration from 5.2.0@embOracle to 5.7.0@embPostgreSQL fails on import step...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Upgrades
Version: 570
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomáš Kašpárek
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-23 04:40 UTC by Jan Hutař
Modified: 2016-04-28 11:15 UTC (History)
3 users (show)

Fixed In Version: rhn-upgrade-5.7.0.29-1-sat
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-28 11:15:58 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0698 0 normal SHIPPED_LIVE Red Hat Satellite rhn-upgrade-5.7 bug fix update 2016-04-28 15:15:14 UTC

Description Jan Hutař 2015-10-23 04:40:31 UTC
Description of problem:
I'm getting error when importing dump from 5.2.1 on 5.7.0.


Version-Release number of selected component (if applicable):
Source 5.2.1 satellite:
  rhn-satellite-schema-5.2.0-8.el5
  rhn-upgrade-5.7.0.26-1.el5sat
Target 5.7.0 satellite:
  satellite-schema-5.7.0.19-1.el6sat.noarch
  package rhn-upgrade is not installed   <- is this a problem? IMO should not be important in import step (see below)


How reproducible:
always


Steps to Reproduce:
1. Install Satellite 5.2.1
2. 5.2.1# yum -y install rhn-upgrade 
3. 5.2.1# service rhn-satellite stop; service rhn-database start
4. 5.2.1# cd /etc/sysconfig/rhn/satellite-upgrade/scripts; ./spacewalk-dump-schema | bzip2 -7c - | split -d -b 2147483648 - backup
5. Install Satellite 5.7.0 and transfer a dump to it
6. 5.7.0# rhn-satellite stop; db-control start
7. 5.7.0# (cat /tmp/backup* | bzcat | spacewalk-sql --verbose --select-mode-direct - && echo "Schema import finished successfully") 2>&1 | tee /var/log/rhn/rhn-schema-import.log


Actual results:
Step "7." fails with:
[...]
UPDATE 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
psql:<stdin>:10773: ERROR:  more than one row returned by a subquery used as an expression

In the PostgreSQL log:

2015-10-22 17:24:00.466 EDT ERROR:  more than one row returned by a subquery used as an expression
2015-10-22 17:24:00.466 EDT STATEMENT:  INSERT INTO rhnTaskoSchedule (id, job_label, bunch_id, active_from, cron_expr)
            VALUES(sequence_nextval('rhn_tasko_schedule_id_seq'), 'reboot-action-cleanup-default',
                (SELECT id FROM rhnTaskoBunch WHERE name='reboot-action-cleanup-bunch'),
                current_timestamp, '0 0 * * * ?');


Expected results:
It should work.


Additional info:
We have seen something similar in bug 1262348, bit that was for /usr/bin/spacewalk-dump-schema and no upgrade involved, this is for /etc/sysconfig/rhn/satellite-upgrade/scripts/spacewalk-dump-schema and involves upgrade.

Comment 9 errata-xmlrpc 2016-04-28 11:15:58 UTC
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-2016-0698.html


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