I’ve been working fine for a few days with a postgresql database deployed in fly.io, from a local node.js project, but today after updating the flyctl version I can’t connect from my laptop.
I use the command flyctl proxy 5432 -a <my_app>, but now I get an error: Error listen tcp 127.0.0.1:5432: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
flyctl status it’s ok.
flyctl doctor it’s ok.
flyctl postgres connect it’s ok.
So I don’t know what to do now.
I have tried to install the previous version with $v="0.0.409"; iwr https://fly.io/install.ps1 -useb | iex but I have the same problem.
is there another way to connect to postgresql from node, using public_ip:port?
I’ve added an IP with flyctl ips allocate-v4 and changed the string connection from localhost to that IP, but doesn’t work.
Thanks for reaching out on this, we are seeing now that fly proxy on latest flyctl has some issues and we will investigate.
Your port should be correct, I think the only thing missing might be the db name (which is most likely postgres too): postgres://postgres:<pass>@<app_name>.internal:5432/postgres. Can you share what error message you got?