2 years ago
I had a postgres database up and running from a Directus template. When trying to debug the issue of connecting to the database I can see the database base is update running, however I can't quickly see the "Data Connection" working. I can see the connection string has "undefined" variables with host and port etc. These variables are available in the variables tab.
I have redeployed the postgres container with no luck and can't seem to connect to it. Is there an issue where the variables are being registered as "undefined" in the data connection string? Maybe the variable are not being passed correctly to the instance.
Screen shots in thread below.
4 Replies
2 years ago
Hi, can you please share the project in question?
Also, are you saying that you are trying to use a template and the template is not working correctly?
Status changed to Awaiting User Response Railway • over 1 year ago
2 years ago
Hey all, I've worked with the creator of the template you have deployed.
That Directus template does not expose the database publicly by default, If that's something you need then you would need to add a TCP proxy back to the database and redeploy it, this is mentioned in the template overview - https://railway.app/template/2fy758
It looks like you where on the right track, but you added a public domain instead of a TCP proxy to the service.
2 years ago
Yes you are right and I was looking at a staging environment that had the database settings changed instead of my production environment. Thanks for the insight and point in the right direction. For those who find the thread the note in the template that @Brody mentioned is below:
"Communication to Postgres is done exclusively over the private network and the database is not exposed externally in any way by default, This is done so that there are no egress fees for the database, if you want to enable access from outside of the private network you can go to the databases settings page to enable TCP proxying and enter the internal port 5432. The TCP proxy can be again removed at any point to close off external access."
Status changed to Awaiting Railway Response Railway • over 1 year ago
Status changed to Solved brody • over 1 year ago


