Bug 1449861

Summary: glusterd-geo-rep.c doesn't log stderr on failure to execute subprocesses
Product: [Community] GlusterFS Reporter: nh2 <nh2-redhatbugzilla>
Component: coreAssignee: bugs <bugs>
Status: CLOSED EOL QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.10CC: avishwan, bugs, nh2-redhatbugzilla
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-06-20 18:29:22 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 nh2 2017-05-11 00:53:27 UTC
Description of problem:

glusterd-geo-rep, and potentially other code, doesn't log stderr on failure to execute subprocesses.

This makes it hard to debug issues, especially when packaging gluster.

For example, if `glusterd` is started with a wrong PATH environment variable, then when `glusterd_op_sys_exec()` runs `peer_georep-sshkey.py node-generate .` which tries to `execute( ["gluster", "system::", "uuid", "get", "--xml"] )`, then `gluster` can't be found.

In the above case, the only error message logged is the extremely unhelpful `Unable to end. Error : Success`. This is simply because glusterd-geo-rep.c simply doesn't do anything with the stderr of the invoked program, even on failure. Had it read and logged the stderr, it would contain the very useful "No such file or directory" that would have hinted immediately at what the problem is.

I believe `glusterd_op_sys_exec()` (and all other code in gluster that uses run.c) should log the stderr when an invoked command fails.

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

3.10.1

Further information:

I found this issue here: https://github.com/NixOS/nixpkgs/issues/25620#issuecomment-300648507

The topic is made even worse by https://bugzilla.redhat.com/show_bug.cgi?id=1449416 -- that's why in my example it incorrectly prints "Success" despite failing.

Comment 1 Shyamsundar 2018-06-20 18:29:22 UTC
This bug reported is against a version of Gluster that is no longer maintained
(or has been EOL'd). See https://www.gluster.org/release-schedule/ for the
versions currently maintained.

As a result this bug is being closed.

If the bug persists on a maintained version of gluster or against the mainline
gluster repository, request that it be reopened and the Version field be marked
appropriately.