If an admin removes a node he may also remove /etc/pve/nodes/NODE
quite soon after that, if the "node really deleted" logic of our
NodeStatus module has not triggered until then (it waits an hour) the
current manager still tries to read the gone nodes LRM status, which
results in an exception. Move this exception to a warn and return a
node == unkown state in such a case.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
my $cfs_path = "nodes/$node/lrm_status";
my $raw = PVE::Cluster::get_config($cfs_path);
- die "unable to read file '/etc/pve/$cfs_path'\n"
- if !defined($raw);
+ if (!defined($raw)) {
+ # ENOENT -> possible deleted node, don't die here as it breaks our node
+ # 'gone' logic
+ warn "unable to read file '/etc/pve/$cfs_path'\n";
+ # unkown mode set explicitly as 'active' is assumed as default..
+ return { mode => 'unknown' } if ! -e "/etc/pve/$cfs_path";
+ }
return json_reader(undef, $raw);
}