I have 2 fly.io services, dockerfile/laravel API and postgresdb. Both were working fine until a few days ago, but now my frontend API cannot query the DB. With this error.
2022-07-20 app[42a198b4] sin [info] [20-Jul-2022] WARNING: [pool www] child 4382 said into stderr: "[2022-07-20] production.ERROR: SQLSTATE[08006] [7] could not translate host name "flyio-db.internal" to address: Name does not resolve (SQL: select * from "users" where "email" = example@example.com limit 1) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 7): SQLSTATE[08006] [7] could not translate host name \"flyio-db.internal\" to address: Name does not resolve (SQL: select * from \"users\" where \"email\" = example@example.com limit 1) at /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:716)"
The app and the db haven’t been touched in months. The app connects to the db via a Database URL string, which, again, was set months ago and not touched.
From that error message it sounds like it is not specific to Laravel or Postgres, but due to the private .internal DNS record not resolving. And hence anything relying on that domain (in your case a database query) would fail.
I wonder if this issue has resurfaced? It certainly sounds similar: