all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] api: return s3 client errors during datastore create with context
@ 2025-07-24 12:42 Christian Ebner
  2025-07-24 14:36 ` Gabriel Goller
  2025-08-05 13:12 ` [pbs-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Ebner @ 2025-07-24 12:42 UTC (permalink / raw)
  To: pbs-devel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-05 13:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-24 12:42 [pbs-devel] [PATCH proxmox-backup] api: return s3 client errors during datastore create with context Christian Ebner
2025-07-24 14:36 ` Gabriel Goller
2025-08-05 13:12 ` [pbs-devel] applied: " Thomas Lamprecht

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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal