* [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
* Re: [pbs-devel] [PATCH proxmox-backup] api: return s3 client errors during datastore create with context
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
1 sibling, 0 replies; 3+ messages in thread
From: Gabriel Goller @ 2025-07-24 14:36 UTC (permalink / raw)
To: Christian Ebner; +Cc: pbs-devel
Consider:
Tested-by: Gabriel Goller <g.goller@proxmox.com>
We could do this nicer by just always returning the full error from the
api from all endpoints, but for that we'd have to check thoroughly to
avoid showing sensitive data.
In the meantime this is perfect!
_______________________________________________
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
* [pbs-devel] applied: [PATCH proxmox-backup] api: return s3 client errors during datastore create with context
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 ` Thomas Lamprecht
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2025-08-05 13:12 UTC (permalink / raw)
To: pbs-devel, Christian Ebner
On Thu, 24 Jul 2025 14:42:36 +0200, Christian Ebner wrote:
> 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)
> ```
>
> [...]
Applied, resolved the merge conflict from the refactoring that happened in the
meantime, thanks!
[1/1] api: return s3 client errors during datastore create with context
commit: 76b03a1058b44bc450886708cd02b6b4f6abcda5
_______________________________________________
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.