[SERVER-27311] 3.2.10 js client prints trace messages in output of js script Created: 07/Dec/16  Updated: 03/Jan/17  Resolved: 03/Jan/17

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Dharshan Rangegowda Assignee: Andrew Morrow (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-18643 Output redirection from mongo shell Closed
Operating System: ALL
Sprint: Platforms 2017-01-23
Participants:

 Description   

On 3.2.10 when running a script from the JS

E.g. If I run db.printReplicationInfo() in test.js
mongo --ssl --sslAllowInvalidCertificates --port 27017 --quiet admin -u admin -p <> test.js
2016-12-07T06:06:45.892+0000 W NETWORK [thread1] The server certificate does not match the host name 127.0.0.1
configured oplog size: 990MB
log length start to end: 75783secs (21.05hrs)
oplog first event time: Mon Dec 05 2016 12:03:29 GMT+0000 (UTC)
oplog last event time: Tue Dec 06 2016 09:06:32 GMT+0000 (UTC)
now: Wed Dec 07 2016 06:06:45 GMT+0000 (UTC)

Looks like when you have a self signed certificate it prints this to standard output as the first line.



 Comments   
Comment by Andrew Morrow (Inactive) [ 03/Jan/17 ]

Please follow SERVER-18643 to get updates on adding support for the shell to log to stderr by default.

Comment by Andrew Morrow (Inactive) [ 03/Jan/17 ]

Hi dharshanr@scalegrid.net - Thanks for confirming. I'm going to close this ticket as a duplicate of SERVER-18643.

Comment by Dharshan Rangegowda [ 03/Jan/17 ]

Hi

In my opinion trace that is printed to the screen is not relevant and should not be printed out. Redirecting the trace to the stderr will work.

Comment by Andrew Morrow (Inactive) [ 03/Jan/17 ]

I believe this is essentially a duplicate of SERVER-18643 (or one of the related tickets), that is asking for the shell output to be issued to stderr, rather than stdout. Would that solution help in your use case? It would allow you to redirect the stderr output to /dev/null or another file, so that it wasn't intermixed with the normal shell output, or to redirect stderr to stdout, if you wanted to see it inline.

Generated at Thu Feb 08 04:14:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.