External Connections to Postgres Issue

I’ve followed this guide to expose my app evpricetrackerdb to the internet

My fly.toml at point of deployment:

[[services]]
  protocol = "tcp"
  internal_port = 5432
  auto_start_machines = false

  [[services.ports]]
    port = 5432
    handlers = ["pg_tls"]
  [services.concurrency]
    type = "connections"
    hard_limit = 1000
    soft_limit = 1000

After running,

psql "sslmode=require host=evpricetrackerdb.fly.dev dbname=evpricetracker user=postgres"

I get this error:

psql: error: could not translate host name "evpricetrackerdb.fly.dev" to address: nodename nor servname provided, or not known

What am I doing wrong here?

This may just be DNS propagation…

What happens if you use one of the public addresses from fly ips list?

(Aside: hostaddr= instead of host= may be needed when connecting via numeric IP.)

1 Like

For context, I’m using IPv6, tried both hostaddr= and host= and get this error:

psql: error: connection to server at <My Numeric IPv6>, port 5432 failed: No route to host
	Is the server running on that host and accepting TCP/IP connections?

Thanks for the note on DNS propagation, I’ll re-check later

Figured it out, I did not have IPv6 enabled for my wifi. Thx for the help though!!

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