-
Notifications
You must be signed in to change notification settings - Fork 615
Incorrect hostname when both useAccelerateEndpoint and useDualstackEndpoint are enabled #3001
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
Comments
For the example provided in the bug, the hostname is
It should be:
Equivalent AWS CLI code: $ aws --version
aws-cli/2.2.12 Python/3.8.8 Darwin/20.6.0 exe/x86_64 prompt/off
$ aws configure set default.s3.use_dualstack_endpoint true
$ aws s3api list-objects --bucket trivikr-accelerate-testing --endpoint-url https://s3-accelerate.amazonaws.com --debug 2>&1 | grep "urllib3.connectionpool"
2021-11-08 09:49:35,075 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): trivikr-accelerate-testing.s3-accelerate.amazonaws.com:443
2021-11-08 09:49:35,387 - MainThread - urllib3.connectionpool - DEBUG - https://trivikr-accelerate-testing.s3-accelerate.amazonaws.com:443 "GET /?encoding-type=url HTTP/1.1" 200 None |
This issue was introduced in |
This issue happens as Codeimport { S3 } from "@aws-sdk/client-s3";
const logHostnameMiddleware = (next) => async (args) => {
console.log({ hostname: args.request.hostname });
return next(args);
};
const logHostnameMiddlewareOptions = { step: "build" };
const region = "us-west-2";
const useAccelerateEndpoint = true;
const useDualstackEndpoint = true;
// Bucket with transfer acceleration enabled.
const Bucket = "trivikr-accelerate-testing";
const client = new S3({ region, useAccelerateEndpoint, useDualstackEndpoint });
client.middlewareStack.add(logHostnameMiddleware, logHostnameMiddlewareOptions);
await client.listObjects({ Bucket }); Output{ hostname: 's3.dualstack.us-west-2.amazonaws.com' } In |
This happens as resolution of The aws-sdk-js-v3/clients/client-s3/src/endpoints.ts Lines 351 to 370 in f2fb280
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Describe the bug
The SDK sets incorrect hostname when both useAccelerateEndpoint and useDualstackEndpoint are enabled
Your environment
SDK version number
@aws-sdk/[email protected]
Is the issue in the browser/Node.js/ReactNative?
All
Details of the browser/Node.js/ReactNative version
Steps to reproduce
Code
Observed behavior
throws
getaddrinfo ENOTFOUND
error.Output
Expected behavior
Sets correct hostname when both useAccelerateEndpoint and useDualstackEndpoint
The text was updated successfully, but these errors were encountered: