Bug 1672516

Summary: [RFE] sosreport shouldn't execute sssctl if sssd isn't running
Product: Red Hat Enterprise Linux 7 Reporter: Oliver Falk <ofalk>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Miroslav HradĂ­lek <mhradile>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.6CC: agk, bmr, cww, jjansky, mhradile, ofalk, peter.vreman, plambri, pmoravec, pvlasin, sbradley
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sos-3.9-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-29 20:55:10 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: 1122832, 1784466    

Description Oliver Falk 2019-02-05 08:23:14 UTC
Description of problem:
sosreport plugin sssd is running into a timeout, if sssd isn't running:

    [plugin:sssd] command 'sssctl domain-list' timed out after 300s

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


How reproducible: Always


Steps to Reproduce:
1. Install sssd-tools
2. Stop sssd (if running)
3. Run sosreport

Actual results:
sosreport plugin sssd times out if sssd isn't running.


Expected results:
sosreport plugin sssd shouldn't run sssctl if sssd isn't running. While it's safe, it takes 5 minutes longer (300 second timeout) and it prints out an error (see description).

The reason is, that sssctl checks if sssd is running or not and awaits input on stdin (yes/no). Either check upfront if sssd is running and if not, do not execute sssctl or simply run it with echo "no" | sssctl.

Additional info:
Customer case will be linked in a hurry.

Link to the line in question: https://github.com/sosreport/sos/blob/d579fb745de0130132beea214edf85e597ffc54d/sos/plugins/sssd.py#L33

Comment 3 Bryn M. Reeves 2019-02-05 10:22:04 UTC
> do not execute sssctl or simply run it with echo "no" | sssctl.

Ugh, really? It doesn't provide any command line argument or environment setting to override this?

Comment 4 Oliver Falk 2019-02-05 10:25:48 UTC
Bryn,
 thanks for getting back to me on this case.

There is only one option, namely to _start_ it:

    # sssctl domain-list --help
    Usage: sssctl domain-list [OPTIONS...]

    Command options:
      -s, --start       Start SSSD if it is not running
      -v, --verbose     Show domain list including primary or trusted domain type

    Help options:
      -?, --help        Show this help message
      --usage           Display brief usage message

But I don't think we want to automatically start sssd upon running sosreport.

Yes, I know, echo-ing something is ugly, but I don't see any better option ATM.

Oliver

Comment 5 Bryn M. Reeves 2019-02-05 11:58:24 UTC
I've spoken to one of the SSSD developers, and they would be happy to look at a request to add a --nostart option or similar. I'll open a bug.

Comment 6 Oliver Falk 2019-02-05 12:18:18 UTC
Hi Bryn!

Thanks for the update and _many_ thanks for reaching out to the SSSD developers. Since SSSD is a critical part of the system, I'm pretty sure we'll have to wait quite a while until we get this down into our product(s). While I highly appreciate adding this option as a middle-term goal, I'd prefer to get a workaround into sos sooner. Do you think that is feasible? 

Oliver

Comment 7 Bryn M. Reeves 2019-02-05 12:25:24 UTC
I'd rather not start adding hacks until we at least know what sort of schedule we are talking about. Once we add them it is very hard to ever remove them, and this is a pretty clear deficiency in another component. Once we have had a proper discussion with the SSSD folks and agree a solution then we can consider whether to do anything else here.

Comment 8 Oliver Falk 2019-02-05 12:37:04 UTC
Ack Bryn. I understand.
Please keep me posted on this issue!

Oliver

Comment 9 Pavel Moravec 2019-02-18 21:23:16 UTC
(In reply to Bryn M. Reeves from comment #5)
> I've spoken to one of the SSSD developers, and they would be happy to look
> at a request to add a --nostart option or similar. I'll open a bug.

Hi Bryn,
is there a BZ for that? Or potential ETA of sssd fix known?

Comment 10 Pavel Moravec 2019-03-29 11:33:37 UTC
Scope of 7.7 closed, rescheduling for potential inclusion in 7.8.

Comment 11 Pavel Moravec 2019-08-08 07:48:24 UTC
(In reply to Pavel Moravec from comment #9)
> (In reply to Bryn M. Reeves from comment #5)
> > I've spoken to one of the SSSD developers, and they would be happy to look
> > at a request to add a --nostart option or similar. I'll open a bug.
> 
> Hi Bryn,
> is there a BZ for that? Or potential ETA of sssd fix known?

Kindly requesting this needinfo ;-)

Comment 12 Pavel Moravec 2020-02-04 14:19:24 UTC
Oliver,
would it work if we collect ssctl _only_ when service sssd is running?

Sosreport has recenty added a support for that via presets (cf. e.g. https://github.com/sosreport/sos/blob/master/sos/plugins/__init__.py#L196).

If so, we can call in https://github.com/sosreport/sos/blob/master/sos/plugins/sssd.py#L31 :

self.add_cmd_output("sssctl config-check", pred=SoSPredicate(self, services=["sssd"])))

(and similarly to the "sssctl domain-list" command)

Comment 13 Oliver Falk 2020-02-04 14:38:30 UTC
As discussed, yes, I do agree that exactly this makes sense; Only run sss* commands if sssd is running.

Thanks,
 Oliver

Comment 14 Pavel Moravec 2020-02-04 15:16:18 UTC
Thanks for confirmation, trivial upstream PR raised.

Comment 18 Pavel Moravec 2020-05-01 15:26:30 UTC
FYI this will be in RHEL7.9 as the upstream fix https://github.com/sosreport/sos/commit/1070f6e is contained in 3.9-1 that we will rebase to in 7.9 (I expect).

Comment 28 errata-xmlrpc 2020-09-29 20:55:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (sos bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:4034