[SERVER-2011] mongodump, bsondump and mongoexport should only write to stderr in case of a serious error Created: 26/Oct/10 Updated: 26/Oct/15 Resolved: 08/Apr/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Tools |
| Affects Version/s: | None |
| Fix Version/s: | 2.5.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Micah Wedemeyer | Assignee: | Shaun Verch |
| Resolution: | Done | Votes: | 8 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
I'm the "author" of the AutoMongoDump tool on github (github.com/ Anyways, it seems that every time mongodump runs, it writes some debug I'd like to request that if anyone chooses to refactor or work on |
| Comments |
| Comment by Shaun Verch [ 08/Apr/13 ] | |||
|
The --quiet option now will silence all informational messages, which should account for this use case. | |||
| Comment by auto [ 08/Apr/13 ] | |||
|
Author: {u'date': u'2013-04-03T22:43:32Z', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}Message: | |||
| Comment by auto [ 14/Dec/12 ] | |||
|
Author: {u'date': u'2012-10-30T21:52:08Z', u'email': u'shaun.verch@10gen.com', u'name': u'Shaun Verch'}Message: | |||
| Comment by auto [ 14/Dec/12 ] | |||
|
Author: {u'date': u'2012-10-30T20:59:09Z', u'email': u'shaun.verch@10gen.com', u'name': u'Shaun Verch'}Message: | |||
| Comment by Eliot Horowitz (Inactive) [ 03/Jun/12 ] | |||
|
This is mostly done - but want to keep open until we audit everything and make sure everything is standardized across all tools. | |||
| Comment by Nils Toedtmann [ 27/Apr/12 ] | |||
|
Well as a sysadmin what you often need for automation is dump tools which
E.g. there should be a way of saying this:
| |||
| Comment by Krzysztof Wilczynski [ 26/Apr/12 ] | |||
|
Hi, So... When having "quiet" and/or "silent" flags, then we have to rely on exit code, which following what is already known to work well would be 0 for success and 1 (or any non-zero) for failure. Now, when "out" flag points to a file name, then supplementary info should go on standard output and errors on standard error, including correct exit code being set. Of course, "quiet" will still silence any supplementary information as well as errors form being shown. When "out" equals to "-", then both supplementary information and errors should go on standard error (since standard out is now taken). Appropriate exit code still has to be set, plus "quiet" flag when set would still suppress printing any extraneous information (on standard error this time). All of this would make something like that possible:
My 2p. Hope that helps KW | |||
| Comment by Nils Toedtmann [ 26/Apr/12 ] | |||
|
Thank you for taking care of this!
(sorry, need to use 'noformat' escaping for markup to not strike out my comment) | |||
| Comment by Brandon Diamond [ 26/Apr/12 ] | |||
|
I'm working on fixing this behavior. Many of these messages were emitted to stdout originally; we moved them to stderr to ensure that messages do not interfere with output when dumping objects to stdout. Any thoughts on adding a flag to disable non-error output to stderr? Would this be a reasonable compromise? | |||
| Comment by Eric Herot [ 26/Apr/12 ] | |||
|
Can I third this? I'm a sysop trying to use meskyanichi's very handy ruby backup script "backup" and for the twenty or so DB backups we do, this is the ONLY thing I get emailed about, and I get an email for all 15 mongo databases!!! This behavior is incorrect, extremely annoying (even dangerous), and exceptionally simple to fix. Why has it not been taken care of? | |||
| Comment by Nils Toedtmann [ 22/Feb/12 ] | |||
|
Tools which write non-critical info to stderr are a pain for every sysadmin. Cron and backup tools (like e.g. rsnapshot) expect that only errors which need to be fixed are written to StdErr, and they will rootmail all stderr to alert the sysadmins. Hence we have to silence these noisy tools (2>/dev/null), introducing the risk that when there are actual errors, we won't notice If mongodump is meant to be used for automated/scriped jobs, this should be fixed. BTW this seems to be a re-occurence of | |||
| Comment by Krzysztof Wilczynski [ 17/Sep/11 ] | |||
|
Hello, I also would like to see this problem solved not only for the sake of "automongobackup" (which is a very nice addition to the tool set surrounding Mongo), but also to maintain consistency concerning that sort of tools – clear separation what goes onto stdout and stderr is always a plus. Said that... having "connected to:" during normal healthy run of "mongodump" is not quite that consistent. Perhaps there is a greater idea hidden here which I am missing Having a look at the source code ...
Also ...
I am not sure why these two lies are being written onto standard error Thank you in advance for looking into this KW |