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 5D26B1FF135 for ; Sun, 19 Apr 2026 23:08:30 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D43D117846; Sun, 19 Apr 2026 23:08:23 +0200 (CEST) From: Thomas Lamprecht To: c.ebner@proxmox.com Subject: Re: [PATCH proxmox-backup v3 26/30] sync: pull: decrypt blob files on pull if encryption key is configured Date: Sun, 19 Apr 2026 22:41:58 +0200 Message-ID: <20260419210610.3915597-9-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260414125923.892345-27-c.ebner@proxmox.com> References: <20260419210610.3915597-1-t.lamprecht@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1776632780900 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.002 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 Message-ID-Hash: XAGF4TRCC4VAHOXN4WPI36BLB2QPRTZC X-Message-ID-Hash: XAGF4TRCC4VAHOXN4WPI36BLB2QPRTZC X-MailFrom: t.lamprecht@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: pbs-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 14.04.26 um 14:59 schrieb Christian Ebner: > diff --git a/src/server/pull.rs b/src/server/pull.rs > @@ -409,6 +413,57 @@ async fn pull_single_archive<'a>( > > + let mut decrypted_tmpfile = std::fs::OpenOptions::new() > + .read(true) > + .write(true) > + .create_new(true) > + .open(&decrypted_tmp_path)?; create_new(true) will fail permanently if a previous run got killed between creating the .dectmp file and the cleanup at the end of the try_block (which only runs on Rust-level errors, not on SIGKILL or power loss). On the next sync attempt the stale .dectmp file causes an EEXIST error with no way to self-recover. Either using .create(true).truncate(true) instead should make retries work by just overwriting any stale leftover or clean those files up in some other way (on failure) might make this a bit more robust with temporarily outages.