Skip to content
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

Issues with deployment and daphne socket listeners #254

Closed
pythonBerg opened this issue Mar 19, 2019 · 4 comments
Closed

Issues with deployment and daphne socket listeners #254

pythonBerg opened this issue Mar 19, 2019 · 4 comments

Comments

@pythonBerg
Copy link

I've seen this before in #233 and #234. I followed those instructions to replace --fd:0 with --endpoint fd:fileno=0. I get the same errors in both configurations. Probably something basic I don't understand but need some guidance here...

Starting using exact specification in django-channels 2 deployment using supervisor..., modified according to closed issues above.

ubuntu 18.04. Python 3.6, Daphne 2.2.5

[fcgi-program:daphne]
socket=tcp://localhost:8001

directory=/home/edbergman/compscre

command=daphne -u /run/daphne/daphne%(process_num)d.sock --endpoint fd:fileno=0 --access-log - --proxy-headers compscre.asgi:application

# Number of processes to startup, roughly the number of CPUs you have
numprocs=4

process_name=asgi%(process_num)d

autostart=false
autorestart=true

stdout_logfile=/home/edbergman/compscre/logs/asgi.log
redirect_stderr=true

2019-03-19 17:46:39,064 INFO Starting server at fd:fileno=0, unix:/run/daphne/daphne0.sock
2019-03-19 17:46:39,066 INFO HTTP/2 support not enabled (install the http2 and tls Twisted extras)
2019-03-19 17:46:39,066 INFO Configuring endpoint fd:fileno=0
2019-03-19 17:46:39,086 INFO Listening on TCP address 127.0.0.1:8001
2019-03-19 17:46:39,086 INFO Configuring endpoint unix:/run/daphne/daphne0.sock
2019-03-19 17:46:39,087 CRITICAL Listen failure: [Errno 2] No such file or directory: '3051' -> b'/run/daphne/daphne0.sock.lock'

@pythonBerg
Copy link
Author

closing this. Issues has been resolved...no to figure out why.

@marco-silva0000
Copy link

marco-silva0000 commented Jul 1, 2019

I've also came across this error. Any idea how to solve or what is causing it?

Update: I had do create the /run/daphne folder manually and it fixes it. A server restart caused the folder do be "erased".

If anyone can help, I would like to know how can I make this automatic so that this problem doesn't happen at every restart.

@sjgreig27
Copy link

I have the same issue, is there a reason why daphne doesn't create the /run/daphne directory with the arguments provided?

@crlalbu
Copy link

crlalbu commented Mar 19, 2022

I had the same problem, try https://channels.readthedocs.io/en/stable/deploying.html
The /run/ folder is cleared on a server reboot. To make the /run/daphne folder persistant create a file /usr/lib/tmpfiles.d/daphne.conf with the contents below.

$ d /run/daphne 0755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants