So, out of the blue, when I try to access my app, I’m greeted with a page that says Forbidden and nothing else.
I haven’t changed anything, haven’t deployed anything new.
I noticed this error some time ago, ended up restarting the app and it started to work again but now I’m seeing this issue again, on a different app which makes me believe there is an issue on Fly.
Checking the logs, there are no requests reaching my app, the issue is probably on the load balancer or in between the app in the LB
Thanks for that information! Taking a closer look, it seems like the issue might lie primarily with the logs: that 403 response is coming from your app, so traffic is being sent there correctly.
You might be able to investigate further by sshing into your app’s instances (fly ssh console $app-name) to check if there are errors with any listening services with tools like ss and curl.
I ssh’d into it but I can’t really see anything weird…I don’t really know exactly what to look for, this app has two dependencies: redis and postgres. both are up and running and logs are fine… ss shows me nothing useful
I ended up deploying a new version, couldn’t figure out what happened exactly. I noticed tho that on the new instance, when I run ss I see a postgres line on the Peer Address:Port column that wasn’t there before…maybe the app lost connection to the database and moved to a broken state (running but not working)?
maybe the app lost connection to the database and moved to a broken state (running but not working)?
That sounds plausible to me! The absence of a peer address for postgres does indicate that your app is having trouble finding it. I’d typically expect to see a 500 or 503 error in that case. Perhaps there’s even a typo somewhere?
If you run into this issue again, I’d definitely recommend checking that the db’s hostname resolves via fly dig, to rule out any issues with your app’s DNS server, to start. You could also test for other host-specific issues by manually scaling your app, to see if fresh instances are working.
Another longshot, but if you’re running a rails app, you might want to give this recent post a look as it sounds sort of similar to the issue you were describing!
I have a fail2ban filter to silence these automated pentesters script kiddies and looks like rack-attack’s request.ip method uses the Fly’s reverse proxy IP which is always the same. I could reproduce the problem simply by accessing one of the blocklisted path and cleaning the rack-attack cache solved it…
interesting problem tho, I will reach out to rack-attack folks