Bug #77100
closedmgr/rook: get_hosts() returns slash-joined addr, breaking socket.getaddrinfo() consumers
0%
Description
Component: mgr/rook
Summary¶
RookCluster.get_hosts() in src/pybind/mgr/rook/rook_cluster.py buildsorchestrator.HostSpec.addr by slash-joining every entry innode.status.addresses:
addr='/'.join([addr.address for addr in node.status.addresses])
node.status.addresses is a list of V1NodeAddress entries with types like
InternalIP, ExternalIP, Hostname. The join produces strings such as"10.248.0.3/np6b438a15bf1a4" (InternalIP + Hostname). The orchestrator
interface documents HostSpec.addr as a single "dns name or IP" (see PR
#33098), and consumers treat it as one resolvable address.
Symptom¶
mgr/nfs resolve_ip() calls socket.getaddrinfo() on that joined string
and fails:
Error EINVAL: Cannot resolve IP for host 10.248.0.3/np6b438a15bf1a4: [Errno -2] Name or service not known
Reproduced via OpenStack Manila's CephFS driver, which callsceph nfs cluster info <cluster> during share creation; Manila surfaces it
as errno -22 and share creation fails. The malformed value is also visible
directly in ceph orch host ls:
HOST ADDR np3e44820d254c4 10.248.0.4/np3e44820d254c4 np6b438a15bf1a4 10.248.0.3/np6b438a15bf1a4
Any consumer that resolves HostSpec.addr as an IP is affected (mgr/nfs;
also mgr/dashboard and any socket.getaddrinfo caller).
Affected versions¶
Introduced in commit 571e609b27b ("mgr/rook: host add/rm label in rook
orchestrator", Sept 2021), first released in v17.1.0. Present on quincy,
reef, squid, tentacle, and main.
Fix¶
Pick a single address in get_hosts(): prefer InternalIP (always present
on managed nodes, routable cluster-internally), fall back to the first
address. The hostname is already carried as HostSpec's name, so nothing is
lost. Additionally harden mgr/nfs resolve_ip() to strip the legacy
"<ip>/<hostname>" format so a newer mgr keeps working against older Rook
backends.
VK Updated by Vladimir Kozhukalov 6 months ago
- Affected Versions v17.2.0, v17.2.1, v17.2.2, v17.2.3, v17.2.4, v17.2.5, v17.2.6, v17.2.7, v17.2.8, v18.0.0, v18.1.0, v18.1.1, v18.1.2, v18.1.3, v18.2.0, v18.2.1, v18.2.2, v18.2.3, v18.2.4, v18.2.5, v18.2.6, v18.2.7, v18.2.8, v19.1.0, v19.1.1, v19.2.0, v19.2.1, v19.2.2, v19.2.3, v19.2.4, v19.2.5, v20.0.0, v20.2.0, v20.2.1, v20.2.2, v20.2.3, v21.0.0, v22.0.0 added
RK Updated by Redouane Kachach Elhicou 2 months ago
- Status changed from New to Pending Backport
- Backport set to umbrella, tentacle
UB Updated by Upkeep Bot 2 months ago
Redmine Upkeep failure¶
The redmine-upkeep.py script failed to update this issue. I have added the flag "upkeep-failed" to avoid looking at this issue again.
Please manually fix the issue and remove "upkeep-failed" flag to allow future upkeep operations.
Transformation¶
The script was in the create_backports transformation.
Update Log¶
Error¶
Issue #77100 with status Pending Backport is missing a Pull Request ID.
A Pull Request ID is required to create backports. Please set the "Pull Request ID" custom field to the appropriate GitHub PR number.