P1001: Can't reach database server at
roundhouse.proxy.rlwy.net
on NextJS project with Prisma. :(

tiplanner
HOBBY

a year ago

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?

0 Replies

tiplanner
HOBBY

a year ago

project id: 96549d87-13c5-443f-8c9f-56a551999f59


a year ago

do you get this error when developing locally or when deployed to railway?


tiplanner
HOBBY

a year ago

this is locally


a year ago

are you sure you are using all the correct environment variables?


tiplanner
HOBBY

a year ago

I believe this the only env variable I need?

1236277348706422800
1236277349180244000


tiplanner
HOBBY

a year ago

or is that not the case?


tiplanner
HOBBY

a year ago

thanks for the quick reply Brody!


a year ago

yep the database url contains all the connection details you'd need


a year ago

would you be happen to be on school / business / public / etc internet? maybe you're behind a restrictive firewall?


tiplanner
HOBBY

a year ago

ooh. let me test that!


tiplanner
HOBBY

a year ago

would the firewall be controlled by the owner of the internet?


a year ago

it would be controlled by the networking administrator


a year ago

do you have a VPN service you could temporarily connect to then try having your app connect to the database


tiplanner
HOBBY

a year 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


tiplanner
HOBBY

a year ago

but it doesn't seem to fix it


tiplanner
HOBBY

a year ago

is there a terminal command I can run to test the connection?


a year ago

nc -zv


tiplanner
HOBBY

a year ago

to the railway service , to clarify


a year ago

your connection issues are happening locally, you would want to run that command locally


tiplanner
HOBBY

a year ago

Connection to localhost port 3000 [tcp/hbci] succeeded!


tiplanner
HOBBY

a year ago

is what I got


a year ago

the database on railway is most certainly not exposed on your localhost


tiplanner
HOBBY

a year ago

what does that mean? and how would I fix that?


a year ago

use the public hostname and port of the database


tiplanner
HOBBY

a year ago

you mean this one?

1236281209009602600


a year ago

correct


tiplanner
HOBBY

a year ago

still getting the same error . I changed this part in my env file

1236282170528764000
1236282170771902500


a year ago

please try this command


tiplanner
HOBBY

a year 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


tiplanner
HOBBY

a year ago

nc: connectx to roundhouse.proxy.rlwy.net port 20223 (tcp) failed: Operation timed out


a year ago

is the database running?


tiplanner
HOBBY

a year ago

I think this means its running?

1236283131758379000


a year ago

check it's logs


tiplanner
HOBBY

a year ago

i think its ready to accept connections

1236283547287949300


a year ago

I'm thinking this is still a networking issue on your end


a year ago

there are plenty of free VPNs you can download to temporarily try


tiplanner
HOBBY

a year ago

any suggestions?


a year ago

for free VPNs, no I don't unfortunately


tiplanner
HOBBY

a year ago

thanks the help till now though. I really appreciate it


tiplanner
HOBBY

a year ago

im going to try nordVPN for 30 days


a year ago

sounds fine to me


tiplanner
HOBBY

a year ago

redid the "nc -zv roundhouse.proxy.rlwy.net 20223"


tiplanner
HOBBY

a year ago

timed out again


a year ago

redeploy the database


tiplanner
HOBBY

a year ago

Got same error


tiplanner
HOBBY

a year ago

Timed out


a year ago

is there any data in the database right now?


tiplanner
HOBBY

a year ago

No


tiplanner
HOBBY

a year ago

It’s a totally new one


a year ago

then would you mind sending the URL?



a year ago

I'm talking about the database url


tiplanner
HOBBY

a year ago

postgresql://postgres:qTazdVPgTtynozPybRWfkMkvJeBEYQrK@roundhouse.proxy.rlwy.net:59178/railway


a year ago

why is the port different than what you showed earlier?


tiplanner
HOBBY

a year ago

i though you said I needed to change

1236290581315977200


a year ago

when did i say that?


a year ago

i can connect just fine


a year ago

1236290894546866200


tiplanner
HOBBY

a year ago

is my prisma broken them you think?


a year ago

nc doesnt work either


tiplanner
HOBBY

a year ago

nc -zv roundhouse.proxy.rlwy.net 59178 gets timed out


a year ago

yes it does


a year ago

are you on the vpn?


tiplanner
HOBBY

a year ago

Yes


a year ago

ncat also works fine (windows alterative for nc)

1236292092112666600


a year ago

this isnt a platform issue


tiplanner
HOBBY

a year ago

Ok . Maybe prisma is not handling things nicely


a year ago

nc does not work for you either, remember?


tiplanner
HOBBY

a year ago

Right


a year ago

do you have a local firewall on your computer?


tiplanner
HOBBY

a year ago

Checking now


tiplanner
HOBBY

a year ago

Hmm, can’t find it, but as it is a company computer I wouldn’t be too surprised that there is one


tiplanner
HOBBY

a year ago

Tried ncat on my other comp and it work


tiplanner
HOBBY

a year ago

So it’s probably a local computer thing


a year ago

awesome, problem solved


P1001: Can't reach database server at `roundhouse.proxy.rlwy.net` on NextJS project with Prisma. :( - Railway Help Station