I am attempting to connect my current render application to my new PostgreSQL database, but am having some issues. I attempted connecting via the internal URL connection provided on the database page and breaking it up into the various data parts (DB, USER, PASSWORD, HOST, etc.) but both are throwing errors.
From my local machine I was able to connect to the remote database via the external connection URL.
Below are some screenshots from my latest error and setup:
dbConfig.HOST appears to be unset, because it’s still trying to connect to 127.0.0.1, but Postgres is not run on the same machine as the Web Service/Private Service/etc.
Additionally dialetOptions: is misspelled. (And that might be the source of the problem too.)
The error is confusing to me because I can assure you the DB_URI_INTERNAL environment variable is a string and everywhere I have looked online has this Sequelize instance configuration.
I do have dotenv installed in my server.js file so that is not missing. I have also done console logs of the process.env.DB_URI_INTERNAL value and it appears correctly, so the “received undefined” in the error is also throwing me off.
The solution to my issue was embarrassingly simple. I added an environment variable in my web service setup for DB_URI_INTERNAL set to the internal connection URL.