You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by xu...@apache.org on 2024/07/14 02:36:32 UTC
(opendal) branch main updated: fix(services/s3): NoSuchBucket is a ConfigInvalid for OpenDAL (#4895)
This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new 062a663236 fix(services/s3): NoSuchBucket is a ConfigInvalid for OpenDAL (#4895)
062a663236 is described below
commit 062a663236ae8338e459a577b01ae8f09dafedef
Author: tison <wa...@gmail.com>
AuthorDate: Sat Jul 13 19:36:27 2024 -0700
fix(services/s3): NoSuchBucket is a ConfigInvalid for OpenDAL (#4895)
---
bin/ofs/Cargo.lock | 18 ++++++++++++++----
core/src/services/s3/error.rs | 7 ++++++-
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/bin/ofs/Cargo.lock b/bin/ofs/Cargo.lock
index 2268a79e69..54f45c64b6 100644
--- a/bin/ofs/Cargo.lock
+++ b/bin/ofs/Cargo.lock
@@ -1011,7 +1011,7 @@ dependencies = [
"md-5",
"once_cell",
"percent-encoding",
- "quick-xml",
+ "quick-xml 0.31.0",
"rand",
"reqsign",
"reqwest",
@@ -1101,6 +1101,16 @@ dependencies = [
"serde",
]
+[[package]]
+name = "quick-xml"
+version = "0.35.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "86e446ed58cef1bbfe847bc2fda0e2e4ea9f0e57b90c507d4781292590d72a4e"
+dependencies = [
+ "memchr",
+ "serde",
+]
+
[[package]]
name = "quinn"
version = "0.11.2"
@@ -1218,9 +1228,9 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
[[package]]
name = "reqsign"
-version = "0.15.2"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70fe66d4cd0b5ed9b1abbfe639bf6baeaaf509f7da2d51b31111ba945be59286"
+checksum = "03dd4ba7c3901dd43e6b8c7446a760d45bc1ea4301002e1a6fa48f97c3a796fa"
dependencies = [
"anyhow",
"async-trait",
@@ -1234,7 +1244,7 @@ dependencies = [
"http",
"log",
"percent-encoding",
- "quick-xml",
+ "quick-xml 0.35.0",
"rand",
"reqwest",
"rust-ini",
diff --git a/core/src/services/s3/error.rs b/core/src/services/s3/error.rs
index fdea00d882..b62dda6d9c 100644
--- a/core/src/services/s3/error.rs
+++ b/core/src/services/s3/error.rs
@@ -87,6 +87,11 @@ pub(crate) fn from_s3_error(s3_error: S3Error, parts: Parts) -> Error {
/// All possible error code: <https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList>
pub fn parse_s3_error_code(code: &str) -> Option<(ErrorKind, bool)> {
match code {
+ // > The specified bucket does not exist.
+ //
+ // Although the status code is 404, NoSuchBucket is
+ // a config invalid error, and it's not retryable from OpenDAL.
+ "NoSuchBucket" => Some((ErrorKind::ConfigInvalid, false)),
// > Your socket connection to the server was not read from
// > or written to within the timeout period."
//
@@ -147,7 +152,7 @@ mod tests {
<CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Location>http://Example-Bucket.s3.ap-southeast-1.amazonaws.com/Example-Object</Location>
<Bucket>Example-Bucket</Bucket>
- <Key>Example-Object</Key>
+ <Key>Example-Object</Key>
<ETag>"3858f62230ac3c915f300c664312c11f-9"</ETag>
</CompleteMultipartUploadResult>
"#,