#Error: P1001: Can't reach database server RDS

7 messages · Page 1 of 1 (latest)

loud gyro
#

I get this when trying to do my initial push to my AWS RDS db with npx prisma db push command

my .env:
DATABASE_URL=postgresql://mastermfdt:MYPASSWORD@market-fox-dev-test.cexhsakjwiq7.us-east-1.rds.amazonaws.com

Master username
mastermfdt
Password
auto generated one by AWS, has no special characters in it.
DB instance ID
market-fox-dev-test
Endpoint
market-fox-dev-test.cexhsakjwiq7.us-east-1.rds.amazonaws.com
Port
5432
Status
Available
Publicly accessible
Yes

Referecning these docs:
https://www.prisma.io/dataguide/postgresql/setting-up-postgresql-on-rds
https://www.prisma.io/dataguide/postgresql/short-guides/connection-uris

I'v also tried other url variants, using "postgres" as my username, including the port and database name "...aws.com:5432/market-fox-dev-test", just the port, ?connect_timeout=30&pool_timeout=30&socket_timeout=30

No proxies or clusters involved here. Just doing a standard RDS setup to test out using it with Prisma.

Prisma's Data Guide

Learn how to configure PostgreSQL on Amazon's RDS with production-capable settings.

Prisma's Data Guide

Learn how to encode PostgreSQL connection details in connection URIs for applications and libraries

#
➜  market-fox git:(aws-rds) ✗ npx prisma db push
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database "postgres", schema "public" at "market-fox-dev-test.cexhsakjwiq7.us-east-1.rds.amazonaws.com"

Error: P1001: Can't reach database server at `market-fox-dev-test.cexhsakjwiq7.us-east-1.rds.amazonaws.com`:`5432`

Please make sure your database server is running at `market-fox-dev-test.cexhsakjwiq7.us-east-1.rds.amazonaws.com`:`5432`.
unborn bridge
unborn bridge
# loud gyro that appears to just be hanging.

In that case, you would need to check the security group rules in your AWS Management Console, but also the network accessibility

In the AWS Management Console, navigate to the RDS instance and check the associated security group. Make sure that the inbound rules allow traffic from the IP address where you're running the psql command. If not, you'll need to add a rule to allow traffic.

If your RDS instance is in a VPC, make sure that it's publicly accessible. You can check this in the AWS Management Console. If it's not publicly accessible, you'll need to either make it publicly accessible or set up a VPN connection to the VPC

loud gyro
#

thanks! I'll take a look tomorrow morning to see if that's where my issue is. Appreciate the help!

unborn bridge
#

Anytime!