From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 5BD7E1FF38E for ; Tue, 11 Jun 2024 13:55:33 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EFCA7360DC; Tue, 11 Jun 2024 13:56:07 +0200 (CEST) Date: Tue, 11 Jun 2024 13:55:59 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20240506124043.43046-1-f.ebner@proxmox.com> In-Reply-To: <20240506124043.43046-1-f.ebner@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1718106948.txcoocic22.astroid@yuna.none> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.057 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 T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lxc.pm, proxmox.com] Subject: [pve-devel] applied: [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" thanks! On May 6, 2024 2:40 pm, Fiona Ebner wrote: > 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 > > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel