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
Project ID:
1cb9508e-4a99-456d-a6fc-4ae49f946789
1cb9508e-4a99-456d-a6fc-4ae49f946789
the private network is not available during build
😦
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?
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
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
oh my bad
https://github.com/railwayapp/docs/pull/360
it will be in the docs soon enough lol
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-connectiondirectUrl -> 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
indeed they would
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
i dont see how it could fit in tbh
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?
they don't
gotcha, then nvm
but thanks!
no problems 🙂
👋