Prisma: Can't reach database server
nneven
PROOP

2 years ago

Hi, I am using Prisma + Next.js deployed on Vercel, and communicating over public network with my Railway SQL database. This has been working fine for me, however I started traveling overseas and now I am having a hard time developing or communicating with the database at all because I constantly receive Can't reach database server at 'roundhouse.proxy.rlwy.net': 40050. I have already looked through this Discord for solutions and implemented what was suggested here: https://stackoverflow.com/questions/68476229/m1-related-prisma-cant-reach-database-server-at-database5432, which helped a little bit but still inconsistent with my ability to connect + query. I believe this issue is very common for me now as I am in Asia and communicating with my db that is located in US East. How can I resolve or fix this? Is there something else I can do with Prisma to remedy this issue? My belief and reason for this post is that the issue is coming from Railway's ability to handle and serve requests that are across the globe and not near the region where most of my usage normally happens. Any help <@539512869780455445> would be greatly appreciated, thank you!

99 Replies

2 years ago

Railway is very good at handling requests from around the globe as they use edge proxies, you being in Asia means your request is handled by the edge proxy in Singapore and then routed internally to the us-east region.

but you can try to move the database to the Singapore region to reduce latency even further.


nneven
PROOP

2 years ago

c4aab2e0-3c93-4c07-b086-ac5d458bd1b1


nneven
PROOP

2 years ago

most of my customers are in US and east coast so that wouldn't make sense as solution, I just need to figure out how to connect + query consistently with Prisma when I am working abroad for the next few weeks


nneven
PROOP

2 years ago

hmm okay, so you think this is specific to Prisma then?


nneven
PROOP

2 years ago

tomorrow I could try interacting with the db directly outside of Prisma and see how performance/reliability is


2 years ago

it could be an issue with the network with your internet?


nneven
PROOP

2 years ago

just wondering if seen others run into this issue before (specifically with Prisma) and there is a common fix


nneven
PROOP

2 years ago

ok yeah it's getting late here so I will do a bit more testing tmrw


2 years ago

the only issues I've seen in this regard would be networking issues on the users side of things


nneven
PROOP

2 years ago

but generally unable to develop my Next.js project because db connections fail consistently, but network wise I am able to take Zoom calls etc no problem


nneven
PROOP

2 years ago

I have a dev instance of my Railway project


nneven
PROOP

2 years ago

I will migrate that and see if it makes a noticeable difference


nneven
PROOP

2 years ago

If it does though that would confirm its a Railway issue and nothing with my personal network or Prisma


2 years ago

sounds good


nneven
PROOP

2 years ago

ok, ty for fast response as always!


nneven
PROOP

2 years ago

appreciate it


2 years ago

no problem


lucasgarcia98
HOBBY

2 years ago

My project sometimes has the same problem


2 years ago

to clarify, are you receiving this error when connecting to the database from your nextjs deployment (on railway) or from your development server (on your computer)


nneven
PROOP

2 years ago

I tried running nc command with both VPN off and on, seems to make a difference and works when its on


nneven
PROOP

2 years ago

nc: connectx to 35.213.135.65 port 40050 (tcp) failed: Operation timed out


nneven
PROOP

2 years ago

vs


nneven
PROOP

2 years ago

Connection to 35.213.135.65 port 40050 [tcp/*] succeeded!


2 years ago

where are you vpn'ing to?


nneven
PROOP

2 years ago

back to US


2 years ago

does your vpn have a Singapore region?


nneven
PROOP

2 years ago

yeah it does,


nneven
PROOP

2 years ago

want me to test?


2 years ago

yes please


nneven
PROOP

2 years ago

also works fine it seems


nneven
PROOP

2 years ago

Connection to 35.213.135.65 port 40050 [tcp/*] succeeded!


nneven
PROOP

2 years ago

turned VPN off and it immediately freezes up + times out


nneven
PROOP

2 years ago

I guess its better for me to stay on Singpapore and let railway edge handle it for me?


nneven
PROOP

2 years ago

rather than connect back to US from Asia


nneven
PROOP

2 years ago

idk I'm not a network expert lol


2 years ago

i know you said youre in asia, but if its all right with you could you be a little more specific?


nneven
PROOP

2 years ago

currently Indonesia


nneven
PROOP

2 years ago

and will be going to Japan soon, before going back to US east where my company is based


nneven
PROOP

2 years ago

(and Railway region)


2 years ago

can you send the specific nc command you used?


nneven
PROOP

2 years ago

nc -zv 35.213.135.65 40050


2 years ago

@alex - are you still in Indonesia, can you run that command for me? without a VPN


2 years ago

helo


2 years ago

1265511594352185300


nneven
PROOP

2 years ago

@Brody any recommendations on what setup I should be using for best performance while in Asia? ie VPN to Singapore or US etc


2 years ago

novpn


nneven
PROOP

2 years ago

I guess we determined its something with my hotel network I assume


2 years ago

what hotel are you in bro


2 years ago

check your isp rq

1265511772312305700


nneven
PROOP

2 years ago

1265511948032803000


2 years ago

What the hell


nneven
PROOP

2 years ago

idk what any of this means lol


nneven
PROOP

2 years ago

I just want to have smooth experience when devving while abroad 🙂


2 years ago

hotel firewall is a big possibility


2 years ago

alex, you are staying at a residential house right?


2 years ago

yeah


2 years ago

our internet goes through a different pipe than the hotel, I believe


2 years ago

I can try hotel wifi but that means i have to go downstairs


nneven
PROOP

2 years ago

ok but while I'm here and need VPN to fix, should I just connect to any local asia location and let railway edge handle requests? or connect back to US servers


nneven
PROOP

2 years ago

then we can mark issue resolved 🙂


2 years ago

use singapore imo


2 years ago

use the closest server to yourself to make the internet experience more bearable


2 years ago

i usually use the closest server that works


2 years ago

yeah id go with that too, google's continental datacenter connection is likely faster than your vpn


nneven
PROOP

2 years ago

bet


nneven
PROOP

2 years ago

thanks yall


2 years ago

@bebop btw what bpm are you using


2 years ago

Vpn *


nneven
PROOP

2 years ago

proton


2 years ago

Based


nneven
PROOP

2 years ago

switching to mulvad when my subscription ends lol


2 years ago

Even more based


nneven
PROOP

2 years ago


2 years ago

Buy it through a reseller like tailsvwle


2 years ago

Then you get more utility for your lonely


2 years ago

Money*


2 years ago

Although I guess that defeats the purpose of using mullvad


nneven
PROOP

2 years ago

idk how to mark this as solved


nneven
PROOP

2 years ago

but yeah, thanks again


nneven
PROOP

2 years ago

appreciate the fast responses as always


2 years ago

no problem!


nneven
PROOP

2 years ago

QQ while I have you


nneven
PROOP

2 years ago

I am starting to get SOC-2 compliance


nneven
PROOP

2 years ago

I really love Railway and have been long time user


nneven
PROOP

2 years ago

is your infra gonna be okay with compliance?


nneven
PROOP

2 years ago

or am I gonna have to migrate some 😭


nneven
PROOP

2 years ago

its not pressing but inevitable for my company as we deal with financial data


2 years ago

you're pro right?


nneven
PROOP

2 years ago

yes


nneven
PROOP

2 years ago

and gonna start using Vanta to help get compliant


nneven
PROOP

2 years ago

still early in process


nneven
PROOP

2 years ago

jw if other customers of urs have been able to get compliant etc without needing to migrate


nneven
PROOP

2 years ago

I hope I can stay and make it work 🤞


2 years ago

theres this that was posted 4 months ago -
> Compliance Trust Center
>
> Because we were busy setting up our on-prem locations, currently we manually provide documents and bridge reports to customers needing to fulfill their SOC2 obligations. We are now pursuing our audit in earnest, and while we work to meet our auditors standard- we plan to make more of our security posture and architecture to our Business Class customers in an improved fashion.

with the wording used you may need to be on their enterprise plan, you can ask for more info by opening a private thread here -


nneven
PROOP

2 years ago

gotcha okay


nneven
PROOP

2 years ago

I will kick the can down the road for now


nneven
PROOP

2 years ago

def something to take care of Railway's end, if you want to support real business + enterprise customers outside of projects etc I think its a non-negotiable


nneven
PROOP

2 years ago

just some friendly customer feedback 😅


2 years ago

its just at a bit of an odd time right now with the transfer to bare metal, but be sure to open that private thread so you can talk to the team about it


Loading...