New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing unix socket after restart #1524
Comments
Hi, I had the same problem and after having 2 days reading/studying systemd doc I got why this happens. The core problem is that unix.socket (don't confuse with gunicorn.socket) placed in the runtimedirectory that is spiced up by
|
On 7 Sep 2017, at 12:45, Alizain Feerasta ***@***.***> wrote:
@valq7711 <https://github.com/valq7711>, thanks for the response. I spent quite some time debugging this before I found this issue.
@benoitc <https://github.com/benoitc>, is this the expected solution to working with systemd? If so, the docs should be updated.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#1524 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAA4okrJNK-sGMLZUn911gPDkDVsUja6ks5sf8lggaJpZM4Ny1-8>.
i think @tilgovi fixed it in latest master. Can you test it?
- benoit
|
I'll take a look on the weekend, for sure! |
I do not know of any change I made that would fix this that is not already on 19.7.1. |
@tilgovi I was thinking to #1310 but that different. I misread the ticket.. Anyway I think it's expected that a socket created by gunicorn is deleted when gunicorn is stopped. Why should it survive in such case? fd inheritance is different and I'm not sure that |
The problem is:
This happens when gunicorn is configured exactly the way it is explained in gunicorn's documentation about deploying with systemd. I don't know enough about |
@alizain thanks for the problem description. I'm not a user of linux/systemd myself, I will need to check as well. Reading the current doc it seems that the socket is created via /etc/systemd/system/gunicorn.socket. At this point I need to think what is the correct behaviour :) I will need to make some research |
if i'm correct systemd is the one listening on the socket so we should probably onlyuse the FD given by stemd but I maybe wrong. |
Hi!
Thus, a socket isn't private part of any service (it's only a bus that provides communication), so private dir of any service is illogical place for it (by my opinion) |
I recently encountered this bug as well. Here's my project, which reproduces the issue in a Vagrant box: https://github.com/ErnstHaagsman/grouporder/tree/a14dd4078d9fd97f6a9d8350a49da309b107180a By running:
It looks like gunicorn thinks the socket works ("Feb 23 18:14:25 vagrant gunicorn[22503]: [2018-02-23 18:14:25 +0000] [22503] [INFO] Listening at: unix:/run/gunicorn/gunicorn.sock (22503)") However, |
Can confirm that deployment with systemd as described in the current docs doesn't work. |
Ran into the same issue. In my case I set PrivateTmp=false, and was able to route to the python app on the first request each time I kill the service and restart the socket. Subsequent curls fail with nginx saying no such file or directory. I can also confirm @valq7711 's suggestion worked. |
I spent quite a few hours narrowing it down to the socket aswell, using the systemd example in the docs. It's definitely not obvious and a note should probably be added to the example. @valq7711 's solution works. |
When /run/rmilter/ is wiped out the rmilter.sock is removed, causing postfix to fail to contact rmilter. Probably like described here: benoitc/gunicorn#1524 (comment)
Confirmed changing path from Can we get the docs updated for systemd? |
@arianitu I would be happy to review and merge a PR! Look in |
(can be related to #1523 or #1298)
Unix domain socket gets deleted when Gunicorn is restarted as a service:
Gunicorn is runned by systemd, the service is configured as recommended in the docs
Full service config (slightly redacted):
Gunicorn version is 19.7.1
The text was updated successfully, but these errors were encountered: