a year ago
i am trying to connect my nestjs api with typeorm to a postgres server in the same project. the postgres PGHOST variable is postgres.railway.internal.
I tried to set this value in the variables of the nestjs api but on deploy i get the following error:
RUN yarn run migration:run:
at GetAddrInfoReqWrap.onlookup as oncomplete {errno: -3008,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'postgres.railway.internal'
Do i need to do anything else to let the api access the pghost?
ⓘ Deployment information is only viewable by project members and Railway employees.
4 Replies
a year ago
Yes
a year ago
seems to be the same issue as https://help.railway.app/questions/cannot-connect-to-internal-database-url-e3b15293
i am using the public host url now and it works, but still something you might wanna look into to as its confusing to new users.
a year ago
The private network is not available during build, you would need to do whatever you are doing with the database during the runtime before starting your application.