Bug 1461418

Summary: "createdb: could not connect to database postgres: FATAL: the database system is starting up" during Postgres installation
Product: Red Hat Satellite 5 Reporter: Lukáš Hellebrandt <lhellebr>
Component: InstallerAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-09 15:32:53 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:

Description Lukáš Hellebrandt 2017-06-14 12:18:11 UTC
Description of problem:
When installing with Postgres ("./install.pl" and most likely also with Managedb), sometimes, the database does not start soon enough and the following error occurs and the installation fails:

createdb: could not connect to database postgres: FATAL:  the database system is starting up

This is related to bug 1435250 and bug 1289857 (this BZ is its follow-up), yet is a slightly different issue where the pidfile exists, the socket exists and yet, the database is still not accepting connections after startup:

createdb: could not connect to database postgres: FATAL:  the database system is starting up

In these 2 ML replies, there are 3 possible solutions shown: https://www.postgresql.org/message-id/18654.1475678751%40sss.pgh.pa.us
https://www.postgresql.org/message-id/1b38b100-97ba-48ac-feba-9fac53977cc3%40iki.fi

How reproducible:
Non-deterministic, not often

Steps to Reproduce:
1. # ./install.pl

Actual results:
Warning and installation fails

Expected results:
The installer should wait for the DB to start accepting connections