[SERVER-35705] Server incorrectly assumes legacy config file is YAML due to trailing colon in bind_ip value Created: 20/Jun/18 Updated: 06/Dec/22 Resolved: 21/Sep/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin |
| Affects Version/s: | 3.0.15, 4.0.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Jeremy Mikola | Assignee: | Backlog - Service Architecture |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Service Arch
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
I discovered what may be a bug in the server's format detection for configuration files (between legacy 2.4 format and YAML, which was introduced in 2.6). Consider:
Since I was working with a 3.0 server, I was using the bind_ip equivalent for bind_ip_all (introduced in 3.6). This is a configuration file produced by Mongo Orchestration. Since MO supports 2.4, it generates config files in the legacy format. Here, it looks like the the trailing colon on line 8 caused mongod to assume it was loading a YAML config file. Values in legacy 2.4 config files cannot be quoted. I attempted to wrap 0.0.0.0,:: in quotes and observed the following startup error:
I was able to work around this issue by swapping the order of the IP addresses to ::,0.0.0.0. Assuming this is a bug, I certainly don't expect that a fix would be backported to 3.0 (or 2.6). It may be prudent to simply change the order of the IP addresses in our documentation, which should minimize the chance of other users coming across this. |
| Comments |
| Comment by Ratika Gandhi [ 21/Sep/20 ] |
|
Closing this ticket because we no longer support ini for config files and there is a workaround available. |
| Comment by Githook User [ 21/Jun/18 ] |
|
Author: {'username': 'jmikola', 'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com'}Message: Reorder bind_ip addresses to work around This fixes an issue introduced in 0f2e38730bc68f700fa4cc69543b44fe0ca5f12f. Trailing colons causes mongod to incorrectly assume the legacy config file produced by MO is in YAML format. We can work around this by swapping the order of the IPv6 and IPv4 addresses. |