public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 2/2] api: format error to show full context for failed chunk uploads
Date: Wed, 20 Aug 2025 11:58:07 +0200	[thread overview]
Message-ID: <20250820095807.172722-6-c.ebner@proxmox.com> (raw)
In-Reply-To: <20250820095807.172722-1-c.ebner@proxmox.com>

Currently, only the outer error context is shown, which can hide a
lot of useful information. By reformatting the error, the whole
error context is returned by the api call.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 src/api2/backup/upload_chunk.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/api2/backup/upload_chunk.rs b/src/api2/backup/upload_chunk.rs
index 35378377f..cfbf4aca7 100644
--- a/src/api2/backup/upload_chunk.rs
+++ b/src/api2/backup/upload_chunk.rs
@@ -267,7 +267,7 @@ async fn upload_to_backend(
                 let is_duplicate = s3_client
                     .upload_no_replace_with_retry(object_key, data)
                     .await
-                    .context("failed to upload chunk to s3 backend")?;
+                    .map_err(|err| format_err!("failed to upload chunk to s3 backend - {err:#}"))?;
                 return Ok((digest, size, encoded_size, is_duplicate));
             }
 
@@ -291,7 +291,7 @@ async fn upload_to_backend(
             let is_duplicate = s3_client
                 .upload_no_replace_with_retry(object_key, data.clone())
                 .await
-                .context("failed to upload chunk to s3 backend")?;
+                .map_err(|err| format_err!("failed to upload chunk to s3 backend - {err:#}"))?;
 
             // Only insert the chunk into the cache after it has been successufuly uploaded.
             // Although less performant than doing this in parallel, it is required for consisency
-- 
2.47.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


  parent reply	other threads:[~2025-08-20  9:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20  9:58 [pbs-devel] [PATCH proxmox{, -backup} 0/5] dynamically calculate request timeout for put object calls Christian Ebner
2025-08-20  9:58 ` [pbs-devel] [PATCH proxmox 1/3] s3-client: allow setting custom timeout when sending requests Christian Ebner
2025-08-20  9:58 ` [pbs-devel] [PATCH proxmox 2/3] s3-client: dynamically calculate put request timeout based on payload Christian Ebner
2025-08-20  9:58 ` [pbs-devel] [PATCH proxmox 3/3] s3-client: expose default timeout for s3 api requests Christian Ebner
2025-08-20  9:58 ` [pbs-devel] [PATCH proxmox-backup 1/2] s3: pass now optional default request timeout for s3 api calls Christian Ebner
2025-08-20  9:58 ` Christian Ebner [this message]
2025-08-25  9:35 ` [pbs-devel] applied-series: [PATCH proxmox{, -backup} 0/5] dynamically calculate request timeout for put object calls Wolfgang Bumiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250820095807.172722-6-c.ebner@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal