[COMPASS-4232] Adding a space in Compass connection string removes Replica Set node hostname Created: 03/Apr/20  Updated: 29/Oct/23  Resolved: 07/Feb/22

Status: Closed
Project: Compass
Component/s: Compass
Affects Version/s: 1.20.5
Fix Version/s: 1.31.0

Type: Bug Priority: Minor - P4
Reporter: Felicia Hsieh Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

macOS 10.14.6


Issue Links:
Related
Epic Link: COMPASS-4948
Documentation Changes: Not Needed

 Description   

Original Connection String: mongodb://uuuuu:xxx@mongo1.cc.org:27117,mongo2.cc.org:27117,mongo3.cc.org:27117?authSource=admin&replicaSet=rsP1edg1&readPreference=primary&appname=MongoDB%20Compass&ssl=false

Add a space after the first comma in the connection string
Click "Fill in connection fields individually"
Click "Paste connection string"
New Connection string is missing 2nd node member.
mongodb://uuuuu:xxx@mongo1.cc.org:27117,:27017,mongo3.cc.org:27117/test?authSource=admin&replicaSet=rs0&readPreference=primary&appname=MongoDB%20Compass&ssl=false

 

Note, the port number changed to 27017 for the 2nd listed replica set node.


Added a space between each [node]:[port] name for a total of 3 spaces. It appears the connection is saved successfully.

Repeat above steps.

Resulting connection string is:

mongodb://uuuuu:xxx@mongo1.cc.org:27117,:27017,:27017/test?authSource=admin&replicaSet=rs0&readPreference=primary&appname=MongoDB%20Compass&ssl=false

 

____________________
Another way that spaces affect connection string:

Original connection string: Note the space after ":" in 2 places.

mongodb://testUser:password@xx1: 27117,xx2: 27117,xx3:27117/?authSource=admin&replicaSet=rs0&readPreference=primary&appname=MongoDB Compass&ssl=false

Click "Fill in connection fields individually"

New connection string:
mongodb://testUser:password@xx1:27017,xx2:27017,xx3:27117/test?authSource=admin&replicaSet=rs0&readPreference=primary&appname=MongoDB%20Compass&ssl=false

Port number changed in 2 places.



 Comments   
Comment by Rhys Howell [ 07/Feb/22 ]

This has been fixed with the new connection form. Now we do not restrict host inputs in the form, and handle spaces as normal characters.

Generated at Wed Feb 07 22:35:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.