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 22D2D9F22F for ; Wed, 7 Jun 2023 18:34:36 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id ED7ED1CF69 for ; Wed, 7 Jun 2023 18:34:35 +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 ; Wed, 7 Jun 2023 18:34:35 +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 E25DF41FA6 for ; Wed, 7 Jun 2023 18:34:34 +0200 (CEST) From: Max Carrara To: pbs-devel@lists.proxmox.com Date: Wed, 7 Jun 2023 18:34:23 +0200 Message-Id: <20230607163428.1154123-1-m.carrara@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.012 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/pve-container 0/5] improve error handling of pxar extractor 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: Wed, 07 Jun 2023 16:34:36 -0000 The goal of this series is to improve how errors occurring during the extraction of pxar archives are propagated and handled. This is mainly done through leveraging the `anyhow::Context` trait [0], which makes it possible to provide and propagate context-dependent error information (hence its name), while simultaneously preserving the original error that caused an execution path to fail in the first place. Furthermore, the existing error handler and its related mechanisms are now also used during the overall process of extraction. Together with the introduction of a new type of context variable, errors that happen during the extraction can now be handled for each type of entry individually (if desired). This is demonstrated by adding a new flag to the `proxmox-backup-client` CLI tool, which appends a handler that ignores errors which occur during the extraction of a device node. This also fixes #3460. [1] [0]: https://docs.rs/anyhow/latest/anyhow/trait.Context.html [1]: https://bugzilla.proxmox.com/show_bug.cgi?id=3460 proxmox-backup: Max Carrara (4): pbs-client: pxar: preserve error context pbs-client: pxar: refactor body of `extract_archive` to `ExtractorIter` pbs-client: pxar: add `PxarExtractContext` proxmox-backup-client: restore: add 'ignore-extract-device-errors' flag pbs-client/src/pxar/create.rs | 22 +- pbs-client/src/pxar/dir_stack.rs | 8 +- pbs-client/src/pxar/extract.rs | 573 +++++++++++++++++++++--------- pbs-client/src/pxar/metadata.rs | 44 +-- pbs-client/src/pxar/mod.rs | 2 +- pbs-client/src/pxar/tools.rs | 13 +- proxmox-backup-client/src/main.rs | 61 +++- 7 files changed, 505 insertions(+), 218 deletions(-) pve-container: Max Carrara (1): fix #3460: restore: honor '--ignore-unpack-errors' flag for pbs src/PVE/LXC/Create.pm | 4 ++++ 1 file changed, 4 insertions(+) -- 2.30.2