[SERVER-32631] specifying --bind_ip localhost results in error "address already in use" Created: 10/Jan/18 Updated: 30/Oct/23 Resolved: 12/Jan/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Networking |
| Affects Version/s: | 3.6.0, 3.6.1 |
| Fix Version/s: | 3.6.3, 3.7.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Arnie Listhaus | Assignee: | Sara Golemon |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
CentOS Linux release 7.4.1708 (Core) |
||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Backport Requested: |
v3.6
|
||||||||||||||||
| Steps To Reproduce: | mongod --bind_ip localhost --dbpath data --logpath mongod.log |
||||||||||||||||
| Participants: | |||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||
| Description |
|
Specifying --bind_ip localhost with or without an additional ip address results in the server error:
As a result, it is not possible to start a server that binds to both localhost and an alternate IP address. |
| Comments |
| Comment by Ian Sutherland [ 14/Aug/18 ] |
|
I'm still encountering this issue with MongoDB 4.0.1, specifically when running on CircleCI. They appear to be running Ubuntu 14.04.1. |
| Comment by Githook User [ 28/Jan/18 ] |
|
Author: {'email': 'sara.golemon@mongodb.com', 'name': 'Sara Golemon', 'username': 'sgolemon'}Message: (cherry picked from commit 62c9eedec658912f796f5bcdb25f57891e4069ca) |
| Comment by Sara Golemon [ 12/Jan/18 ] |
|
Thanks for the report. It turns out getaddrinfo() does something surprising when asked for IPv4 addresses only, and there are localhost entries for both IPv4 and IPv6. We're going to deal with this by simply de-duping the response, allowing us to tell the difference between an address in use by another application versus an address in use by ourselves. This fix is on the main development branch currently and should shortly be backported to 3.6. |
| Comment by Githook User [ 12/Jan/18 ] |
|
Author: {'email': 'sara.golemon@mongodb.com', 'name': 'Sara Golemon', 'username': 'sgolemon'}Message: |