Hasura and Fly postgres connections

I’ve some success, but for some reason now having trouble connecting a service to the database:

  • I have the right url from flyctl postgres attach --postgres-app dbname being passed. (one note there, would be nice if you output a exit 0 saying “already attached” if you run this again)
  • I can psql into the database using the url provided once I have wireguard locally running
  • dig _apps.internal shows the database but not the other service (because it won’t start due to connection issues)
  • on startup the failed app (Hasura app) outputs: “could not translate host name “dish-db.internal” to address: Name or service not known”

I’ll try creating a new one and just see if somehow it’s stuck in a weird state, but any help on how to generally debug this would be great.

Edit: Ah yes, must have been some sort of state bug, after delete and recreate it connected fine.

Edit 2: Seems I needed to re-create apps for it to work again, not sure what happened but after delete + create three of them now connect with *no other changes.

Did you get anywhere with this? We’ll go look at Hasura, it sounds like it’s not handling IPv6 properly. This can happen because:

  1. It doesn’t look up AAAA records like it should.
  2. It may require a configuration option to connect to IPv6

This is coming up with lots of libs, so we have some documentation work and exploring to do!

Just to note, my other apps (non Hasura) were having trouble connecting too, and once I restarted each they connected. Actually a restart didn’t work, I had to delete and recreate. So perhaps some communication issue in the backend.

Next time they’re having trouble, will you ssh into one and see if pinging the cluster IPs works? That’s a strange problem.

We found a bug that might’ve caused this. In short, private networking was disabled on some deploys when it shouldn’t be!

Will you give it another try?

1 Like