From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id B4B4D60CCD for ; Mon, 19 Oct 2020 14:39:14 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A28A72CD02 for ; Mon, 19 Oct 2020 14:38:44 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id AA3A72CCF4 for ; Mon, 19 Oct 2020 14:38:43 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6AB0445E07 for ; Mon, 19 Oct 2020 14:38:43 +0200 (CEST) To: Proxmox VE development discussion , Fabian Ebner References: <20201019105300.17898-1-f.ebner@proxmox.com> From: Thomas Lamprecht Message-ID: <7a6f8e5a-972d-166c-dafc-ccdd049226f7@proxmox.com> Date: Mon, 19 Oct 2020 14:38:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Thunderbird/82.0 MIME-Version: 1.0 In-Reply-To: <20201019105300.17898-1-f.ebner@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.130 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH manager] get_included_guests: handle non-existing guests X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 12:39:14 -0000 (FYI: forgot to hit reply-all, so resending this for the list) On 19.10.20 12:53, Fabian Ebner wrote: > If a guest is removed without purge, the ID will remain > in the backup configuration. Avoid using the variable $node > when it is potentially undefined. Instead, skip non-existing > guests and warn the user. > > Reported here: > https://forum.proxmox.com/threads/purge-backup-does-not-remove-vm-from-datacenter-backup-list.77609/ a backup job referencing to an non-existent VM must fail, that's by design. People should either use purge, if they really want to purge a VM, or else remove it manually from the job. It's just important that the backup of the remaining, existing, VMs is made nonetheless, but the job is not successful, as it was asked to backup something that does not exists - making such errors less prominent is not ideal. > > Signed-off-by: Fabian Ebner > --- > PVE/VZDump.pm | 5 +++++ > test/vzdump_guest_included_test.pl | 12 +++++++++++- > 2 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm > index 542228d6..6dbb6a44 100644 > --- a/PVE/VZDump.pm > +++ b/PVE/VZDump.pm > @@ -1217,6 +1217,11 @@ sub get_included_guests { > $vmids = check_vmids(@$vmids); > > for my $vmid (@$vmids) { > + if (!defined($vmlist->{ids}->{$vmid})) { > + debugmsg('warn', "no guest with ID '$vmid' exists in the cluster!"); > + next; > + } > + > my $node = $vmlist->{ids}->{$vmid}->{node}; > next if (defined $job->{node} && $job->{node} ne $node); >