Skip to content

fix(dcim): skip offline Proxmox nodes in node interface sync - #279

Merged
emersonfelipesp merged 3 commits into
emersonfelipesp:mainfrom
AqujZ1K9:fix/skip-offline-nodes-in-node-interface-sync
Nov 30, 2026
Merged

emersonfelipesp merged 3 commits into
emersonfelipesp:mainfrom
AqujZ1K9:fix/skip-offline-nodes-in-node-interface-sync

Conversation

@AqujZ1K9

Copy link
Copy Markdown
Contributor

Problem

When one member of a Proxmox cluster is offline, the full update fails in the network-interfaces stage for all nodes:

Stage 'network-interfaces' failed (HTTP 503): Error getting node network interfaces from Proxmox

create_all_device_interfaces() loops over cluster_status.node_list and calls load_proxmox_node_network() for every node. For an offline node Proxmox answers GET /nodes/<node>/network with 595 (no route to host). The resulting ProxboxException is not handled per node, so the stage stops and none of the online nodes get their interfaces/IPs synced. There is also no node-level scope on the sync job to work around it.

Fix

Skip nodes that the cluster status already reports as online: false, log a warning, and record a structured stage warning:

{"device": "<node>", "cluster": "<cluster>", "kind": "node_offline",
 "reason": "Proxmox reports the node as offline; node interface sync skipped."}

The stage then returns a WarningList, so it finishes degraded instead of failing. Other stages already behave like this for offline nodes (backup discovery and task history only log warnings).

The change is limited to the offline case. A node that is reported online but fails to answer still raises as before.

Tests

  • New test_batch_node_interface_sync_skips_offline_node_with_warning: two nodes, one offline. Asserts that only the online node's network endpoint is called, the offline node is never looked up in NetBox, its interface is synced, and the result is degraded with the node_offline warning. It fails on main and passes with the fix.
  • tests/test_node_interface_sync.py: 10 passed.
  • Interface / full-update / route test files (test_*node*, test_*interface*, test_full_update*, test_api_routes, test_vm_sync, test_network*, test_netbox_branch_header): 335 passed.
  • ruff check and ruff format --check are clean on the touched files.
  • I could not finish the complete suite locally (the run was killed on my machine before it completed), so CI will be the first full run.

Verified on a real cluster

proxbox-api 0.0.33 + this patch (built with --target raw), netbox-proxbox 0.0.33, NetBox 4.7.6, Proxmox VE 9.3.1, 6 nodes with 1 offline:

  • before: full update aborted at network-interfaces, 0 VM interfaces, 0 node interfaces
  • after: the full update job completed, the log shows Skipping node interface sync for offline Proxmox node <node>, and 114 VM interfaces, 105 node interfaces and the guest IPs were synced

Related: #278 (another failure mode in Docker deployments).

AqujZ1K9 and others added 3 commits November 29, 2026 10:54
An offline cluster member cannot serve /nodes/{node}/network (Proxmox
answers 595), which raised a ProxboxException and aborted the whole
network-interfaces stage for every other node. Skip nodes that the
cluster status reports as offline with a structured node_offline stage
warning, so the stage finishes degraded instead of failing.
The node interface sync guard shifts the source lines and digest of
proxbox_api/routes/dcim/__init__.py, so the committed mounted-operation
contracts and integrity record are regenerated with
scripts/mounted_operation_inventory.py generate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@emersonfelipesp
emersonfelipesp merged commit acabd3a into emersonfelipesp:main Nov 30, 2026
224 checks passed
@emersonfelipesp

Copy link
Copy Markdown
Owner

Thank you for the clear report, the regression test, and the verification on a real cluster.

Merged as a squash commit that credits you as the author. Before merging I made two additions to the branch:

  • merged the current main into it, and
  • regenerated the committed mounted-operation inventory contracts (contracts/mounted-operations*.md, contracts/mounted-operations.json, contracts/operation-inventory-integrity.json). The change moves the source lines and digest of proxbox_api/routes/dcim/__init__.py, which made tests/operation_inventory/test_collection.py::test_default_lifespan_mounts_committed_default_inventory fail. scripts/mounted_operation_inventory.py generate refreshes those files.

The full test suite and CI passed afterwards. The Docker individual-sync problem in #278 is tracked separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants