[SERVER-43265] Mongo Shell exits with InvalidOptions error when using URI compressors parameter Created: 11/Sep/19  Updated: 29/Oct/23  Resolved: 10/Oct/19

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 4.2.0
Fix Version/s: 4.3.1, 4.2.2

Type: Bug Priority: Major - P3
Reporter: Frederick Zhang Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
is caused by SERVER-38503 Omitting --networkMessageCompressors ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Steps To Reproduce:

Run mongo 'mongodb://user@host/db?compressors=snappy' (or any other values for compressors except for 'disabled', which is the default value).

Sprint: Dev Tools 2019-10-21
Participants:

 Description   

Mongo Shell exits with

InvalidOptions: ERROR: Cannot specify different network message compressors in connection URI and as a command-line option

when using 'compressors' URI parameter, unless --networkMessageCompressors is given at the same time with same value.

I was able to reproduce this issue using shell 4.1.9, 4.1.13 and 4.2.0 but not 4.1.7. After quickly going through the commits between r4.1.7 and r4.1.9, I guess this is possibly related to 2c0bebbfe5.



 Comments   
Comment by Henrik Edin [ 24/Oct/19 ]

Hi frederick888@tsundere.moe,

The fix just missed the release of 4.2.1 and will be released in 4.2.2.

Sorry for the confusion,
Henrik

Comment by Frederick Zhang [ 19/Oct/19 ]

Issue summary says it's fixed and backported to 4.2.1 but I can still reproduce the problem?

$ mongo --version
MongoDB shell version v4.2.1
git version: edf6d45851c0b9ee15548f0f847df141764a317e
OpenSSL version: OpenSSL 1.1.1d  10 Sep 2019
allocator: tcmalloc
modules: none
build environment:
    distmod: ubuntu1804
    distarch: x86_64
    target_arch: x86_64
$ mongo 'mongodb://example.com/?ssl=true&authSource=admin&compressors=zstd'
InvalidOptions: ERROR: Cannot specify different network message compressors in connection URI and as a command-line option
try 'mongo --help' for more information

Comment by Githook User [ 15/Oct/19 ]

Author:

{'username': 'henrikedin', 'email': 'henrik.edin@mongodb.com', 'name': 'Henrik Edin'}

Message: SERVER-43265 Fix using URI network compressors parameter in shell

(cherry picked from commit ab77143b2163da066776bd965e0cd3a931d9aa10)
Branch: v4.2
https://github.com/mongodb/mongo/commit/b7207194e5dcbf439b5c774cc1970015d545caf8

Comment by Githook User [ 10/Oct/19 ]

Author:

{'username': 'henrikedin', 'email': 'henrik.edin@mongodb.com', 'name': 'Henrik Edin'}

Message: SERVER-43265 Fix using URI network compressors parameter in shell
Branch: master
https://github.com/mongodb/mongo/commit/ab77143b2163da066776bd965e0cd3a931d9aa10

Comment by Carl Champain (Inactive) [ 11/Sep/19 ]

Hi frederick888@tsundere.moe,

Thanks for the report!
I can reproduce this error, I'm passing the ticket along to the Dev Tools team. Please, keep watching it for updates.

Kind regards,
Carl

Generated at Thu Feb 08 05:02:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.