puma-dev: touch tmp/restart.txt always leads to connection refused

I haven’t been able to use touch/tmp/restart.txt with the latest release…

Here’s what happens in the logs:

! App 'billing.tito' booted
! Killing 'billing.tito' (24599)
2016/08/10 12:13:08 http: proxy error: dial unix /Users/paulcampbell/.puma-dev/billing.tito/tmp/puma-dev-24598.sock: connect: connection refused

In the browser, the viewport just goes blank white.

unload/reload via launchctl works and is fast enough for me for now.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 9
  • Comments: 33 (14 by maintainers)

Most upvoted comments

I am using touch tmp/restart.txt && rm tmp/restart.txt it’s a bit wonky but it works.

As a follow-up, the only way I can get puma working again after this happens is like so:

launchctl stop io.puma.dev
launchctl start io.puma.dev

@evanphx Can you please reopen this? It is definitely still happening with the latest version (v0.12) on High Sierra (10.13.6). I am also seeing the “proxy error” when using touch, and a clean shutdown when using rm. Excerpts from my logs:

  1. when I do touch tmp/restart.txt, I consistently get:
! Killing 'myapp.mydomain' (81963)
2018/08/30 14:40:06 http: proxy error: EOF

then when I try to hit the app again, I get the “connection refused” error:

2018/08/30 14:58:18 http: proxy error: dial unix /Users/yemartin/.puma-dev/myapp.mydomain/tmp/puma-dev-83651.sock: connect: connection refused
  1. In comparison, when I do rm tmp/restart.txt (no need to do a touch first):
! Killing 'myapp.mydomain' (84658)
* App 'myapp.mydomain' shutdown and cleaned up

and then the app reboots properly.

Notice how when using rm, the app shutdown gracefully, but with touch, it looks like some sort of error is triggered, puma-dev fails to shutdown the app properly and ends up in a broken state.

In case it helps:

$ puma-dev -V
Version: v0.12 (go1.10.2)

I am seeing exactly the same issue, and can confirm that the @firedev’s workaround is working as expected.

Unfortunately, just happened on puma-dev Version: 0.14 (go1.14.3) for me (installed via brew on macOS 10.15.7)

I am having the same issue. @evanphx we can screenshare if that helps. my go-fu is limited but am keen to learn to be able to help out.

Thanks @firedev, your way works.

This is still happening, both the bug and the workaround.

I can replicate this issue.

App is working fine:

$ curl -I myapp.dev
HTTP/1.1 200 OK
…

I restart puma with $ touch tmp/restart.txt

~/Library/Logs/puma-dev.log says ! Killing 'myapp' (8593)

Then I try to hit my app again:

$ curl -I myapp.dev
HTTP/1.1 500 Internal Server Error
Date: Thu, 22 Sep 2016 01:25:15 GMT
Content-Type: text/plain; charset=utf-8

And the logs only state 2016/09/21 20:25:15 http: proxy error: dial unix /Users/myuser/.puma-dev/myapp/tmp/puma-dev-863.sock: connect: connection refused

I then run $ rm tmp/restart.txt according to @firedev and the logs state:

! Killing 'myapp' (8593)
* App 'myapp' shutdown and cleaned up

Then the app restarts as expected. The difference appears to be that the app never “shuts down and cleans up” when it’s touched. Only when tmp/restart.txt is removed.

EDIT:

More debugging info from $ curl -H "Host: puma-dev" localhost/events:

touch results in:

{"time":"2016-09-21 20:36:19.608299854 -0500 CDT","event":"killing_app","app":"myapp","pid":8737,"reason":"restart.txt touched"}

Whereas rm results in:

{"time":"2016-09-21 20:36:48.526124566 -0500 CDT","event":"killing_app","app":"myapp","pid":8737,"reason":"detected interval shutdown"}
{"time":"2016-09-21 20:36:48.526288004 -0500 CDT","event":"shutdown","app":"myapp"}