From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id B67961FF0E7 for ; Fri, 10 Jul 2026 13:36:37 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 6A7A221473; Fri, 10 Jul 2026 13:36:35 +0200 (CEST) Message-ID: <1b6799bf-dc77-44bf-914a-93cd9b9d78d1@proxmox.com> Date: Fri, 10 Jul 2026 13:36:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH datacenter-manager 09/15] task cache: include archive file path in error log messages To: Lukas Wagner , pdm-devel@lists.proxmox.com References: <20260702092258.174740-1-l.wagner@proxmox.com> <20260702092258.174740-10-l.wagner@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20260702092258.174740-10-l.wagner@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1783683350711 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.058 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) 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: SOB7K2LNYKFHQBTXVSIR45B5XV4EAV23 X-Message-ID-Hash: SOB7K2LNYKFHQBTXVSIR45B5XV4EAV23 X-MailFrom: d.csapak@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 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: one nit inline On 7/2/26 11:23 AM, Lukas Wagner wrote: > This should make any kind of troubleshooting much simpler. > > Signed-off-by: Lukas Wagner > --- > server/src/remote_tasks/task_cache.rs | 26 ++++++++++++++++++++++---- > 1 file changed, 22 insertions(+), 4 deletions(-) > > diff --git a/server/src/remote_tasks/task_cache.rs b/server/src/remote_tasks/task_cache.rs > index 02be9ca1..c7057786 100644 > --- a/server/src/remote_tasks/task_cache.rs > +++ b/server/src/remote_tasks/task_cache.rs > @@ -1065,8 +1065,10 @@ impl Iterator for TaskArchiveIterator<'_> { > struct InnerTaskArchiveIterator { > /// Archive files to read. > files: Vec, > - /// Archive iterator we are currently using, if any > + /// Archive iterator we are currently using, if any. > current: Option, > + /// Archive file that is currently being iterated over, if any. > + current_file: Option, > } > > impl InnerTaskArchiveIterator { > @@ -1075,6 +1077,7 @@ impl InnerTaskArchiveIterator { > Self { > files, > current: None, > + current_file: None, > } > } > } > @@ -1088,9 +1091,22 @@ impl Iterator for InnerTaskArchiveIterator { > Some(current) => { > let next = current.next(); > if next.is_some() { > - return next; > + return next.map(|res| { > + res.with_context(|| { > + format!( > + "failed to read from {file}", > + file = self > + .current_file > + .as_ref() > + .expect("self.current and self.current_file are both Some") i guess we could prevent this expect here if `current` is changed to an `Option<(ArchiveIterator, ArchiveFile)>` so that both must be either Some or None? > + .path > + .display() > + ) > + }) > + }); > } else { > self.current = None; > + self.current_file = None; > } > } > None => 'inner: loop { > @@ -1100,6 +1116,7 @@ impl Iterator for InnerTaskArchiveIterator { > match next_file.iter() { > Ok(Some(iter)) => { > self.current = Some(iter); > + self.current_file = Some(next_file); > break 'inner; > } > Ok(None) => { > @@ -1107,7 +1124,8 @@ impl Iterator for InnerTaskArchiveIterator { > } > Err(err) => { > log::error!( > - "could not create archive iterator while iteration over task archive files, skipping: {err:#}" > + "could not create task archive iterator for {file}, skipping: {err:#}", > + file = next_file.path.display() > ) > } > } > @@ -1292,7 +1310,7 @@ impl JournalIterator { > .flat_map(|task| match task { > Ok(task) => Some(task), > Err(err) => { > - log::error!("could not read task while iterating over archive file: {err:#}"); > + log::error!("could not read task while iterating over journal file: {err:#}"); > None > } > })