My application unexpectedly stop connection to DB

What I see in logs

I, [2023-12-19T21:20:30.163249 #305] INFO – : [2e6426a9-0158-4212-9253-78e081c010df] Completed 500 Internal Server Error in 120964ms (ActiveRecord: 0.0ms | Allocations: 6128)

2023-12-19T21:20:30.166 app[4d89117a2e1458] lhr [info] F, [2023-12-19T21:20:30.165414 #305] FATAL – : [2e6426a9-0158-4212-9253-78e081c010df]

2023-12-19T21:20:30.166 app[4d89117a2e1458] lhr [info] [2e6426a9-0158-4212-9253-78e081c010df] ActiveRecord::ConnectionNotEstablished (connection to server at “fdaa:2:e669:0:1::2”, port 5432 failed: server closed the connection unexpectedly


I did all the checks and looked in help system. Use several commands. Still have the issue. Please help. What need to do to fix this? It’s a live application with users. I am at a paid hobby plan.

1 Like

What is interesting… That was nothing changed and it stopped working. Also, I see that data is on the place. And API is working. But cannot connect to DB for a couple of hours.

Hey. Now it’s working again. But 2 hours it could not connect. Why? Is it because of Free plan with $0 payment? I switched to a hobby plan that cost 5$.

So. Is it just because of the hosting unreliability on non-HA plans or there is a reason that explains what happened? I am OK that free guarantees nothing but having several hours without connection to DB … is too much, and without understanding what’s happening - just sad.

I would imagine a multi-hour outage wouldn’t be due to the tier you are on. Postgres DBs on here are by default always on. I imagine it may be a more niche Fly issue in that case. Did you change anything on your app or did it just mysteriously start working again?

Mysteriously, a few minutes after creating the topic here.

However, I did several manipulations:
run fly doctor on both api and db apps
run attach/detach on db app.
run image update on db app
Several times, restart/deploy, without changing sources.
And switched to a hobby 5$ plan.

Nothing was wrong, there were no deploys before the issue or any other changes, but what actually helped, is a mystery.

Could’ve been this Fly.io Status - Registry Errors

I do not understand what is “registry errors”. Also, my issue was yesterday. Today it’s working fine enough.

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