From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 361721FF394 for ; Mon, 6 May 2024 14:40:48 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CE5BD33C1A; Mon, 6 May 2024 14:40:50 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Mon, 6 May 2024 14:40:43 +0200 Message-Id: <20240506124043.43046-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.065 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com, lxc.pm] Subject: [pve-devel] [PATCH container] backup: log errors from rsync 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: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Commit 5582b0c ("vzdump: rsync: make less verbose") talks about making the output less verbose, but it likely did not intended to get rid of the error messages from rsync, but only the uninteresting messages to stdout. The currently used log function is only matching the total transferred and ignores everything else. Split it into an output and error function and log all error messages from rsync. Excerpt from the output with the patch: > INFO: starting first sync /proc/55667/root/ to /mnt/tmp/vzdumptmp62235_113/ > ERROR: rsync: [sender] send_files failed to open "/proc/55667/root/foo/file": Input/output error (5) > ERROR: rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7] > ERROR: Backup of VM 113 failed - command 'rsync --stats -h -X -A --numeric-ids -aH --delete --no-whole-file --sparse --one-file-system --relative '--exclude=/tmp/?*' '--exclude=/var/tmp/?*' '--exclude=/var/run/?*.pid' /proc/55667/root//./ /proc/55667/root//./foo /mnt/tmp/vzdumptmp62235_113/' failed: exit code 23 > INFO: Failed at 2024-05-06 14:21:58 > INFO: Backup job finished with errors Without the patch, the first two error messages with the root cause of the issue would not be shown, confusing users and leaving developers in the dark when trying to help. Examples from the forum: https://forum.proxmox.com/threads/146415/post-660946 https://forum.proxmox.com/threads/101810/ https://forum.proxmox.com/threads/101560/ https://forum.proxmox.com/threads/79572/post-352377 Fixes: 5582b0c ("vzdump: rsync: make less verbose") Signed-off-by: Fiona Ebner --- src/PVE/VZDump/LXC.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm index 8c28a5e..671f5f8 100644 --- a/src/PVE/VZDump/LXC.pm +++ b/src/PVE/VZDump/LXC.pm @@ -52,13 +52,15 @@ my $rsync_vm = sub { } my $transferred = ''; - my $logfunc = sub { + my $outfunc = sub { return if $_[0] !~ /^Total transferred file size: (.+)$/; $transferred = $1; }; + my $errfunc = sub { $self->logerr($_[0]); }; + my $starttime = time(); - PVE::Tools::run_command([@$rsync, $to], logfunc => $logfunc); + PVE::Tools::run_command([@$rsync, $to], outfunc => $outfunc, errfunc => $errfunc); my $delay = time () - $starttime; $self->loginfo ("$text sync finished - transferred $transferred in ${delay}s"); -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel