[SERVER-21745] Shell outputs diagnostic information in batch mode even with --quiet when talking to older mongod versions Created: 02/Dec/15  Updated: 20/Nov/16  Resolved: 09/Nov/16

Status: Closed
Project: Core Server
Component/s: Querying, Shell
Affects Version/s: 3.2.0-rc4
Fix Version/s: 3.2.11, 3.4.0-rc4

Type: Bug Priority: Minor - P4
Reporter: Stuart Hall Assignee: David Storch
Resolution: Done Votes: 7
Labels: code-only
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-20915 Resolve shell readMode on connection ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Steps To Reproduce:

Using a 3.2.0 shell against a 2.6 or 3.0 mongod, execute the following command:

mongo --quiet localhost:27017/test -eval 'db.test.find();'

...note that a warning is displayed, despite the --quiet flag.

Sprint: Query 2016-11-21
Participants:

 Description   

When using the 3.2.0 RC4 shell to query against a 2.6 or 3.0 mongod/mongos, the shell always returns the following warning:

$ mongo --quiet localhost:27017/test -eval 'db.test.find();'
Cannot use 'commands' readMode, degrading to 'legacy' mode

I would suggest that this error should be suppressed when running in batch mode using --quiet, as it will disrupt scripts that depend on generating output in a certain shape (e.g. XML or JSON). It's less important when running in interactive mode.

mongos version mongod version Produces Warning
3.2.0 RC4 2.6.11 Yes
3.2.0 RC4 3.0.7 Yes
3.2.0 RC4 3.2.0 RC4 No


 Comments   
Comment by Githook User [ 15/Nov/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-21745 change shell to not print readMode/writeMode fallback messages

(cherry picked from commit cdaa9c22ed65bede44afca6e696cf5ee20224302)
Branch: v3.2
https://github.com/mongodb/mongo/commit/b34b61e725ca439f6ac1878008a369be20fc3972

Comment by Githook User [ 09/Nov/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-21745 change shell to not print readMode/writeMode fallback messages
Branch: master
https://github.com/mongodb/mongo/commit/cdaa9c22ed65bede44afca6e696cf5ee20224302

Comment by Markus Heikkilä [ 07/Nov/16 ]

Migrating from tokumx(2.0.0) mongod(2.4.10) to mongod 3.2.10, we need to capture output generated by script that dumps index information to .js file from tokumx. That .js is then afterwards run against the 3.2.10 server to recreate indexes in migrated dataset.

In addition to this ticket's problem, if we connect to tokumx replicaset, some additional replica set monitoring output shows up:

```
mongo3.2.10 --quiet --authenticationDatabase authdb -u username -p password replicaset/tokumx_host>/db tokumx_dump_indexes.js
2016-11-07T08:02:42.564+0200 I NETWORK [thread1] Starting new replica set monitor for replicaset/tokumx_host
2016-11-07T08:02:42.565+0200 I NETWORK [ReplicaSetMonitorWatcher] starting
2016-11-07T08:02:42.591+0200 I NETWORK [thread1] changing hosts to <list of replicaset hosts>...
Cannot use 'commands' readMode, degrading to 'legacy' mode
<tokumx_dump_indexes.js output>
```

This additional problem can be avoided by not connecting in replicaset mode when running scripts, but the diagnostic output described in this ticket remains an issue.

Replicaset monitoring output also shows up when connecting to mongodb 3.2.10 replicaset so it's not only a legacy issue.

Comment by John Cole [ 23/Apr/16 ]

This appears to be breaking some of the reports in Robomongo as well.

Comment by Arthur Clément [ 29/Mar/16 ]

Hi,

I have got the same problem with mongo shell 3.2.4. It's not a minor bug because it breaks the output (so the scripts).

Regards,

Arthur

Comment by Ramon Fernandez Marina [ 02/Dec/15 ]

Thanks for your report stuart.hall@masternaut.com, we've put this ticket in "Needs Triage" so it gets considered in the next round of planning.

Cheers,
Ramón.

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