Postgres Issues (Newbie)

I have been starting to have problems connecting postgres from a fly application by using proxy. It worked fine in previous experiments (that I deleted) but now since I launched a new app it is giving me this

I set it up by using flyctl launch and the typical option where it asks me to set up postgres (That is attached to my application). After setting it up, I decided to check the networks for both of the applications in the browser where you can the applications, I have a ipv6 in the database while the other application is in a pending state which has no ip network (not sure if this is a default setup after launching postgres attached to an app). I can connect to psql, but it is not letting me connect to the database using this flyctl proxy 5432 -a <app_name>-db

Here is my .env file
DATABASE_URL=postgres://postgres:< password >@127.0.0.1:5432/postgres

If you’re trying to connect to postgres locally, you need to use the DB app name: fly proxy 5432 -a link-appshare-db

I did that and I still get the same output but now it says link-appshare-db.internal host was not found in DNS :pensive:

This can happen when all of its machines have been auto-stopped…

What do fly m list -a link-appshare-db and fly apps list show you?

1 Like

Here is flyctl apps list


fly m list -a link-appshare-db
but here it is

Yes I decided to hide some of the #s of the IP Address but here it is

Thanks for the carefully cropped images… This is a puzzling combination, and now a second user in California is reporting it, too.

You may have luck bypassing DNS and passing the numeric IP address (as suggested in more detail over there).

Looks like it works, thanks!

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