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 07BE7ECFA for ; Thu, 20 Jul 2023 12:24:03 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DB01B1133B for ; Thu, 20 Jul 2023 12:24:02 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 for ; Thu, 20 Jul 2023 12:24:01 +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 28DFE41D87 for ; Thu, 20 Jul 2023 12:24:01 +0200 (CEST) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pbs-devel@lists.proxmox.com Date: Thu, 20 Jul 2023 12:23:55 +0200 Message-Id: <20230720102356.1906013-1-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.070 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 - Subject: [pbs-devel] [PATCH proxmox-backup 1/2] blob/chunk parse errors: add context X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jul 2023 10:24:03 -0000 to make it more obvious that blob is a chunk here and which one is affected. Signed-off-by: Fabian Grünbichler --- Notes: encountered here: https://forum.proxmox.com/threads/restore-failed-unable-to-parse-raw-blob-wrong-magic.130828 the remote chunk reader change is only visible in VM restore logs if the Qemu lib is rebuilt as well, since pbs-restore needs to pick up the change.. pbs-client/src/remote_chunk_reader.rs | 5 +++-- src/bin/proxmox_backup_debug/recover.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pbs-client/src/remote_chunk_reader.rs b/pbs-client/src/remote_chunk_reader.rs index c975c006..86f7549f 100644 --- a/pbs-client/src/remote_chunk_reader.rs +++ b/pbs-client/src/remote_chunk_reader.rs @@ -3,7 +3,7 @@ use std::future::Future; use std::pin::Pin; use std::sync::{Arc, Mutex}; -use anyhow::{bail, Error}; +use anyhow::{bail, format_err, Error}; use proxmox_async::runtime::block_on; @@ -51,7 +51,8 @@ impl RemoteChunkReader { self.client.download_chunk(digest, &mut chunk_data).await?; - let chunk = DataBlob::load_from_reader(&mut &chunk_data[..])?; + let chunk = DataBlob::load_from_reader(&mut &chunk_data[..]) + .map_err(|err| format_err!("Failed to parse chunk {} - {err}", hex::encode(digest)))?; match self.crypt_mode { CryptMode::Encrypt => match chunk.crypt_mode()? { diff --git a/src/bin/proxmox_backup_debug/recover.rs b/src/bin/proxmox_backup_debug/recover.rs index 113da6da..ccac476b 100644 --- a/src/bin/proxmox_backup_debug/recover.rs +++ b/src/bin/proxmox_backup_debug/recover.rs @@ -142,7 +142,7 @@ fn recover_index( if ignore_corrupt_chunks { create_zero_chunk(format!("is corrupt - {err}")) } else { - bail!("{err}"); + bail!("Failed to parse chunk {chunk_path:?} - {err}"); } })? } -- 2.39.2