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?
Solution:
I'm thinking this is still a networking issue on your end
Jump to solution
59 Replies
Percy
Percy7mo ago
Project ID: 96549d87-13c5-443f-8c9f-56a551999f59
your_asian_bro
your_asian_broOP7mo ago
project id: 96549d87-13c5-443f-8c9f-56a551999f59
Brody
Brody7mo ago
do you get this error when developing locally or when deployed to railway?
your_asian_bro
your_asian_broOP7mo ago
this is locally
Brody
Brody7mo ago
are you sure you are using all the correct environment variables?
your_asian_bro
your_asian_broOP7mo ago
I believe this the only env variable I need?
No description
No description
your_asian_bro
your_asian_broOP7mo ago
or is that not the case? thanks for the quick reply Brody!
Brody
Brody7mo ago
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?
your_asian_bro
your_asian_broOP7mo ago
ooh. let me test that! would the firewall be controlled by the owner of the internet?
Brody
Brody7mo ago
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
your_asian_bro
your_asian_broOP7mo ago
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?
Brody
Brody7mo ago
nc -zv <HOSTNAME> <PORT>
your_asian_bro
your_asian_broOP7mo ago
to the railway service , to clarify
Brody
Brody7mo ago
your connection issues are happening locally, you would want to run that command locally
your_asian_bro
your_asian_broOP7mo ago
Connection to localhost port 3000 [tcp/hbci] succeeded! is what I got
Brody
Brody7mo ago
the database on railway is most certainly not exposed on your localhost
your_asian_bro
your_asian_broOP7mo ago
what does that mean? and how would I fix that?
Brody
Brody7mo ago
use the public hostname and port of the database
your_asian_bro
your_asian_broOP7mo ago
you mean this one?
No description
Brody
Brody7mo ago
correct
your_asian_bro
your_asian_broOP7mo ago
still getting the same error . I changed this part in my env file
No description
No description
Brody
Brody7mo ago
please try this command
your_asian_bro
your_asian_broOP7mo ago
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
Brody
Brody7mo ago
is the database running?
your_asian_bro
your_asian_broOP7mo ago
I think this means its running?
No description
Brody
Brody7mo ago
check it's logs
your_asian_bro
your_asian_broOP7mo ago
i think its ready to accept connections
No description
Solution
Brody
Brody7mo ago
I'm thinking this is still a networking issue on your end
Brody
Brody7mo ago
there are plenty of free VPNs you can download to temporarily try
your_asian_bro
your_asian_broOP7mo ago
any suggestions?
Brody
Brody7mo ago
for free VPNs, no I don't unfortunately
your_asian_bro
your_asian_broOP7mo ago
thanks the help till now though. I really appreciate it im going to try nordVPN for 30 days
Brody
Brody7mo ago
sounds fine to me
your_asian_bro
your_asian_broOP7mo ago
redid the "nc -zv roundhouse.proxy.rlwy.net 20223" timed out again
Brody
Brody7mo ago
redeploy the database
your_asian_bro
your_asian_broOP7mo ago
Got same error Timed out
Brody
Brody7mo ago
is there any data in the database right now?
your_asian_bro
your_asian_broOP7mo ago
No It’s a totally new one
Brody
Brody7mo ago
then would you mind sending the URL?
your_asian_bro
your_asian_broOP7mo ago
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.
Brody
Brody7mo ago
I'm talking about the database url
your_asian_bro
your_asian_broOP7mo ago
postgresql://postgres:[email protected]:59178/railway
Brody
Brody7mo ago
why is the port different than what you showed earlier?
your_asian_bro
your_asian_broOP7mo ago
i though you said I needed to change
No description
Brody
Brody7mo ago
when did i say that? i can connect just fine
Brody
Brody7mo ago
No description
your_asian_bro
your_asian_broOP7mo ago
is my prisma broken them you think?
Brody
Brody7mo ago
nc doesnt work either
your_asian_bro
your_asian_broOP7mo ago
nc -zv roundhouse.proxy.rlwy.net 59178 gets timed out
Brody
Brody7mo ago
yes it does are you on the vpn?
your_asian_bro
your_asian_broOP7mo ago
Yes
Brody
Brody7mo ago
ncat also works fine (windows alterative for nc)
No description
Brody
Brody7mo ago
this isnt a platform issue
your_asian_bro
your_asian_broOP7mo ago
Ok . Maybe prisma is not handling things nicely
Brody
Brody7mo ago
nc does not work for you either, remember?
your_asian_bro
your_asian_broOP7mo ago
Right
Brody
Brody7mo ago
do you have a local firewall on your computer?
your_asian_bro
your_asian_broOP7mo ago
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
Brody
Brody7mo ago
awesome, problem solved
Want results from more Discord servers?
Add your server