Bug 1856263
| Summary: | redis fails to bind an ip at system boot with "bind: Cannot assign requested address" | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Muneaki Sugaya <msugaya> | |
| Component: | NetworkManager | Assignee: | NetworkManager Development Team <nm-team> | |
| Status: | CLOSED NOTABUG | QA Contact: | Desktop QE <desktop-qa-list> | |
| Severity: | unspecified | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 8.2 | CC: | acardace, atragler, bgalvani, lrintel, rcollet, rkhan, sukulkar, thaller, till | |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
|
| Target Release: | 8.0 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1858218 (view as bug list) | Environment: | ||
| Last Closed: | 2020-07-17 09:24:44 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1858218 | |||
|
Description
Muneaki Sugaya
2020-07-13 08:43:20 UTC
Could be the issue described here: https://serverfault.com/questions/941421/servers-fail-to-bind-to-addresses-at-boot Is NetworkManager involved, and if so is NetworkManager-wait-online enabled? AFAICT, the Redis service has a correct 'After' line for network-online. please provide a full level=TRACE log of a boot that shows the issue. See https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/contrib/fedora/rpm/NetworkManager.conf#n28 for how to get logs from NetworkManager. thanks for the log!!
You can see there:
```
NetworkManager[798]: <info> [1594816384.6047] manager: startup complete
```
and only later
```
NetworkManager[798]: <debug> [1594816386.6750] platform: (eth1) signal: link added: 3: eth1 <DOWN;broadcast,multicast> mtu 1500 arp 1
...
NetworkManager[798]: <debug> [1594816386.7147] platform: (ens3) signal: link changed: 2: ens3 <DOWN;broadcast,multicast> mtu 1500 arp 1 ethernet? no
```
That means, the driver takes an unusually long time to detect the interface. NetworkManager doesn't know that the device will still show up, and at that point already declared "startup complete". Thus, "network-online.target" gets reached too early and Redis service gets start too early.
A possibly fix is to configure "connection.wait-device-timeout" to for example 5000 (milliseconds). See `man nm-settings`. Note that the manual tells you that this option only works if you also set "connection.interface-name", but luckily, your logs shows that you already do that.
Could you try with
nmcli connection modify 75856aad-c9b9-41d7-b8fc-433c6372f521 connection.wait-device-timeout 5000
and reboot?
Check the logs for the "startup complete" line. That is what corresponds to completing NetworkManager-wait-online.service (and network-online.target). You don't want that to be reached too early.
I guess, a significantly more ugly workaround would be to start a systemd dummy service "Before=NetworkManager.service" that only does "sleep 5".
> However I think it doesn't guarantee that the redis.service start after the processing for ens3 is completed. So there is a possibility that it might not work. Am I right?
Why do you think so? No, it's supposed to work now.
Ah right. There is a possible small issue. I opened bug 1858218 for that. However, it should still work mostly fine. Also, because you can already bind to an address, even if the device has no carrier yet. The original issue should be avoided by configuring connection.wait-device-timeout. I don't think there is anything left to do. Closing. Please reopen, if something is missing. Thanks!! (btw, the real fix is for Redis not being so fragile, and itself react dynamically when addresses come and go. network-online.target is a workaround for services that don't properly handle networking to change). |