Bug #35169 ndb_mgmd reports errors to stdout, not stderr
Submitted: 9 Mar 2008 9:06 Modified: 8 Oct 2008 13:43
Reporter: Hartmut Holzgraefe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.1.22, all OS:Any
Assigned to: Tomas Ulin CPU Architecture:Any
Tags: usability

[9 Mar 2008 9:06] Hartmut Holzgraefe
Description:
ndb_mgmd reports configuration errors to the regular standard output channel,
not the standard error channel as it is supposed to

i tried to check config.ini files for errors using

  ndb_mgmd --print-full-config config.ini >/dev/null

redirecting standard output to /dev/null to only see 
error messages but not regular success output

i can now check the ndb_mgmd exit status for errors
but won't see the actual error messages unless i 
rerun ndb_mgmd without redirection a 2nd time like this:

if ! ndb_mgmd --print-full-config config.ini >/dev/null
then
     ndb_mgmd --print-full-config config.ini
fi
  

How to repeat:
create a simple bogus config.ini like

 [ndbd_default]
 foo=bar

then run ndbd 

  > /usr/local/mysql-5.1.22/libexec/ndb_mgmd --print-full-config config.ini 
  Error line 2: [DB] Unknown parameter: foo
  Error line 2: Could not parse name-value pair in config file.
  Invalid configuration file: config.ini

and now with stdout redirection

  > /usr/local/mysql-5.1.22/libexec/ndb_mgmd --print-full-config config.ini /dev/null

to see that the output is sent to stdout, not stderr

Suggested fix:
Always send error messages to stderr, *not* stdout
[17 Mar 2008 8:22] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/44093

ChangeSet@1.2541, 2008-03-16 15:15:26+01:00, tomas@poseidon.bredbandsbolaget.se +1 -0
  Bug #35169  	ndb_mgmd reports errors to stdout, not stderr
[3 Apr 2008 15:25] Jon Stephens
Documented bugfix in the 5.1.23-ndb-6.3.11 changelog as follows:

        ndb_mgmd reported errors to STDOUT instead to STDERR.

Left Patch Pending status pending further merges.
[4 Apr 2008 22:38] Jon Stephens
Also documented fix in the 5.1.23-ndb-6.2.15 changelog.
[8 Oct 2008 13:43] Jon Stephens
Already merged to 6.2/6.3 and documented; closing.
[12 Dec 2008 23:29] Bugs System
Pushed into 6.0.6-alpha  (revid:sp1r-tomas@poseidon.bredbandsbolaget.se-20080316141526-26346) (version source revid:sp1r-tomas@poseidon.ndb.mysql.com-20080516085603-30848) (pib:5)