R
Railway•9mo ago
Rozukai

DNS error on bucket S3

Hi everyone, I've just deploy the template to automate postgresql backups and I got this error when the script try to deploy the backup :
Error while running backup: Error: getaddrinfo EAI_AGAIN ******.s3.us-west-3.amazonaws.com
Error while running backup: Error: getaddrinfo EAI_AGAIN ******.s3.us-west-3.amazonaws.com
Do you know why I got this error ? Have a good day
21 Replies
Percy
Percy•9mo ago
Project ID: 62a7d631-15d2-4bde-a633-b2e28b306105
Rozukai
Rozukai•9mo ago
62a7d631-15d2-4bde-a633-b2e28b306105 Inside the console, I see that there is a section about "access points" for my S3 but it's not mentionned in the blog
Brody
Brody•9mo ago
did you put those asterix there?
Rozukai
Rozukai•9mo ago
Yes to hide my bucket name
Brody
Brody•9mo ago
are you using private networking
Rozukai
Rozukai•9mo ago
Yes It's enabled by default no ?
Brody
Brody•9mo ago
yes it's enabled by default, I'm not asking if you have it enabled, I'm asking if you are actually using it
Rozukai
Rozukai•9mo ago
Yes I use it for some of my services
Brody
Brody•9mo ago
link me the template you are using for database backups please
Rozukai
Rozukai•9mo ago
GitHub
GitHub - FournyP/postgres-s3-backups: A simple Node app to automati...
A simple Node app to automatically backup PostgreSQL databases to an S3 bucket - GitHub - FournyP/postgres-s3-backups: A simple Node app to automatically backup PostgreSQL databases to an S3 bucket
Rozukai
Rozukai•9mo ago
I've forked the original one To add a feature Basically to backup more than one database It's the same logic from the original one but with a foreach loop
Brody
Brody•9mo ago
do you have it set to run a backup at start?
Rozukai
Rozukai•9mo ago
Yes for testing
Brody
Brody•9mo ago
can you prefix the start script with sleep 3 &&
Rozukai
Rozukai•9mo ago
No description
Rozukai
Rozukai•9mo ago
I redeploy I have the same error :/ If I use eu-west2 do you think it will work ?
Brody
Brody•9mo ago
i dont think thats the issue here, look into the connection docs for the s3 client in use
Rozukai
Rozukai•9mo ago
Ok i will check 😉 I think it is the bucket s3, I can't ping it
Brody
Brody•9mo ago
well thats odd
Rozukai
Rozukai•9mo ago
Hi @Brody, Sorry it take some times to work on my project. I've try on the eu-west-2 region and get the following error :
Error while running backup: PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

at throwDefaultError (/root/node_modules/@smithy/smithy-client/dist-cjs/default-error-handler.js:8:22)
at /root/node_modules/@smithy/smithy-client/dist-cjs/default-error-handler.js:18:39
at de_PutObjectCommandError (/root/node_modules/@aws-sdk/client-s3/dist-cjs/protocols/Aws_restXml.js:5721:12)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async /root/node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js:7:24
at async /root/node_modules/@aws-sdk/middleware-signing/dist-cjs/awsAuthMiddleware.js:14:20
at async /root/node_modules/@smithy/middleware-retry/dist-cjs/retryMiddleware.js:27:46
at async /root/node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/flexibleChecksumsMiddleware.js:57:20
at async /root/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:7:26 {
'$fault': 'client',
'$metadata': {
httpStatusCode: 301,
requestId: '5SEYQH8XA8D9VMV9',
extendedRequestId: 'WFWT12p4LBCi4W9VJd0jethNOuhtDtkJ0jvKIcwpOBbtjLb2mgMpcicsqDhPC4zg6INzxM6yrFo=',
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
Code: 'PermanentRedirect',
Endpoint: '***.s3.eu-west-2.amazonaws.com',
Bucket: '***',
RequestId: '5SEYQH8XA8D9VMV9',
HostId: 'WFWT12p4LBCi4W9VJd0jethNOuhtDtkJ0jvKIcwpOBbtjLb2mgMpcicsqDhPC4zg6INzxM6yrFo='
}
Error while running backup: PermanentRedirect: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

at throwDefaultError (/root/node_modules/@smithy/smithy-client/dist-cjs/default-error-handler.js:8:22)
at /root/node_modules/@smithy/smithy-client/dist-cjs/default-error-handler.js:18:39
at de_PutObjectCommandError (/root/node_modules/@aws-sdk/client-s3/dist-cjs/protocols/Aws_restXml.js:5721:12)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async /root/node_modules/@smithy/middleware-serde/dist-cjs/deserializerMiddleware.js:7:24
at async /root/node_modules/@aws-sdk/middleware-signing/dist-cjs/awsAuthMiddleware.js:14:20
at async /root/node_modules/@smithy/middleware-retry/dist-cjs/retryMiddleware.js:27:46
at async /root/node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/flexibleChecksumsMiddleware.js:57:20
at async /root/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:7:26 {
'$fault': 'client',
'$metadata': {
httpStatusCode: 301,
requestId: '5SEYQH8XA8D9VMV9',
extendedRequestId: 'WFWT12p4LBCi4W9VJd0jethNOuhtDtkJ0jvKIcwpOBbtjLb2mgMpcicsqDhPC4zg6INzxM6yrFo=',
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
Code: 'PermanentRedirect',
Endpoint: '***.s3.eu-west-2.amazonaws.com',
Bucket: '***',
RequestId: '5SEYQH8XA8D9VMV9',
HostId: 'WFWT12p4LBCi4W9VJd0jethNOuhtDtkJ0jvKIcwpOBbtjLb2mgMpcicsqDhPC4zg6INzxM6yrFo='
}
So locally, on my WSL, I've try to debug the project, by setting the AWS_S3_ENDPOINT=https://***.s3.eu-west-2.amazonaws.com provided by the project, I now got this error :
Error while running backup: Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: ***.ezexchange-db-backups.s3.eu-west-2.amazonaws.com. is not in the cert's altnames: DNS:*.s3.eu-west-2.amazonaws.com, DNS:s3.eu-west-2.amazonaws.com, DNS:*.s3-eu-west-2.amazonaws.com, DNS:s3-eu-west-2.amazonaws.com, DNS:*.s3.dualstack.eu-west-2.amazonaws.com, DNS:s3.dualstack.eu-west-2.amazonaws.com, DNS:*.s3.amazonaws.com, DNS:*.s3-control.eu-west-2.amazonaws.com, DNS:s3-control.eu-west-2.amazonaws.com, DNS:*.s3-control.dualstack.eu-west-2.amazonaws.com, DNS:s3-control.dualstack.eu-west-2.amazonaws.com, DNS:*.s3-accesspoint.eu-west-2.amazonaws.com, DNS:*.s3-accesspoint.dualstack.eu-west-2.amazonaws.com, DNS:*.s3-deprecated.eu-west-2.amazonaws.com, DNS:s3-deprecated.eu-west-2.amazonaws.com
Error while running backup: Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: ***.ezexchange-db-backups.s3.eu-west-2.amazonaws.com. is not in the cert's altnames: DNS:*.s3.eu-west-2.amazonaws.com, DNS:s3.eu-west-2.amazonaws.com, DNS:*.s3-eu-west-2.amazonaws.com, DNS:s3-eu-west-2.amazonaws.com, DNS:*.s3.dualstack.eu-west-2.amazonaws.com, DNS:s3.dualstack.eu-west-2.amazonaws.com, DNS:*.s3.amazonaws.com, DNS:*.s3-control.eu-west-2.amazonaws.com, DNS:s3-control.eu-west-2.amazonaws.com, DNS:*.s3-control.dualstack.eu-west-2.amazonaws.com, DNS:s3-control.dualstack.eu-west-2.amazonaws.com, DNS:*.s3-accesspoint.eu-west-2.amazonaws.com, DNS:*.s3-accesspoint.dualstack.eu-west-2.amazonaws.com, DNS:*.s3-deprecated.eu-west-2.amazonaws.com, DNS:s3-deprecated.eu-west-2.amazonaws.com
Do you have those kind of errors ? I've put *** to hide my bucket name I've fix the issue but another is triggered : Error while running backup: AccessDenied: Access Denied The policy in the blog post is too restrictif. You must put those allowed actions :
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:ListBucket"
],
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:ListBucket"
],
You can close this issue
Floris
Floris•9mo ago
right click on the chat app > ✅ mark solution