Bug 1542287 - Upgrading database schema to 5.8.0.40 fails due to drop table rhnSolarisPatchedPackage
Summary: Upgrading database schema to 5.8.0.40 fails due to drop table rhnSolarisPatch...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Upgrades
Version: 580
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Tomáš Kašpárek
QA Contact: Ales Dujicek
URL:
Whiteboard:
Depends On:
Blocks: sat58-errata
TreeView+ depends on / blocked
 
Reported: 2018-02-06 00:42 UTC by Candace Sheremeta
Modified: 2021-09-09 13:09 UTC (History)
15 users (show)

Fixed In Version: satellite-schema-5.8.0.42-1-sat
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-06 15:47:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3344911 0 None None None 2018-02-06 04:49:22 UTC
Red Hat Product Errata RHBA-2018:0393 0 normal SHIPPED_LIVE Red Hat Satellite 5.8.0 bug fix update 2018-03-06 20:47:01 UTC

Description Candace Sheremeta 2018-02-06 00:42:39 UTC
Attempting to upgrade database schema to 5.8.0.40 fails with this message:

~~~
cat /var/log/spacewalk/schema-upgrade/20180205-231809-to-satellite-schema-5.8.0.40.log
UPDATE 1
COMMIT
                                                ?column?                                                 
---------------------------------------------------------------------------------------------------------
 satellite-schema-5.8.0.38-to-satellite-schema-5.8.0.39/001-rhnpackageevr-rhn_pe_v_r_e_uq.sql.postgresql
(1 row)

CREATE FUNCTION
DROP TRIGGER
psql:/var/log/spacewalk/schema-upgrade/20180205-231809-script.sql:58: ERROR:  relation "rhnsolarispatchedpackage" does not exist
LINE 1: update rhnsolarispatchedpackage set package_nevra_id = nevra...
               ^
QUERY:  update rhnsolarispatchedpackage set package_nevra_id = nevra_orig.id where package_nevra_id = nevra_dup.id
CONTEXT:  PL/pgSQL function fix_rhn_pe_v_r_e_uq() line 28 at SQL statement
~~~

This is due to:

~~~
spacewalk/upgrade/spacewalk-schema-2.2-to-spacewalk-schema-2.3/018-drop_solaris_tables.sql:drop table rhnSolarisPatchedPackage;
~~~

This update exists in 38-to-39, but it should not (we shouldn't be referencing Solaris tables at all anymore). 

I was unable to reproduce this issue on a fresh install of Satellite 5.8, so I'm not sure what would need to happen to create a situation where this error occurs, but we have two cases currently open with this issue.

We may also want to drop the mention of rhnsolarispatchpackages from that upgrade script as well.

Comment 1 Tomáš Kašpárek 2018-02-06 08:35:41 UTC
spacewalk.git(master): 4252c4adb8e1750021b7db7ad771c2e05c8cf2b9

Comment 3 achadha 2018-02-09 12:33:40 UTC
Hello,

I have a case where customer has already applied the workaround as per article : https://access.redhat.com/solutions/3344911, however now he is getting some other error related to a different table when he tried to run a schema upgrade

Below are the logs from the same

/var/log/spacewalk/schema-upgrade/20180208-063309-to-satellite-schema-5.8.0.40.log.
------------------------------------------------------------------------

The log file has:

UPDATE 1
COMMIT
                                                ?column?                         
=============================================================================
---------------------------------------------------------------------------------------------------------
 satellite-schema-5.8.0.38-to-satellite-schema-5.8.0.39/001-rhnpackageevr-rhn_pe_v_r_e_uq.sql.postgresql
(1 row)

CREATE FUNCTION
DROP TRIGGER
psql:/var/log/spacewalk/schema-upgrade/20180208-063309-script.sql:56: ERROR:  duplicate key value violates unique constraint "rhn_snapshotpkg_sid_nid_uq"
DETAIL:  Key (snapshot_id, nevra_id)=(33256, 229427) already exists.
CONTEXT:  SQL statement "update rhnsnapshotpackage set nevra_id = nevra_orig.id where nevra_id = nevra_dup.id"
PL/pgSQL function fix_rhn_pe_v_r_e_uq() line 27 at SQL statement
=============================================================================

        rhn-schema-version
                                # Shows nothing
------------------------------------


Thanks and Regards,
Arvinder Singh Chadha

Comment 5 Tomáš Kašpárek 2018-02-13 15:10:59 UTC
spacewalk.git(master): 19fcf010813492ae6c0de4c0ff17aa400dfebe67

Comment 11 errata-xmlrpc 2018-03-06 15:47:02 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://access.redhat.com/errata/RHBA-2018:0393


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