You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "robko23 (via GitHub)" <gi...@apache.org> on 2023/07/24 14:06:19 UTC

[GitHub] [incubator-opendal] robko23 opened a new issue, #2707: bug: backend/s3: Wrong host when using anonymous access

robko23 opened a new issue, #2707:
URL: https://github.com/apache/incubator-opendal/issues/2707

   Hi,
   I have encountered a strange issue with anonymous access to s3.
   When I use this code
   ```rust
   let mut s3 = opendal::services::S3::default();
   s3.bucket("test");
   s3.endpoint("my.minio.com");
   a.allow_anonymous();
   let op = Operator::new(s3)?.finish();
   let f = op.read("file.json").await.unwrap();
   let s = String::from_utf8_lossy(&f);
   println!("{:#?}", s);
   ```
   It creates these tracing events:
   ```
   2023-07-24T13:53:21.351840Z DEBUG main opendal::services::s3::backend: backend build started: Builder { root: None, bucket: "test", endpoint: Some("my.minio.com"), region: None, .. }    
   2023-07-24T13:53:21.351903Z DEBUG main opendal::services::s3::backend: backend use root /    
   2023-07-24T13:53:21.351912Z DEBUG main opendal::services::s3::backend: backend use bucket test    
   2023-07-24T13:53:21.366238Z DEBUG main reqsign::aws::config: load_via_profile_config_file failed: No such file or directory (os error 2)    
   2023-07-24T13:53:21.366272Z DEBUG main reqsign::aws::config: load_via_profile_shared_credentials_file failed: No such file or directory (os error 2)    
   2023-07-24T13:53:21.366336Z DEBUG main opendal::services::s3::backend: backend use region: us-east-1    
   2023-07-24T13:53:21.366361Z DEBUG main opendal::services::s3::backend: backend use endpoint: https://my.minio.com/test    
   2023-07-24T13:53:21.366369Z DEBUG main opendal::services::s3::backend: backend build finished    
   2023-07-24T13:53:21.366592Z TRACE main hyper::client::pool: checkout waiting for idle connection: ("http", 169.254.169.254)
   2023-07-24T13:53:21.366659Z TRACE main hyper::client::connect::http: Http::connect; scheme=Some("http"), host=Some("169.254.169.254"), port=None
   2023-07-24T13:53:21.366676Z DEBUG main hyper::client::connect::http: connecting to 169.254.169.254:80                                                                                                           
   ```
   
   However, when I update that code to this
   ```rust
   let mut s3 = opendal::services::S3::default();
   s3.bucket("test");
   s3.endpoint("my.minio.com");
   s3.access_key_id("test");
   s3.secret_access_key("test");
   let op = Operator::new(s3)?.finish();
   let f = op.read("file.json").await.unwrap();
   let s = String::from_utf8_lossy(&f);
   println!("{:#?}", s);
   ```
   It works as expected.
   
   I am on rust 1.71.0 and opendal 0.38.1
   
   Am I doing something wrong?
   
   ( I know that I can use http service to get things from public bucket, but still... This is for sure not intended behavior. )
   
   Thanks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] robko23 closed issue #2707: bug: backend/s3: Wrong host when using anonymous access

Posted by "robko23 (via GitHub)" <gi...@apache.org>.
robko23 closed issue #2707: bug: backend/s3: Wrong host when using anonymous access
URL: https://github.com/apache/incubator-opendal/issues/2707


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] robko23 commented on issue #2707: bug: backend/s3: Wrong host when using anonymous access

Posted by "robko23 (via GitHub)" <gi...@apache.org>.
robko23 commented on issue #2707:
URL: https://github.com/apache/incubator-opendal/issues/2707#issuecomment-1648308059

   I had no idea that this is even a thing.
   It's working perfectly now, thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-opendal] Xuanwo commented on issue #2707: bug: backend/s3: Wrong host when using anonymous access

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on issue #2707:
URL: https://github.com/apache/incubator-opendal/issues/2707#issuecomment-1648262201

   Hi, 169.254.169.254 is the address for AWS EC2 Metadata service. We will try to fetch credentials from IMDSv2 if no credential provided.
   
   You can use disable_ec2_metadata and disable_config_load to avoid loading credential from your current environment.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org