From ceb9939295fe58c7cf3c36ae619dca06352ed85d Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Wed, 10 Sep 2025 17:01:11 +0000 Subject: [PATCH] fix: ensure cluster endpoints include port number (addresses #428) When detecting Proxmox cluster nodes, the Host field was being set to just the node name without a port. This caused validation to fail with "invalid Port number" error when qdevices were running. Now cluster endpoints properly include the port (8006) in the Host field, allowing clusters with qdevices to be added successfully. --- internal/api/config_handlers.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/api/config_handlers.go b/internal/api/config_handlers.go index 020d5e794..3ec2006f2 100644 --- a/internal/api/config_handlers.go +++ b/internal/api/config_handlers.go @@ -289,10 +289,21 @@ func detectPVECluster(clientConfig proxmox.ClientConfig, nodeName string) (isClu continue } + // Build the host URL with proper port + // Prefer IP if available, otherwise use node name + nodeHost := clusterNode.IP + if nodeHost == "" { + nodeHost = clusterNode.Name + } + // Ensure host has port (PVE uses 8006) + if !strings.Contains(nodeHost, ":") { + nodeHost = nodeHost + ":8006" + } + endpoint := config.ClusterEndpoint{ NodeID: clusterNode.ID, NodeName: clusterNode.Name, - Host: clusterNode.Name, + Host: nodeHost, Online: clusterNode.Online == 1, LastSeen: time.Now(), }