[SERVER-64852] mongod --outputConfig produces incorrect YAML option name (replSet vs. replSetName) Created: 23/Mar/22 Updated: 29/Oct/23 Resolved: 07/Aug/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.4.8, 5.0.5 |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Gary Taylor | Assignee: | Shreyas Kalyan |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Server Security
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Requested: |
v7.0, v6.0, v5.0, v4.4
|
||||||||||||
| Steps To Reproduce: |
https://www.mongodb.com/docs/manual/reference/program/mongod/#std-option-mongod.–replSet{{}} Running: "mongod --replSet s0 --logpath "/data/logs/s0-r0.log" --dbpath /data/shard0/rs0 --bind_ip_all --port 37017 --fork --outputConfig" produces the following YAML output. Output below (generated by --outputConfig) to be used as a mongod configuration file. net: However, if you use this output as a configuration file, mongod will not start as you get the following error: "Unrecognized option: replication.replSet" The following manual correction in the YAML file below allows mongod to start replication:
--outputConfig should output the correct name (replSetName) for use in the YAML file as it is different from the name that needs to be used as a command line option (replSet) |
||||||||||||
| Sprint: | Security 2022-12-12, Security 2022-12-26, Security 2023-01-09, Security 2023-01-23, Security 2023-02-06, Security 2023-05-01, Security 2023-05-15, Security 2023-06-12, Security 2023-07-24, Security 2023-08-07, Security 2023-08-21 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
Using "–outputConfig" to create a YAML configuration file produces an incorrect option name for the replica set name. Tested in 5.0.5 but also seen in other versions of MongoDB (4.4.8) and likely many others.
|
| Comments |
| Comment by Shreyas Kalyan [ 22/Aug/23 ] |
|
We decided to not move forward with backporting these to prior server versions. If there is customer demand for this, please re-open the backport tickets. |
| Comment by Githook User [ 07/Aug/23 ] |
|
Author: {'name': 'Shreyas Kalyan', 'email': 'shreyas.kalyan@mongodb.com', 'username': 'shreyaskal'}Message: |
| Comment by Sara Golemon [ 28/Mar/22 ] |
|
Looks like both names are "valid" (for certain values of valid): https://github.com/mongodb/mongo/blob/dfc76374438cab06a7cce2a43280a7aa69432d78/src/mongo/db/mongod_options_replication.idl#L64-L76 The imbalance comes from one being valid for YAML configs (using full name), while the other is only valid in INI/CLI. This means that the fix here is non-trivial, our options are:
|
| Comment by Edwin Zhou [ 24/Mar/22 ] |
|
|