Bug 1558501

Summary: Migration from embedded postgres to external postgres fails due to use of public schema.
Product: Red Hat Satellite 5 Reporter: Joe Kirby <jkirby>
Component: UpgradesAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 580CC: jkirby, risantam, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-09 12:33:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1450940    

Description Joe Kirby 2018-03-20 10:59:17 UTC
Description of problem:
migration from embedded to external fails because of use of public schema

Version-Release number of selected component (if applicable):
spacewalk-setup-2.5.1-23.el6sat.noarch
satellite-schema-5.8.0.42-1.el6sat.noarch

How reproducible:
consistent

Steps to Reproduce:
1. run spacewalk-setup --db-only --external-postgresql
2.
3.

Actual results:
Migration ends with the following error in /var/log/rhn/populate.db

psql:/etc/sysconfig/rhn/postgres/deploy.sql:23305: ERROR:  query returned no rows
CONTEXT:  PL/pgSQL function _get_primary_key_column(character varying) line 5 at SQL statement
PL/pgSQL function enable_logging(character varying) line 6 at assignment

Expected results:
Successful database configuration

Additional info:
There has been a bit of work done on this already by Neal Kim. Refer to customer service case 02049347.

Comment 1 Joe Kirby 2018-03-20 11:07:46 UTC
An active request for support with a dev environment is in CASE 02059162.

Comment 2 Tomáš Kašpárek 2018-03-21 10:59:56 UTC
Attempting to reproduce the issue using reproducer steps using reproducer steps provided:

spacewalk-setup --db-only --external-postgresql
* Setting up SELinux..
** Database: Setting up database connection for PostgreSQL backend.
Hostname (leave empty for local)? 
Database [spaceschema]? 
Username [spaceuser]? 
Password [******]? 
** Database: Populating database.
The Database has schema.  Would you like to clear the database [Y]? y
** Database: Clearing database.
** Database: Shutting down spacewalk services that may be using DB.
** Database: Services stopped.  Clearing DB.
** Database: Re-populating database.
*** Progress: ###########################
* Configuring tomcat.

Could you please provide more detailed steps to reproduce there seems to be no issue with the only command you provided for us to test.

Comment 4 Tomáš Kašpárek 2018-05-09 12:33:13 UTC
As no additional information has been provided on how to reproduce the issue I am closing this BZ.

Feel free to reopen anytime, should you provide additional data.