You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running this (awesome) buildpack with Puma, and Heroku deployments seem to work perfectly with nginx waiting for puma to start before accepting requests. However I notice that when I do a "heroku restart", I end up getting Bad Gateway 502 errors for the time between nginx re-starting and puma re-starting (at least that's what I think is happening).
Could this be because the /tmp/app-initialized file has already been created from the first deploy, and is not deleted? Should I be deleting the file on restart to prevent this? Sorry if this is an obvious issue - I don't fully understand how heroku's "ephemeral file system" works.
The text was updated successfully, but these errors were encountered:
Aha I figured out what was going on here. I was touching /tmp/app-initialized in my puma.rb config file - which was happening before puma / rails was actually ready to accept requests. Instead, I moved the file touch to an "after_initialized" block in my production.rb config file like this:
MyApp::Application.configure do
config.after_initialize do
FileUtils.touch('/tmp/app-initialized')
end
end
And now everything is working fine. So I'll be closing this issue.
I'm running this (awesome) buildpack with Puma, and Heroku deployments seem to work perfectly with nginx waiting for puma to start before accepting requests. However I notice that when I do a "heroku restart", I end up getting Bad Gateway 502 errors for the time between nginx re-starting and puma re-starting (at least that's what I think is happening).
Could this be because the /tmp/app-initialized file has already been created from the first deploy, and is not deleted? Should I be deleting the file on restart to prevent this? Sorry if this is an obvious issue - I don't fully understand how heroku's "ephemeral file system" works.
The text was updated successfully, but these errors were encountered: