From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup] api: return s3 client errors during datastore create with context
Date: Thu, 24 Jul 2025 14:42:36 +0200 [thread overview]
Message-ID: <20250724124236.838266-1-c.ebner@proxmox.com> (raw)
The error context might contain information directly pointing to the
reason why the bucket cannot be reached during the datastore creation
bucket access check.
For example, the following text will be shown to the user in the error
dialog:
```
failed to access bucket: client error (Connect): error connecting to https://test.s3.pve-c1.local:7480/
- dns error: failed to lookup address information: Name or service not known (400)
```
Suggested-by: Gabriel Goller <g.goller@proxmox.com>
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
src/api2/config/datastore.rs | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs
index d24323152..b99f515ca 100644
--- a/src/api2/config/datastore.rs
+++ b/src/api2/config/datastore.rs
@@ -382,10 +382,13 @@ pub fn create_datastore(
bucket,
store_name.clone(),
);
- let s3_client = S3Client::new(options).context("failed to create s3 client")?;
+ let s3_client = S3Client::new(options)
+ .context("failed to create s3 client")
+ .map_err(|err| format_err!("{err:#}"))?;
// Fine to block since this runs in worker task
proxmox_async::runtime::block_on(s3_client.head_bucket())
- .context("failed to access bucket")?;
+ .context("failed to access bucket")
+ .map_err(|err| format_err!("{err:#}"))?;
}
}
--
2.47.2
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next reply other threads:[~2025-07-24 12:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-24 12:42 Christian Ebner [this message]
2025-07-24 14:36 ` Gabriel Goller
2025-08-05 13:12 ` [pbs-devel] applied: " Thomas Lamprecht
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=20250724124236.838266-1-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.