CRITICAL Listen failure: [Errno 88] Socket operation on non-socket #420
Replies: 16 comments 2 replies
-
Sorry, this isn't an actionable issue as-is. All I can really suggest is putting a breakpoint into See the Channels docs for support options. |
Beta Was this translation helpful? Give feedback.
-
@hardikbansal Hey, did you solve it? |
Beta Was this translation helpful? Give feedback.
-
Same error on ubuntu buster (Docker). root@5439c0483e8b:~# daphne --verbosity 3 --fd 0 example:application
2020-02-24 10:28:57,245 INFO Starting server at fd:fileno=0
2020-02-24 10:28:57,246 INFO HTTP/2 support not enabled (install the http2 and tls Twisted extras)
2020-02-24 10:28:57,246 INFO Configuring endpoint fd:fileno=0
2020-02-24 10:28:57,258 CRITICAL Listen failure: [Errno 88] Socket operation on non-socket
root@5439c0483e8b:~# daphne --verbosity 3 --endpoint fd:fileno=0 example:application
2020-02-24 10:29:23,778 INFO Starting server at fd:fileno=0
2020-02-24 10:29:23,779 INFO HTTP/2 support not enabled (install the http2 and tls Twisted extras)
2020-02-24 10:29:23,780 INFO Configuring endpoint fd:fileno=0
2020-02-24 10:29:23,796 CRITICAL Listen failure: [Errno 88] Socket operation on non-socket I think it is not a supervisor's problem. It occurred daphne cli too. CC: @carltongibson |
Beta Was this translation helpful? Give feedback.
-
It's cpython's bug in my case. |
Beta Was this translation helpful? Give feedback.
-
@carltongibson Same error occured :( root@8b08497ba8f9:/var/www/webapp# python --version
Python 3.8.1
root@8b08497ba8f9:/var/www/webapp# grep selectors /usr/local/lib/python3.8/site-packages/daphne/server.py
import selectors # isort:skip
selector = selectors.SelectSelector()
root@8b08497ba8f9:/var/www/webapp# daphne --fd 0 example:application
2020-02-27 01:39:58,930 INFO Starting server at fd:fileno=0
2020-02-27 01:39:58,932 INFO HTTP/2 support not enabled (install the http2 and tls Twisted extras)
2020-02-27 01:39:58,932 INFO Configuring endpoint fd:fileno=0
2020-02-27 01:39:59,003 CRITICAL Listen failure: [Errno 88] Socket operation on non-socket
root@8b08497ba8f9:/var/www/webapp# daphne --endpoint fd:fileno=0 example:application
2020-02-27 01:40:53,491 INFO Starting server at fd:fileno=0
2020-02-27 01:40:53,493 INFO HTTP/2 support not enabled (install the http2 and tls Twisted extras)
2020-02-27 01:40:53,493 INFO Configuring endpoint fd:fileno=0
2020-02-27 01:40:53,511 CRITICAL Listen failure: [Errno 88] Socket operation on non-socket |
Beta Was this translation helpful? Give feedback.
-
Maybe same issue that using |
Beta Was this translation helpful? Give feedback.
-
Its root@3efa1ccb0e6e:/var/www/webapp# daphne --verbosity 3 --fd 0 example:application
2020-02-27 02:40:10,543 INFO Starting server at fd:fileno=0
2020-02-27 02:40:10,548 INFO HTTP/2 support not enabled (install the http2 and tls Twisted extras)
2020-02-27 02:40:10,551 INFO Configuring endpoint fd:fileno=0
2020-02-27 02:40:10,681 CRITICAL Listen failure: [Errno 88] Socket operation on non-socket
2020-02-27 02:40:10,682 ERROR Traceback (most recent call last):
2020-02-27 02:40:10,803 ERROR File "/usr/local/bin/daphne", line 8, in <module>
2020-02-27 02:40:10,805 ERROR sys.exit(CommandLineInterface.entrypoint())
2020-02-27 02:40:10,807 ERROR File "/usr/local/lib/python3.8/site-packages/daphne/cli.py", line 191, in entrypoint
2020-02-27 02:40:10,810 ERROR cls().run(sys.argv[1:])
2020-02-27 02:40:10,817 ERROR File "/usr/local/lib/python3.8/site-packages/daphne/cli.py", line 311, in run
2020-02-27 02:40:10,821 ERROR self.server.run()
2020-02-27 02:40:10,824 ERROR File "/usr/local/lib/python3.8/site-packages/daphne/server.py", line 125, in run
2020-02-27 02:40:10,826 ERROR listener = ep.listen(self.http_factory)
2020-02-27 02:40:10,829 ERROR --- <exception caught here> ---
2020-02-27 02:40:10,856 ERROR File "/usr/local/lib/python3.8/site-packages/twisted/internet/endpoints.py", line 1264, in listen
2020-02-27 02:40:10,871 ERROR port = self.reactor.adoptStreamPort(
2020-02-27 02:40:10,893 ERROR File "/usr/local/lib/python3.8/site-packages/twisted/internet/posixbase.py", line 457, in adoptStreamPort
2020-02-27 02:40:10,909 ERROR p = tcp.Port._fromListeningDescriptor(
2020-02-27 02:40:10,917 ERROR File "/usr/local/lib/python3.8/site-packages/twisted/internet/tcp.py", line 1325, in _fromListeningDescriptor
2020-02-27 02:40:10,994 ERROR port = socket.fromfd(fd, addressFamily, cls.socketType)
2020-02-27 02:40:10,997 ERROR File "/usr/local/lib/python3.8/socket.py", line 544, in fromfd
2020-02-27 02:40:11,012 ERROR return socket(family, type, proto, nfd)
2020-02-27 02:40:11,017 ERROR File "/usr/local/lib/python3.8/socket.py", line 231, in __init__
2020-02-27 02:40:11,021 ERROR _socket.socket.__init__(self, family, type, proto, fileno)
2020-02-27 02:40:11,026 ERROR builtins.OSError: [Errno 88] Socket operation on non-socket
|
Beta Was this translation helpful? Give feedback.
-
See #254. There's a comment there about needing to manually create the Let me know if that helps. Maybe there's a docs change we can make. (Not really a Daphne issue but if folks keep hitting it...) |
Beta Was this translation helpful? Give feedback.
-
#254 is unix domain socket case and missing its directory. >>> import socket
>>> socket.fromfd(0, socket.AF_INET, socket.SOCK_STREAM)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/socket.py", line 544, in fromfd
return socket(family, type, proto, nfd)
File "/usr/local/lib/python3.8/socket.py", line 231, in __init__
_socket.socket.__init__(self, family, type, proto, fileno)
OSError: [Errno 88] Socket operation on non-socket |
Beta Was this translation helpful? Give feedback.
-
Yeah, I don't think any of there issue are really Daphne issues per se. (More like OS and permissions issues.) But folks keep turning up with them. We don't really get a resolution. And then something similar pops up a few months later. So if we could document the common issues it might smooth the wheel. |
Beta Was this translation helpful? Give feedback.
-
I'm running into this issue myself. After some hours of investigating i found the following... From what i understand is that supervisor fcgi is a process manager. It listens to a tcp socket and spawns child processes that handle the incoming traffic. Before spawning the child (daphne) it creates a socket on fd:0 for that specific process, so that process can listen on fd:0. So, only daphne instances spawned by supervisor can listen to fd:0. Running I think most issues come up because the directory |
Beta Was this translation helpful? Give feedback.
-
Hi @ronnievdc Thanks for your comments. Do you think a note or admonition would be worthwhile in the guide https://github.com/django/channels/blob/master/docs/deploying.rst#nginxsupervisor-ubuntu ? |
Beta Was this translation helpful? Give feedback.
-
Both, a mention about creating the |
Beta Was this translation helpful? Give feedback.
-
Fancy making that PR? (Since it's fresh for you, you're probably Best Qualified™ ATM...) |
Beta Was this translation helpful? Give feedback.
-
None of the responses here have mentioned that That said, I am having the same problem when I do use
|
Beta Was this translation helpful? Give feedback.
-
I have made a server using Django REST framework and Django channels but I am unable to configure supervisor to run with it. My supervisor config is as follow:
And the error that I am getting is as follow:
I am not sure whether this is daphne issue or some supervisor issue
Beta Was this translation helpful? Give feedback.
All reactions