P1001: Can't reach database server at `roundhouse.proxy.rlwy.net` on NextJS project with Prisma. :(
Hi all, I'm trying to build a simple table and create a model called "Lead" so I can store interested users. But when I npx prisma db push, i get the error in the title. Is there a setting on railway im missing?
59 Replies
Project ID:
96549d87-13c5-443f-8c9f-56a551999f59
project id: 96549d87-13c5-443f-8c9f-56a551999f59
do you get this error when developing locally or when deployed to railway?
this is locally
are you sure you are using all the correct environment variables?
I believe this the only env variable I need?
or is that not the case?
thanks for the quick reply Brody!
yep the database url contains all the connection details you'd need
would you be happen to be on school / business / public / etc internet? maybe you're behind a restrictive firewall?
ooh. let me test that!
would the firewall be controlled by the owner of the internet?
it would be controlled by the networking administrator
do you have a VPN service you could temporarily connect to then try having your app connect to the database
i dont have a personal VPN, and im at an airbnb so IDK if they would have a strong firewall. I disconnected from my company provided VPN
but it doesn't seem to fix it
is there a terminal command I can run to test the connection?
nc -zv <HOSTNAME> <PORT>
to the railway service , to clarify
your connection issues are happening locally, you would want to run that command locally
Connection to localhost port 3000 [tcp/hbci] succeeded!
is what I got
the database on railway is most certainly not exposed on your localhost
what does that mean? and how would I fix that?
use the public hostname and port of the database
you mean this one?
correct
still getting the same error . I changed this part in my env file
please try this command
I am trying "nc -zv roundhouse.proxy.rlwy.net 20223" in my terminal and its hanging for 30 sec or more. doesnt seem normal
nc: connectx to roundhouse.proxy.rlwy.net port 20223 (tcp) failed: Operation timed out
is the database running?
I think this means its running?
check it's logs
i think its ready to accept connections
Solution
I'm thinking this is still a networking issue on your end
there are plenty of free VPNs you can download to temporarily try
any suggestions?
for free VPNs, no I don't unfortunately
thanks the help till now though. I really appreciate it
im going to try nordVPN for 30 days
sounds fine to me
redid the "nc -zv roundhouse.proxy.rlwy.net 20223"
timed out again
redeploy the database
Got same error
Timed out
is there any data in the database right now?
No
It’s a totally new one
then would you mind sending the URL?
Railway
404 - Page not found
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
I'm talking about the database url
postgresql://postgres:[email protected]:59178/railway
why is the port different than what you showed earlier?
i though you said I needed to change
when did i say that?
i can connect just fine
is my prisma broken them you think?
nc doesnt work either
nc -zv roundhouse.proxy.rlwy.net 59178 gets timed out
yes it does
are you on the vpn?
Yes
ncat also works fine (windows alterative for nc)
this isnt a platform issue
Ok . Maybe prisma is not handling things nicely
nc does not work for you either, remember?
Right
do you have a local firewall on your computer?
Checking now
Hmm, can’t find it, but as it is a company computer I wouldn’t be too surprised that there is one
Tried ncat on my other comp and it work
So it’s probably a local computer thing
awesome, problem solved