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

2 years 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
HOBBYOP

2 years ago

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


brody
EMPLOYEE

2 years ago

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


tiplanner
HOBBYOP

2 years ago

this is locally


brody
EMPLOYEE

2 years ago

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


tiplanner
HOBBYOP

2 years ago

I believe this the only env variable I need?

1236277348706422800
1236277349180244000


tiplanner
HOBBYOP

2 years ago

or is that not the case?


tiplanner
HOBBYOP

2 years ago

thanks for the quick reply Brody!


brody
EMPLOYEE

2 years ago

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


brody
EMPLOYEE

2 years ago

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


tiplanner
HOBBYOP

2 years ago

ooh. let me test that!


tiplanner
HOBBYOP

2 years ago

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


brody
EMPLOYEE

2 years ago

it would be controlled by the networking administrator


brody
EMPLOYEE

2 years ago

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


tiplanner
HOBBYOP

2 years 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
HOBBYOP

2 years ago

but it doesn't seem to fix it


tiplanner
HOBBYOP

2 years ago

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


brody
EMPLOYEE

2 years ago

nc -zv


tiplanner
HOBBYOP

2 years ago

to the railway service , to clarify


brody
EMPLOYEE

2 years ago

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


tiplanner
HOBBYOP

2 years ago

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


tiplanner
HOBBYOP

2 years ago

is what I got


brody
EMPLOYEE

2 years ago

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


tiplanner
HOBBYOP

2 years ago

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


brody
EMPLOYEE

2 years ago

use the public hostname and port of the database


tiplanner
HOBBYOP

2 years ago

you mean this one?

1236281209009602600


brody
EMPLOYEE

2 years ago

correct


tiplanner
HOBBYOP

2 years ago

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

1236282170528764000
1236282170771902500


brody
EMPLOYEE

2 years ago

please try this command


tiplanner
HOBBYOP

2 years 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
HOBBYOP

2 years ago

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


brody
EMPLOYEE

2 years ago

is the database running?


tiplanner
HOBBYOP

2 years ago

I think this means its running?

1236283131758379000


brody
EMPLOYEE

2 years ago

check it's logs


tiplanner
HOBBYOP

2 years ago

i think its ready to accept connections

1236283547287949300


brody
EMPLOYEE

2 years ago

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


brody
EMPLOYEE

2 years ago

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


tiplanner
HOBBYOP

2 years ago

any suggestions?


brody
EMPLOYEE

2 years ago

for free VPNs, no I don't unfortunately


tiplanner
HOBBYOP

2 years ago

thanks the help till now though. I really appreciate it


tiplanner
HOBBYOP

2 years ago

im going to try nordVPN for 30 days


brody
EMPLOYEE

2 years ago

sounds fine to me


tiplanner
HOBBYOP

2 years ago

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


tiplanner
HOBBYOP

2 years ago

timed out again


brody
EMPLOYEE

2 years ago

redeploy the database


tiplanner
HOBBYOP

2 years ago

Got same error


tiplanner
HOBBYOP

2 years ago

Timed out


brody
EMPLOYEE

2 years ago

is there any data in the database right now?


tiplanner
HOBBYOP

2 years ago

No


tiplanner
HOBBYOP

2 years ago

It’s a totally new one


brody
EMPLOYEE

2 years ago

then would you mind sending the URL?



brody
EMPLOYEE

2 years ago

I'm talking about the database url


tiplanner
HOBBYOP

2 years ago

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


brody
EMPLOYEE

2 years ago

why is the port different than what you showed earlier?


tiplanner
HOBBYOP

2 years ago

i though you said I needed to change

1236290581315977200


brody
EMPLOYEE

2 years ago

when did i say that?


brody
EMPLOYEE

2 years ago

i can connect just fine


brody
EMPLOYEE

2 years ago

1236290894546866200


tiplanner
HOBBYOP

2 years ago

is my prisma broken them you think?


brody
EMPLOYEE

2 years ago

nc doesnt work either


tiplanner
HOBBYOP

2 years ago

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


brody
EMPLOYEE

2 years ago

yes it does


brody
EMPLOYEE

2 years ago

are you on the vpn?


tiplanner
HOBBYOP

2 years ago

Yes


brody
EMPLOYEE

2 years ago

ncat also works fine (windows alterative for nc)

1236292092112666600


brody
EMPLOYEE

2 years ago

this isnt a platform issue


tiplanner
HOBBYOP

2 years ago

Ok . Maybe prisma is not handling things nicely


brody
EMPLOYEE

2 years ago

nc does not work for you either, remember?


tiplanner
HOBBYOP

2 years ago

Right


brody
EMPLOYEE

2 years ago

do you have a local firewall on your computer?


tiplanner
HOBBYOP

2 years ago

Checking now


tiplanner
HOBBYOP

2 years ago

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


tiplanner
HOBBYOP

2 years ago

Tried ncat on my other comp and it work


tiplanner
HOBBYOP

2 years ago

So it’s probably a local computer thing


brody
EMPLOYEE

2 years ago

awesome, problem solved


Loading...