[SERVER-10886] tools with direct db access can produce corrupted output when dumping to stdout in "offline" mode (with --dbpath) Created: 25/Sep/13  Updated: 11/Jul/16  Resolved: 27/Nov/13

Status: Closed
Project: Core Server
Component/s: Logging, Tools
Affects Version/s: 2.4.6
Fix Version/s: 2.5.5

Type: Bug Priority: Major - P3
Reporter: Roman Kozlov Assignee: Shaun Verch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 12.04.3 x86_64


Attachments: File users.bson    
Issue Links:
Duplicate
duplicates SERVER-10885 mongodump produces invalid bson when ... Closed
Related
related to SERVER-10989 --quiet flag does not suppress logged... Closed
Operating System: ALL
Steps To Reproduce:

(see description)

Participants:

 Description   

Some logging leaks into the dump when using mongodump with "--dbpath" and "--out -" options. For example:

$ sudo service mongodb stop
mongodb stop/waiting
$ sudo -u mongodb mongodump --dbpath /var/lib/mongodb/ -d datahub -c users --out - | dd bs=1M count=10 iflag=fullblock of=users.bson
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 2.66285 s, 3.9 MB/s
$ grep -a -F 'Wed Sep 25' users.bson 
# here grep outputs some logging statements intermixed with bson data

File users.bson is attached (it is a bunch of public data from one social network), so you can inspect it yourselves.



 Comments   
Comment by Githook User [ 27/Nov/13 ]

Author:

{u'username': u'Zarkantho', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}

Message: SERVER-10886 Create function to override rawOut destination stream to avoid corrupting tool output
Branch: master
https://github.com/mongodb/mongo/commit/1a78c32529cd9378479170b7577b1eb2509c61ca

Comment by Samantha Ritter (Inactive) [ 29/Oct/13 ]

> mongodump --db digg --collection stories --dbpath /data/db --out - > foo

if there is data being written, it will be corrupted by a "dbexit" message that is logged by the dbexit function. This message should be suppressed, or re-routed to stderr.

Generated at Thu Feb 08 03:24:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.