From 68049e0fb392c53d0a6bcac6fd90c4893218e674 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Tue, 11 Nov 2025 23:04:36 +0000 Subject: [PATCH] Fix pulse-sensor-proxy pvecm errors in LXC containers (related to #600) When pulse-sensor-proxy runs inside an LXC container on a Proxmox host, pvecm status fails with "ipcc_send_rec[1] failed: Unknown error -1" because the container can't access the host's corosync IPC socket. This caused repeated warnings every few seconds even though the proxy can function correctly by discovering local host addresses. Extended the standalone node detection to recognize "ipcc_send_rec" errors as indicating an LXC container deployment and gracefully fall back to local address discovery instead of logging warnings. --- cmd/pulse-sensor-proxy/ssh.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmd/pulse-sensor-proxy/ssh.go b/cmd/pulse-sensor-proxy/ssh.go index 4a4a10b..278826f 100644 --- a/cmd/pulse-sensor-proxy/ssh.go +++ b/cmd/pulse-sensor-proxy/ssh.go @@ -572,13 +572,17 @@ func discoverClusterNodes() ([]string, error) { err := cmd.Run() // pvecm status exits with code 2 on standalone nodes (not in a cluster) - // Treat this as a valid case and discover local host addresses + // Also handle LXC containers where pvecm can't access corosync IPC + // Treat these as valid cases and discover local host addresses if err != nil { stderrStr := stderr.String() - // Check if this is the "not part of a cluster" error + // Check if this is a standalone node or LXC container + // - "does not exist" or "not part of a cluster": standalone node + // - "ipcc_send_rec": running in LXC container without corosync access if strings.Contains(stderrStr, "does not exist") || - strings.Contains(stderrStr, "not part of a cluster") { - log.Info().Msg("Standalone Proxmox node detected (not in cluster) - discovering local host addresses") + strings.Contains(stderrStr, "not part of a cluster") || + strings.Contains(stderrStr, "ipcc_send_rec") { + log.Info().Msg("Standalone Proxmox node or LXC container detected - discovering local host addresses") return discoverLocalHostAddresses() } // For other errors, fail