Bug #52002
closedmgr/dashboard: dashboard 16.2.5 unable to ipv6 wildcard bind
100%
Description
Description of problem¶
Commit 157a7b418 (cherry picked as ad964c42a) updated how the service URL was calculated, but appears to have (inadvertently?) changed the bind address as well.
Affected file: src/pybind/mgr/dashboard/module.py around line 110
If server_addr is "::", it replaces it using get_mgr_ip(). However, the modified variable is used for the CherryPy config option 'server.socket_host' which causes the Dashboard to only bind to the individual manager ip (and not the wildcard address as in previous versions, and as documented).
A workaround for ipv4 can be accomplished by setting server_addr to 0.0.0.0, but then the URL is incorrect. There is no longer any way to bind to the ipv6 wildcard...
The fix should be to use the get_mgr_ip for the URL specifically, and leave the server_addr alone.
Additionally, the URL should be fixed to use the manager ip if the server_addr is :: OR 0.0.0.0.
Environment¶
ceph version
string: ceph version 16.2.5 (0883bdea7337b95e4b611c768c0279868462204a) pacific (stable)- Platform (OS/distro/release): Fedora 34
- Cluster details (nodes, monitors, OSDs): ...
- Did it happen on a stable environment or after a migration/upgrade?: cephadm install
- Browser used (e.g.:
Version 86.0.4240.198 (Official Build) (64-bit)
): Firefox 90
How reproducible¶
Steps:
- Using multi-homed host with multiple networks (eg 10.0.10.50/24, 192.168.10.50/24)
- Install using cephadm with dashboard defaults, with --mon-addrv "[v2:10.0.10.50:3300]"
- Attempt to load the dashboard on a network that differs from the public_network, eg https://192.168.10.50:8443
Actual results¶
Connection fails. Dashboard is bound to a single IP address:
$ ss -lnt | grep 8443
LISTEN 0 5 10.0.10.32:8443 0.0.0.0:*
Expected results¶
Dashboard should be available on all interfaces:
$ ss -lnt | grep 8443
LISTEN 0 128 0.0.0.0:8443 0.0.0.0:*
LISTEN 0 128 [::]:8443 [::]:*
Additional info¶
The initial commit also made the same change to the prometheus module
File: src/pybind/mgr/prometheus/module.py around line 1380
It also changed the wildcard address... and there is no workaround as it affects both ":" and "0.0.0.0" server_addr values.