-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 4.4.0-rc0, 4.4.0-rc5
-
Component/s: Logging
-
None
-
Security 2020-06-01
In versions before 4.4, we've been using `mongo --quiet --eval '...'` as a way to run simple Javascript expressions against a MongoDB instance for querying in shell scripts, and that has been very successful and prior to 4.4 the output to standard output (which is then capturable in the shell script) has been limited to just the result of the expression (`db.test.count()` would return just a single number, etc).
In 4.4 (following https://jira.mongodb.org/browse/SERVER-44676 & https://github.com/mongodb/mongo/commit/8189e058304baa734ea892b69c37d16021e17a2f), this behavior changed such that we get an additional (unexpected) warning to standard output about TCP Fast Open, and the warning itself comes in Javascript format, presumably because it was intended for output to the daemon logs (where it also appears on 4.4+):
{"t":{"$date":"2020-03-04T23:26:42.849Z"},"s":"I", "c":"NETWORK", "id":23014,"ctx":"main","msg":"{foStatus_reason}","attr":{"foStatus_reason":"TCP FastOpen support requested, but disabled in kernel. Set /proc/sys/net/ipv4/tcp_fastopen to 3"}}
Now, we can use something like `grep` to ignore the warning, but IMO it should probably either go to standard error instead, or not show up in the output of the `mongo` CLI tool at all (especially when using `--quiet`).
- is related to
-
SERVER-46932 Shell produces json output
- Closed