Bug 1208141

Summary: Satellite upgrade from 5.4.1 to 5.7 fails if another user is UID 26 instead of "postgres"
Product: Red Hat Satellite 5 Reporter: Dylan Gross <dgross>
Component: UpgradesAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED CANTFIX QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 570CC: maci, pgervase, tlestach, xdmoon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-02 15:48:18 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: 1127217    

Description Dylan Gross 2015-04-01 13:45:53 UTC
Description of problem:

Upgrading from Red Hat Satellite v5.4.1 to Red Hat Satellite 5.7.  Another user existed in /etc/passwd with the UID 26 and another group existed in /etc/group with GID 26.

During the upgrade, the postgres id is added as UID 26 regardless of whether something is already using it.

    # id prngd
    uid=26(prngd) gid=53(prngd) groups=53(prngd),43(nologin)

    # id postgres
    uid=26(prngd) gid=26(filemgr) groups=53(prngd)

This results in incorrect roles being set up in the postgres database.


Version-Release number of selected component (if applicable):

   Upgrade attempted from 5.4.1 to 5.7
   However, I would suspect this happens going from any version using embedded Oracle to any version using embedded PostgreSQL

How reproducible:


Steps to Reproduce:
1.  Create another user with UID 26 prior to attempting an upgrade
2.  Attempt an upgrade from 5.4.1 to 5.7
3.

Actual results:

install.pl fails to successfully create the postgres DB

# ./install.pl --upgrade --skip-selinux-test
* Starting Red Hat Satellite installer.
* Performing pre-install checks.
* Pre-install checks complete.  Beginning installation.
* RHN Registration.
** Registration: System is already registered with RHN.  Not re-registering.
* Upgrade flag passed.  Stopping necessary services.
* Purging conflicting packages.
* Checking for uninstalled prerequisites.
* Installing RHN packages.
* Now running spacewalk-setup.
** Database: Setting up database connection for PostgreSQL backend.
** Database: Installing the database:
** Database: This is a long process that is logged in:
** Database:   /var/log/rhn/install_db.log
*** Progress: #############

Could not install database.

# tailf /var/log/rhn/install_db.log
createdb: could not connect to database postgres: FATAL:  no pg_hba.conf entry for host "[local]", user "prngd", database "postgres", SSL off
logout


Expected results:

Perhaps either a pre-check in the install would exit early if it detects another user using UID 26 or GID 26.   

Or maybe a warning message in the /etc/sysconfig/rhn/satellite-upgrade/scripts/satellite-upgrade-estimates output.

Also, perhaps a modification to the Installation Guide - Upgrade Requirements section.    https://access.redhat.com/documentation/en-US/Red_Hat_Satellite/5.7/html-single/Installation_Guide/index.html#Upgrade_Requirements

Additional info:

Comment 1 Marcel Wysocki 2015-04-24 19:58:05 UTC
is an upgrade from 5.4.1 to 5.7 even supported or so i need the steps in between too ?

Comment 2 Tomas Lestach 2017-02-02 15:48:18 UTC
I feel like this is more a postgresql bug, not a Satellite 5 bug.
I'm closing this BZ CANTFIX. Feel free to open a bug against postgresql if needed.