-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWS S3 fails to get credentials #871
Comments
Can you include full logs (not just the span names)?
It looks like you're getting timeouts and then a retry. Is there a reason you think credentials are to blame here? Seems like your passing static credentials into the client. |
Added logs. Was following the template and didn't get any logs from |
That appears to be a networking issue rather than a credentials issue. It seems like it's making a request to S3 and not getting a response within the default 3.1 second timeout. |
So what solution is there? I can access S3 using the command line, and I was able to interact with it using the JS SDK. So, is this a rust issue or what? I tried the typescript SDK again from the same machine on the same network, and it works without an issue. I can see it fails after it tries to resolve the host. Is it failing to resolve the s3 host somehow? |
It looks like the instructions in the bug template were wrong. Sorry about that. Make sure
I tried your code locally and wasn't able to reproduce the issue, although the I can't explain why it works for you with JS but not with Rust without more information about your environment. It seems like there's something about your host that is preventing the default Rustls hyper connector from making outbound HTTP calls. Have you tried making a HTTP request to anything in Rust using the |
I tried making https requests using let https = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.https_only()
.enable_http1()
.build();
let client: Client<_, hyper::Body> = Client::builder().build(https);
let req = client
.get(Uri::from_static(
"https://remote-data-sync.s3.us-east-2.amazonaws.com",
))
.await;
dbg!(req); // suceeds to connect
let s3_client = create_s3_client(&secrets).await;
let objects = s3_client
.list_objects_v2()
.bucket(&config.bucket_name)
.send()
.await;
dbg!(objects); // fails to connect |
In your example you connected to us-east-2 but the logs are pointing to us east 1 — what happens if you change the client region to us-east-2? |
Same result. Here are the updated logs:
|
This looks relevant:
What is this endpoint, and why is reqwest using it instead of the |
Not really, that is another request I am making as part of the application. Forgot to remove it when pasting the logs.
…On Wed, Aug 23, 2023 at 12:37 PM, John DiSanti ***@***.***(mailto:On Wed, Aug 23, 2023 at 12:37 PM, John DiSanti <<a href=)> wrote:
This looks relevant:
[2023-08-22T02:47:42Z DEBUG reqwest::connect] starting new connection: https://api.ipify.org/
[2023-08-22T02:47:42Z DEBUG hyper::client::connect::dns] resolving host="api.ipify.org"
What is this endpoint, and why is reqwest using it instead of the remote-data-sync.s3.us-east-2.amazonaws.com endpoint?
—
Reply to this email directly, [view it on GitHub](#871 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ABGY5FWP2TK3WBTCZLKE6A3XWYWUFANCNFSM6AAAAAA3TKONGY).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I'm at a loss here. I don't know why it's not working for you, and I'm not able to reproduce it. Does it work against the previous release ( |
I tried the older version, still the same issue. Is there a way to increase the timeout? For the successful request, it looks like it takes 5 seconds to resolve the host, but the s3 client times out after 3 seconds. Could this the issue? |
I just had to increase the timeout :'). It works now... |
|
I'm glad you figured it out! 5 seconds seems like a really long time... |
Describe the bug
When trying to create an S3 client using config and listing the objects in bucket, the request takes a long time and ends up timing out.
Expected Behavior
Create the client, call the function, get the output. Not return an error
Current Behavior
Fails with this log:
And returns this error value:
Reproduction Steps
list_objects_v2()
function:Possible Solution
No response
Additional Information/Context
No response
Version
Environment details (OS name and version, etc.)
Linux 6.4.9-arch1-1 x86_64 GNU/Linux
Logs
The text was updated successfully, but these errors were encountered: