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."
Summary: db-control sometimes fails with "Unable to connect to database to determine s...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Tomáš Kašpárek
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-20 10:39 UTC by Lukáš Hellebrandt
Modified: 2018-04-09 15:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-09 15:34:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lukáš Hellebrandt 2017-07-20 10:39:41 UTC
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 11:38:19 UTC
What Sat 5 version is this reported for?

Comment 2 Lukáš Hellebrandt 2017-07-20 11:51:32 UTC
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 15:34:36 UTC
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.