I am trying to connect to an RDS instance via my Macbook (M1, Sonoma 14.2.1), and am constantly running into this error. Initially I thought the error was that my instance was not publicly accessible, which I have now changed.
Error message here:
Unable to connect to the database: HostNotFoundError [SequelizeHostNotFoundError]: getaddrinfo ENOTFOUND your_amazon_rds_host
at Client._connectionCallback (/Users/as/Desktop/sample_app/node_modules/sequelize/lib/dialects/postgres/connection-manager.js:134:24)
at Client._handleErrorWhileConnecting (/Users/as/Desktop/sample_app/node_modules/pg/lib/client.js:327:19)
at Client._handleErrorEvent (/Users/as/Desktop/sample_app/node_modules/pg/lib/client.js:337:19)
at Connection.emit (node:events:519:28)
at Socket.reportStreamError (/Users/as/Desktop/sample_app/node_modules/pg/lib/connection.js:58:12)
at Socket.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
parent: Error: getaddrinfo ENOTFOUND your_amazon_rds_host
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'your_amazon_rds_host'
},
original: Error: getaddrinfo ENOTFOUND your_amazon_rds_host
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) {
errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'your_amazon_rds_host'
}
}
For what it's worth, here are some relevant details I have included in my .env file:
AWS RDS Instance:
Endpoint: database-1.servername.us-east-1.rds.amazonaws.com
Username: postgres
Password: RandomPassword
DB Instance Identifier: database-1
Database Port: 5432
Security Group Inbound Rules
Type: All traffic
Protocol: All
Port Range: All
What am I missing?
please check all these think
The error message you are encountering (getaddrinfo ENOTFOUND your_amazon_rds_host)
Check the RDS Instance Status
Correct Hostname or IP Address
Security Group and Firewall Settings
Check your VPC and subnet in which you created your RDS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With