[SERVER-28072] Running a script using 'mongo' on replication set fails Created: 22/Feb/17  Updated: 16/Nov/21  Resolved: 04/Oct/17

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 3.4.2
Fix Version/s: 3.4.11, 3.6.0-rc0

Type: Bug Priority: Major - P3
Reporter: Tom Leibu Assignee: Sara Golemon
Resolution: Done Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Duplicate
is duplicated by SERVER-30921 mongo cli --host argument regression ... Closed
Related
related to SERVER-27289 Shell: mongo --host replSet/Host:Port... Closed
is related to SERVER-31437 Fix parsing of `mongo host/db` connec... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4
Steps To Reproduce:

OS: CentOS Linux release 7.1.1503 (Core)

Just run this line.
mongo --host rs0/machine48 management some.js

Sprint: Platforms 2017-07-31, Platforms 2017-09-11, Platforms 2017-10-02, Platforms 2017-10-23
Participants:

 Description   

rIt seems like there's a regression bug

Prior to 3.4.2 this command succeeded:
mongo --host rs0/machine48 management some.js

The current output I'm getting is:

MongoDB shell version v3.4.2
connecting to: mongodb://rs0/machine48:27017/management
2017-02-22T19:49:33.827+0200 E QUERY [thread1] Error: Failed to parse mongodb:// URL: mongodb://rs0/machine48:27017/management :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed



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

Author:

{'name': 'Sara Golemon', 'username': 'sgolemon', 'email': 'sara.golemon@mongodb.com'}

Message: SERVER-28072 Construct mongodb:// URI from RS string and dbname

(cherry picked from commit 592208bb012bee0355d2024dcbc062185e6d22e7)
Branch: v3.4
https://github.com/mongodb/mongo/commit/e76bc63489eea392e82d9a029a578541c9cdff33

Comment by Githook User [ 04/Oct/17 ]

Author:

{'email': 'sara.golemon@mongodb.com', 'name': 'Sara Golemon', 'username': 'sgolemon'}

Message: SERVER-28072 Construct mongodb:// URI from RS string and dbname
Branch: master
https://github.com/mongodb/mongo/commit/592208bb012bee0355d2024dcbc062185e6d22e7

Comment by Andrew Morrow (Inactive) [ 21/Aug/17 ]

mskalick - The ticket is currently marked 3.5 required, and scheduled for our next development sprint. The fix will go to master first, and then (presumably) get backported, but it seems reasonable to expect to see a fix for this land in the 3.4 branch within the next month or so, barring surprises or re-prioritization.

Comment by Marek Skalický [ 21/Aug/17 ]

What is a status of this please?

This broke our scripts. And it would be great to have this fixed.

Comment by Tyler Kaye [ 10/Aug/17 ]

This is a different problem from the one solved in SERVER-29921. Placing this back on the backlog.

Comment by Mark Agarunov [ 27/Feb/17 ]

Hello tomzan,

Upon further investigation, this does appear to be a regression. You can watch this ticket for updates on this issue. In the meantime, the newer connection string format can be used as a workaround.

Thanks,
Mark

Comment by Mark Agarunov [ 23/Feb/17 ]

Hello tomzan,

Thank you for the report. Looking over the output you've provided, this behavior seems to be due to the bug detailed in SERVER-27289. Please note that the connection string format has changed, which may be the cause of the behavior you're seeing. For example, the connection string you provided:

rs0/machine48 management

Would now be

mongodb://machine48/management?replicaSet=rs0

If this behavior is still present with the updated connection string, please let me know so that we can continue investigating.

Thanks,
Mark

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