-
Notifications
You must be signed in to change notification settings - Fork 586
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
SecretManager | List secrets on ap-northeast-1
: connect ETIMEDOUT/ENETUNREACH
#6708
Comments
Hey @loganmzz , Thanks for the feedback! However I can't reproduce this issue. This is the code I have - import { SecretsManager } from '@aws-sdk/client-secrets-manager';
const client = new SecretsManager({region: 'ap-northeast-1'});
const response = await client.listSecrets();
console.log(response) And the result is 200.
This error indicates a network timeout when trying to connect to AWS Secrets Manager. You can manually setup timeout and retry attempts - const client = new SecretsManager({
region: 'ap-northeast-1',
logger: console,
maxAttempts: 3,
retryMode: 'standard',
requestTimeout: 3000,
connectTimeout: 3000
}); Or if you think I miss anything, please add additional info. Thanks! |
Looks like timeouts are ignored. I increased them to I run it several times (~ 10), and it passed once... May be just need to "really" increase timeout :( Any other way to increase them? |
Just to be sure the information is shared, I have no issue with CLI (Python?) |
@zshzbh At stated previously your setup doesn't seem to affect timeout. Any other suggestion on how to setup custom timeouts? |
There's some steps I recommend -
import { S3Client } from "@aws-sdk/client-s3";
const client = new S3Client({ region: "ap-northeast-1" });
client.middlewareStack.add(
(next, context) => async (args) => {
console.log("AWS SDK context", context.clientName, context.commandName);
console.log("AWS SDK request input", args.input);
const result = await next(args);
console.log("AWS SDK request output:", result.output);
return result;
},
{
name: "MyMiddleware",
step: "build",
override: true,
}
);
import { S3Client } from "@aws-sdk/client-s3";
import { NodeHttpHandler } from "@aws-sdk/node-http-handler";
import { RetryStrategy } from "@aws-sdk/util-retry";
const client = new S3Client({
region: "ap-northeast-1",
maxAttempts: 5, // Increase this number as needed
requestHandler: new NodeHttpHandler({
connectionTimeout: 5000, // 5 seconds
socketTimeout: 5000, // 5 seconds
}),
retryStrategy: new RetryStrategy(() => Promise.resolve(3000)), // 3 seconds delay between retries
});
|
No issue here. Everything is working fine with other clients (CLI, Terraform) and other services.
As stated it was already validated.
Strange... As long as I run tests without middleware I had the issue. After adding it, I had no more timeout issue... I removed middleware it still works, resetting networking connection it still works. I will try after rebooting later on.
I will give it a try if I can reproduce error.
Here my test script: const client = require('@aws-sdk/client-secrets-manager');
async function main() {
const sm = new client.SecretsManager({
region: 'ap-northeast-1',
/*
logger: console,
maxAttempts: 3,
retryMode: 'standard',
requestTimeout: 100000,
connectTimeout: 100000,
*/
});
// sm.middlewareStack.add(
// (next, context) => async (args) => {
// console.log("AWS SDK context", context.clientName, context.commandName);
// console.log("AWS SDK request input", args.input);
// const result = await next(args);
// console.log("AWS SDK request output:", result.output);
// return result;
// },
// {
// name: "MyMiddleware",
// step: "build",
// override: true,
// }
// );
const listSecrets = await sm.listSecrets();
console.log(JSON.stringify(listSecrets.SecretList, undefined, 2));
}
main(); |
Checkboxes for prior research
Describe the bug
I have written a tool trying to resolve existing Terraform resource.
Everything is working fine with many services (Secret Manager, Security Group, EventBridge) and two regions (
eu-central-1
andap-northeast-1
) but listing secrets onap-northeast-1
.It results in:
Tried with AWS CLI I have no issue:
AWS_REGION=ap-northeast-1 aws secretsmanager list-secrets --filters 'Key=name,Values=...'
Regression Issue
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v20.10.0
Reproduction Steps
Observed Behavior
Error:
Expected Behavior
Valid HTTP response
Possible Solution
N/A
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: