R
Railway14mo ago
snöw

Cannot reach Postgres via internal network in same project

We're migrating our Postgres from the plugin system to the new template based one, ran into an issue: During a build of a service it needs to connect to a database. Using the public url this works without a problem, but the internal url (which would be preferred) cannot be reached for some reason. How should I go about debugging this? They are both in the same project
19 Replies
Percy
Percy14mo ago
Project ID: 1cb9508e-4a99-456d-a6fc-4ae49f946789
snöw
snöwOP14mo ago
1cb9508e-4a99-456d-a6fc-4ae49f946789
snöw
snöwOP14mo ago
No description
Brody
Brody14mo ago
the private network is not available during build
snöw
snöwOP14mo ago
😦 but okay, i'll need to set up some logic to make this dynamic then (is this mentioned in the docs somewhere? looked for something like this, but nothing caught my eye) also is this a temporary thing?
Fragly
Fragly14mo ago
not directly but it states here that it can take up to 100ms to initialize after deploying which kinda insinuates that they're not available during build You could ask that it be made more clear in #🤗|feedback though
No description
Brody
Brody14mo ago
not the same thing lol it's not mentioned in the docs at all it's not temporary, it's just simply how it is no need for feedback it's already on the radar
Fragly
Fragly14mo ago
oh my bad
Brody
Brody14mo ago
https://github.com/railwayapp/docs/pull/360 it will be in the docs soon enough lol
snöw
snöwOP14mo ago
For whoever finds this thread in the future: If you're using Node/Prisma, then the directUrl option is an easy way to bypass this restriction https://www.prisma.io/docs/data-platform/classic-projects/data-proxy/prisma-cli-with-data-proxy#prisma-cli-commands-that-require-a-direct-database-connection
No description
snöw
snöwOP14mo ago
directUrl -> public url -> internal as far as I've understood the inter-service communication speeds should be a lot better over the internal network which is important for the client, not the build
Brody
Brody14mo ago
indeed they would
snöw
snöwOP14mo ago
would it be worth adding this to the docs as well? prisma should be quite popular within railway users I can add to the PR
Brody
Brody14mo ago
i dont see how it could fit in tbh
snöw
snöwOP14mo ago
was thinking of something like ("If you use prisma click here") but agreed, not the most logical place for this if they have a separate prisma section then maybe there but I don't think they do?
Brody
Brody14mo ago
they don't
snöw
snöwOP14mo ago
gotcha, then nvm but thanks!
Brody
Brody14mo ago
no problems 🙂
angelo
angelo14mo ago
👋
Want results from more Discord servers?
Add your server