Bug 1473257 - db-control sometimes fails with "Unable to connect to database to determine status. If database service started successfully, check configuration in rhn.conf."
db-control sometimes fails with "Unable to connect to database to determine s...
Status: CLOSED DEFERRED
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Tomáš Kašpárek
Red Hat Satellite QA List
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-20 06:39 EDT by Lukáš Hellebrandt
Modified: 2018-04-09 11:34 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-09 11:34:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Lukáš Hellebrandt 2017-07-20 06:39:41 EDT
Description of problem:
db-control sometimes fails with
"""
Unable to connect to database to determine status.  If database service started successfully, check configuration in rhn.conf.
"""
This is not deterministic. I have tracked the reason to /usr/share/perl5/vendor_perl/Dobby/CLI/MiscCommands.pm , line 117, function command_startstop: "if ($state ne 'OPEN') {". The reason is $state being "OFFLINE". Most likely, postgresql still returns OFFLINE a few moments after starting thus making db-control fail. We should either use some other way to check DB's status or implement a few seconds of waiting for it to return ONLINE.

How reproducible:
Not deterministic, probably a timing issue

Steps to Reproduce:
1. In file /usr/share/perl5/vendor_perl/Dobby/CLI/MiscCommands.pm, put 'print "$state";' on a line 119.
2. while true; do db-control stop && db-control start; ret=$?; [ $ret -ne 0 ] && break; done
3. Wait
4. Wait
5. I was successful running this on 1 machine overnight.

Actual results:
db-control returns ret!=0 and complains (database is started successfully, however)

Expected results:
Database started successfully and without any complaining, db-control returns 0

Additional info:
This doesn't seem to be a regression
Comment 1 Tomas Lestach 2017-07-20 07:38:19 EDT
What Sat 5 version is this reported for?
Comment 2 Lukáš Hellebrandt 2017-07-20 07:51:32 EDT
The reproducer is nondeterministic so it's hard to say but I've only ever seen it on 5.8.
Comment 3 Tomas Lestach 2018-04-09 11:34:36 EDT
We have re-reviewed this bug, as part of an ongoing effort to improve Satellite/Proxy feature and bug updates, review and backlog.

This is a low priority bug and has no currently open customer cases. While this bug may still valid, we do not see it being implemented prior to the EOL of the Satellite 5.x product. As such, this is being CLOSED DEFERRED. 

Closing now to help set customer expectations as early as possible. You are welcome to re-open this bug if needed.

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