[SERVER-27289] Shell: mongo --host replSet/Host:Port no longer works Created: 05/Dec/16 Updated: 26/May/17 Resolved: 13/Dec/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 3.4.0 |
| Fix Version/s: | 3.4.2, 3.5.1 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Vick Mena (Inactive) | Assignee: | Matt Cotter |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||||||
| Backport Requested: |
v3.4
|
||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: |
|
||||||||||||||||||||||||||||||||||||||||
| Sprint: | Platforms 2017-01-23 | ||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||||||||||||||
| Description |
|
In v3.4 the following no longer works
Where it used to work in v3.2
The documentation has an example. |
| Comments |
| Comment by James Lucas [ 15/Mar/17 ] | |||||||||||||||||||||||||||||||
|
This also appears to break running javascript files from the command line, since you have to specify them after the target database name. | |||||||||||||||||||||||||||||||
| Comment by Mark Agarunov [ 15/Mar/17 ] | |||||||||||||||||||||||||||||||
|
Hello jlucas, Thank you for reporting this behavior. This appears to be an instance of the issue described in Thanks, | |||||||||||||||||||||||||||||||
| Comment by James Lucas [ 15/Mar/17 ] | |||||||||||||||||||||||||||||||
|
Just wanted to report that I'm still seeing this issue in 3.4.2 on Linux, when trying to specify a default database (which is needed for user authentication from the command line). This is regardless of whether I include a port specification or not. mongo --host 'rs0/mongotest1,mongotest2' admin Specifying the full url in the --host string does work. mongo --host 'mongodb://mongotest1,mongotest2/admin?replicaSet=rs0' This change from previous behavior seems to have great potential to break scripts or jobs people may have created under older versions. The manpage also specified the rsname/host1,host2 format. | |||||||||||||||||||||||||||||||
| Comment by Jonathan Reams [ 03/Feb/17 ] | |||||||||||||||||||||||||||||||
|
Ah, the format for replica sets in URIs is not quite the same as the old connection string format. If you want to connect to a replica set with a URI you should do mongodb://host1:port,host2:port,host3:port/databasename?replicaSet=replicaSetName. You can read more about it here https://docs.mongodb.com/manual/reference/connection-string/. Let me know if you have any more questions or problems, I want to make sure this is fixed! | |||||||||||||||||||||||||||||||
| Comment by Nick Larson [ 03/Feb/17 ] | |||||||||||||||||||||||||||||||
|
Ahh taking a look it appears it IS partially fixed. However it still seems to be breaking when specifying a port as an additional argument.
If I include port as part of the host, it works fine. Maybe has something to do with '--port' adding the trailing slash at the end? If I manually add the trailing slash it breaks as well.
Edit: disregard my broken replica set. Edit2: More info. Looks like it breaks when specifying a default database as well (again, maybe do to the trailing slash after port?? wild guess)
| |||||||||||||||||||||||||||||||
| Comment by Daniel Pasette (Inactive) [ 03/Feb/17 ] | |||||||||||||||||||||||||||||||
|
Hi Nick,
| |||||||||||||||||||||||||||||||
| Comment by Nick Larson [ 03/Feb/17 ] | |||||||||||||||||||||||||||||||
|
FYI still not working for me on 3.4.2 | |||||||||||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 18/Jan/17 ] | |||||||||||||||||||||||||||||||
|
ankon, the fix for this bug was backported to the v3.4 branch earlier today and will be part of the upcoming 3.4.2 release in a few weeks. Regards, | |||||||||||||||||||||||||||||||
| Comment by Githook User [ 18/Jan/17 ] | |||||||||||||||||||||||||||||||
|
Author: {u'username': u'Machyne', u'name': u'Matt Cotter', u'email': u'matt.cotter@mongodb.com'}Message: (cherry picked from commit 68c8715feaa2ead6a3c25eb9aa512de779c4795d) | |||||||||||||||||||||||||||||||
| Comment by Andreas Kohn [ 14/Dec/16 ] | |||||||||||||||||||||||||||||||
|
As this fixes a 3.4 regression, are there plans to backport this to 3.4? If so, which ticket should I watch for updates? (FWIW: This did break our startup scripts, and therefore blocks our upgrade) | |||||||||||||||||||||||||||||||
| Comment by Githook User [ 13/Dec/16 ] | |||||||||||||||||||||||||||||||
|
Author: {u'username': u'Machyne', u'name': u'Matt Cotter', u'email': u'matt.cotter@mongodb.com'}Message: | |||||||||||||||||||||||||||||||
| Comment by Githook User [ 12/Dec/16 ] | |||||||||||||||||||||||||||||||
|
Author: {u'username': u'Machyne', u'name': u'Matt Cotter', u'email': u'matt.cotter@mongodb.com'}Message: Revert " This reverts commit b9c59fd5c79c0b0d9c845e3c05e50ab1dd9f7f4a. | |||||||||||||||||||||||||||||||
| Comment by Githook User [ 12/Dec/16 ] | |||||||||||||||||||||||||||||||
|
Author: {u'username': u'Machyne', u'name': u'Matt Cotter', u'email': u'matt.cotter@mongodb.com'}Message: | |||||||||||||||||||||||||||||||
| Comment by Vick Mena (Inactive) [ 05/Dec/16 ] | |||||||||||||||||||||||||||||||
matt.cotter Full URI does work. | |||||||||||||||||||||||||||||||
| Comment by Matt Cotter [ 05/Dec/16 ] | |||||||||||||||||||||||||||||||
|
This regression is likely due to the linked ticket vick.mena can you verify that you are able to connect if you provide a full mongodb uri? |