R
Railway14mo ago
rylax

Health check not working for Strapi instance

I have a Strapi v4 instance running together with a Postgres Server. It seems that due to a knex error Strapi crashes the server from time to time. All of this is OK for now but it seems to me that no matter what health check / restart policy I have the server never actually restarts. Running the same project on Render with the same restart policy does what I'd expect it to do so I was wondering if anyone has some ideas?
No description
No description
Solution:
though actually fixing this issue should be as simple as setting pool.min to zero as shown in the offical template https://github.com/railwayapp-templates/strapi/blob/main/config/database.js#L12...
Jump to solution
12 Replies
Percy
Percy14mo ago
Project ID: 78f1716a-88aa-4f72-bab8-2fa121ab1d5b
rylax
rylaxOP14mo ago
78f1716a-88aa-4f72-bab8-2fa121ab1d5b
Brody
Brody14mo ago
even though that restart number field is hidden for some reason, the always restart will not infinitely restart the deployment, that could cause infinite crashes always will restart the deployment if the app exits with any error code
Solution
Brody
Brody14mo ago
though actually fixing this issue should be as simple as setting pool.min to zero as shown in the offical template https://github.com/railwayapp-templates/strapi/blob/main/config/database.js#L12
Brody
Brody14mo ago
rylax
rylaxOP14mo ago
I don't see the number of restarts field as an option. But either way it is concerning that the app doesn't restart at all. I appreciate the Strapi pool size fix! Implementing that now. I just would like to be comfortable and know the app actually restarts when it fails. That's kinda what the policy describes, no?
Brody
Brody14mo ago
as previously mentioned, the always restart will not infinitely restart the deployment, it will still only restart up to the set restart attempt amount, even though that field is hidden the value still applies, that is a ui bug .. but will still only restart up to the set amount
rylax
rylaxOP14mo ago
Oh I see but no way in the observability logs does it look like it actually restarted even once? A click on the restart button temporarly fixes the issue immediately so I am assuming it never even tried to restart once.
Brody
Brody14mo ago
the screenshot you sent, it shows a crash and then shows the start command again, so yes it was restarted
rylax
rylaxOP14mo ago
Hm ok thanks. I'll keep observing this. I could swear it showed EXIT at let's say 3pm and then it was off until hours later when I realized and manually restarted. I didn't notice the retries but perhaps I didn't look close enough.
Brody
Brody14mo ago
if railway has already restarted the deployment 10 times (default value) then it wont attempt any more restarts either way, ive seen this connection reset by peer strapi issue a hundred times, the fix has always been setting pool.min to 0 as the strapi docs mention
rylax
rylaxOP14mo ago
awesome thanks!
Want results from more Discord servers?
Add your server