project-pegaprox icon indicating copy to clipboard operation
project-pegaprox copied to clipboard

[Bug] Host Updates stuck with (Updating) indicator

Open nikcomp opened this issue 5 months ago • 1 comments

Title: Node remains stuck as “Updating” in sidebar after successful host update/reboot

Summary

After running a Proxmox node update from PegaProx with reboot enabled, the update completes successfully and the node comes back online, but the left sidebar continues to show the node as (Updating). The node detail page shows the host is online and up to date, but the sidebar state does not clear.

Environment

  • PegaProx version: <fill in exact version from UI>
  • Proxmox VE: 9.2.3
  • Update target: Proxmox node
  • Update mode: node update with reboot enabled
  • Cluster uses SSH key authentication for node maintenance/update actions

Observed behavior

  1. Put node into maintenance mode from PegaProx.
  2. Start node update with reboot enabled.
  3. PegaProx successfully evacuates the node.
  4. PegaProx runs the update.
  5. PegaProx reboots the node.
  6. PegaProx detects the node is back online.
  7. PegaProx exits maintenance mode.
  8. Logs show the update completed.
  9. Sidebar still shows the node as (Updating).

The node page itself shows the host is online and has 0 updates, but the sidebar still shows the update state.

Relevant log excerpt

[SYNC] Starting update for node: proxmoxb (reboot: True, force: False)
Sending reboot command to proxmoxb (root=True)
Waiting for proxmoxb to come back online (timeout: 600s)...
[OK] proxmoxb is back online!
[HA] Running: ssh [email protected] 'ha-manager crm-command node-maintenance disable proxmoxb'
[MAINT] disabled native HA maintenance for proxmoxb
[OK] Exited maintenance mode for proxmoxb
[OK] Node update completed for proxmoxb

Expected behavior

Once the node update completes successfully, the sidebar should stop showing (Updating) automatically.

Actual behavior

The sidebar continues to show (Updating) even though:

  • the node is back online
  • maintenance mode has been exited
  • the update logs show completion
  • the node page shows 0 updates

Restarting the pegaprox.service clears the stale sidebar state, but that is not a reasonable operational workaround after every host update.

Likely cause

From local source inspection, the sidebar appears to calculate update state using membership in self.nodes_updating:

is_updating = node_name in self.nodes_updating

The update-start path adds the node:

self.nodes_updating[node_name] = task

The completion path logs:

self.logger.info(f"[OK] Node update completed for {node_name}")

but does not appear to remove the node from self.nodes_updating.

There is already a cleanup method:

def clear_update_status(self, node_name: str) -> bool:
    with self.update_lock:
        if node_name in self.nodes_updating:
            task = self.nodes_updating[node_name]
            if task.status in ['completed', 'failed']:
                del self.nodes_updating[node_name]
                return True
    return False

So the task can complete, but the node can remain in self.nodes_updating, causing the sidebar to continue showing (Updating).

Suggested fix

On successful completion and failed completion, either:

  1. remove the node from self.nodes_updating, or
  2. update the sidebar logic so (Updating) only displays for active task states such as starting, updating, rebooting, or waiting_online.

The cleaner fix may be to remove the node from self.nodes_updating when the update reaches a terminal state, since the current sidebar logic treats dictionary membership as active update state.

Impact

This makes it look like a host update is still running even after it completed successfully. In production this is confusing and can cause admins to avoid continuing maintenance or to restart PegaProx unnecessarily.

nikcomp avatar Jun 27 '26 14:06 nikcomp

👋 Thanks for reporting a bug!

Unfortunately, it looks like some required information is missing.

Please provide:

  • [ ] Describe the bug
  • [ ] Steps to Reproduce

Why? We are volunteers maintaining PegaProx in our free time. Complete bug reports help us fix issues faster. 🐾

Closing for now — please reopen with the required details or open a new issue.

This is an automated message.

github-actions[bot] avatar Jun 27 '26 14:06 github-actions[bot]