Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 903487

Summary: spacewalk-setup-postgresql fails when using postgresql >= 9.1
Product: [Community] Spacewalk Reporter: Nicholas Schuetz <nick>
Component: InstallationAssignee: Jan Pazdziora (Red Hat) <jpazdziora>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.8CC: jpazdziora
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: spacewalk-setup-embedded-postgresql-1.9.1-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-06 18:34:43 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: 917805    
Attachments:
Description Flags
removes the createland statement from /usr/bin/spacewalk-setup-embedded-postgresql which allows the install to complete successfully none

Description Nicholas Schuetz 2013-01-24 06:12:33 UTC
Created attachment 686475 [details]
removes the createland statement from /usr/bin/spacewalk-setup-embedded-postgresql which allows the install to complete successfully

spacewalk-setup fails w/ postgres backend on a fresh Fedora 17 install.  The reason is because Postgresql >= 9.1 automatically includes plpsql in the template.  See below.


[root@spacewalk01 ~]# spacewalk-setup --disconnected
** Database: Setting up database connection for PostgreSQL backend.
Database "rhnschema" does not exist
** 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.

[root@spacewalk01 ~]# cat /var/log/rhn/install_db.log
Note: Forwarding request to 'systemctl enable postgresql.service'.
Redirecting to /bin/systemctl start  postgresql.service
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /run/user/nick/gvfs
      Output information may be incomplete.
createlang: language "plpgsql" is already installed in database "rhnschema"

Versions:
# rpm -qf /usr/bin/spacewalk-setup-embedded-postgresql
spacewalk-setup-embedded-postgresql-1.8.3-1.fc17.noarch


The fix is to remove the 'createlang' statement from /usr/bin/spacewalk-setup-embedded-postgresql.  patch is attached...

Comment 1 Jan Pazdziora (Red Hat) 2013-02-04 09:58:03 UTC
Thank you for reporting this issue. Merely removing that createlang command would cause the setup to fail on older PostgreSQL versions. I've now added a check for existence of the language in the new database, in Spacewalk master, 2bcd1fdff0ec0183dc102482995a6681586cb4f1.

Comment 2 Stephen Herr 2013-03-01 17:07:18 UTC
Marking bug as ON_QA since tonight's build of Spacewalk nightly is a release candidate for Spacewalk 1.9.

Comment 3 Stephen Herr 2013-03-06 18:34:43 UTC
Spacewalk 1.9 has been released.

https://fedorahosted.org/spacewalk/wiki/ReleaseNotes19