Error: ActiveRecord::ConnectionNotEstablished: could not translate host name "dpg-ckm5engu1l6c73f2s23g-a" to address: Name or service not known

While trying to redeploy my app (Ruby on Rails), I’m getting this error:
“Exited with status 1 while building your code”
Logs:
Oct 15 05:37:16 PM ActiveRecord::ConnectionNotEstablished: could not translate host name “dpg-ckm5engu1l6c73f2s23g-a” to address: Name or service not known
Oct 15 05:37:16 PM PG::ConnectionBad: could not translate host name “dpg-ckm5engu1l6c73f2s23g-a” to address: Name or service not known
Oct 15 05:37:16 PM Tasks: TOP => db:migrate
Oct 15 05:37:16 PM (See full trace by running task with --trace)
Oct 15 05:37:16 PM ==> Build failed :disappointed:

Thanks

Hi,

If the internal hostname isn’t being found, this usually points to the service and the database being provisioned in different regions.

To use the Internal Database URL, the service and database need to be in the same account/team and region. Noted in the docs.

Alan

I have the same problem. My db and service are both in the same region. Any other ideas of what could cause this?

You’ve not provided much detail, but if they’re in the same account/region then there’s something else at play.

Double-check where you use the “Internal Database URL”, (hopefully an environment variable on your service) and check they are exactly the same as provided.

Alan

Thanks, that solved it!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.