Comments (11)
Hi. Could you put together a minimal example that reproduces this (with any necessary instructions)?
Happy to have a look but can't say much right now.
from daphne.
Sure I could do that. The server runs fine even when it shows up (it's been running on my laptop for about a month). Can I provide instructions with the Windows setup or do you want/need a linux VM or something?
from daphne.
I have Windows 10 available. So, instructions for there. (No doubt just "run this" but... 🙂)
from daphne.
Just a curiousity...is there test coverage for TLS scenarios? If so, is there a description of the test, so perhaps I could track down what is different about my configuration?
from daphne.
Right, well, we should almost certainly be on the Daphne repo here, and probably on Twisted TBH... but there's nothing specifically HTTPS here https://github.com/django/daphne/tree/master/tests
from daphne.
Hmm, I'll take a look through to see if anything pops up once I make a zip available.
from daphne.
I have attached a zip that should work on windows. The Django project was setup with the steps shown below if you wish to recreate it from scratch. I ran the server after each step, and it wasn't until I did pip install -U twisted[http2,tls]
that the error showed up. The run_daphne.bat
file shows the command I use to run Daphne.
After you run Daphne, you need to make a request to the web server, then wait about 75 seconds or so. The message will show up on the console (repeated at the end of this comment).
pip install channels, pypiwin32
pip install -U twisted[http2,tls]
Basic Setup
https://channels.readthedocs.io/en/latest/tutorial/part_1.html#integrate-the-channels-library
Daphne Setup
https://channels.readthedocs.io/en/latest/deploying.html#run-protocol-servers
HTTP2/TLS setup
https://github.com/django/daphne#http2-support
Certificate generated with
https://certificatetools.com/
2019-06-04 11:07:35,614 INFO Starting server at ssl:4443:privateKey=cert.key:certKey=cert.crt 2019-06-04 11:07:35,615 INFO HTTP/2 support enabled 2019-06-04 11:07:35,617 INFO Configuring endpoint ssl:4443:privateKey=cert.key:certKey=cert.crt 2019-06-04 11:07:35,629 INFO Listening on TCP address 0.0.0.0:4443 127.0.0.1:61588 - - [04/Jun/2019:11:09:24] "GET /" 200 16348 Not Found: /static/admin/css/fonts.css 2019-06-04 11:09:24,980 WARNING Not Found: /static/admin/css/fonts.css 127.0.0.1:61588 - - [04/Jun/2019:11:09:24] "GET /static/admin/css/fonts.css" 404 2021 2019-06-04 11:10:39,547 ERROR Exception in callback AsyncioSelectorReactor.callLater.<locals>.run() at c:\users\brian\virtualenvs\daphnetls\lib\site-packages\twisted\internet\asyncioreactor.py:287 handle: <TimerHandle when=1476254.671 AsyncioSelectorReactor.callLater.<locals>.run() at c:\users\brian\virtualenvs\daphnetls\lib\site-packages\twisted\internet\asyncioreactor.py:287> Traceback (most recent call last): File "C:\Program Files\Python37\lib\asyncio\events.py", line 88, in _run self._context.run(self._callback, *self._args) File "c:\users\brian\virtualenvs\daphnetls\lib\site-packages\twisted\internet\asyncioreactor.py", line 290, in run f(*args, **kwargs) File "c:\users\brian\virtualenvs\daphnetls\lib\site-packages\twisted\web\http.py", line 2339, in forceAbortClient self.transport.abortConnection() File "c:\users\brian\virtualenvs\daphnetls\lib\site-packages\twisted\protocols\tls.py", line 435, in abortConnection self._shutdownTLS() File "c:\users\brian\virtualenvs\daphnetls\lib\site-packages\twisted\protocols\tls.py", line 338, in _shutdownTLS shutdownSuccess = self._tlsConnection.shutdown() AttributeError: 'NoneType' object has no attribute 'shutdown'
from daphne.
Oh, and similar to what I did before, you can run that project with those packages on Linux, and it should generate the error...my question about OS was sort of moot since the same setup on both OSes will generate the error.
from daphne.
Hi @raceybe. Thanks for the project. Not immediately but, I'll have a play and get back to you.
The server runs fine even when it shows up (it's been running on my laptop for about a month)
Not critical then. 🙂
from daphne.
Good Morning ....
The same problem over debian server. No critical because not halt the execution code ...
Python 3.7.3
Channels 2.3.0
channels-redis 2.4.0
Twisted 19.7.0
2019-10-20 09:38:56,608 ERROR Exception in callback AsyncioSelectorReactor.callLater..run() at /home/sigho/.env/sigho/lib/python3.7/site-packages/twisted/internet/asyncioreactor.py:287
handle: <TimerHandle when=39987880.95796866 AsyncioSelectorReactor.callLater..run() at /home/sigho/.env/sigho/lib/python3.7/site-packages/twisted/internet/asyncioreactor.py:287>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/home/sigho/.env/sigho/lib/python3.7/site-packages/twisted/internet/asyncioreactor.py", line 290, in run
f(*args, **kwargs)
File "/home/sigho/.env/sigho/lib/python3.7/site-packages/twisted/web/http.py", line 2380, in forceAbortClient
self.transport.abortConnection()
File "/home/sigho/.env/sigho/lib/python3.7/site-packages/twisted/protocols/tls.py", line 435, in abortConnection
self._shutdownTLS()
File "/home/sigho/.env/sigho/lib/python3.7/site-packages/twisted/protocols/tls.py", line 338, in _shutdownTLS
shutdownSuccess = self._tlsConnection.shutdown()
AttributeError: 'NoneType' object has no attribute 'shutdown'
from daphne.
This looks like a Twisted TLS issue. Unless there's a concrete suggestion of a change we can make in Daphne I'm not sure it's actionable here.
from daphne.
Related Issues (20)
- issuse when i using daphe in my django app with streaminghttpresponse HOT 7
- Can daphne run WSGI apps? HOT 6
- Does daphne have a file for initialization?
- Requests with Transfer-Encoding: chunked have no content HOT 15
- StreamHttpResponse with sync operations break in Daphne HOT 5
- Memory usage: Daphne loading all the file in memory (POST request) HOT 7
- Text streaming buffered issue
- Implement WebSocket Denial Response extension HOT 8
- [feature request] trailing headers HOT 1
- Add support for Python 3.12
- DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13 HOT 1
- Daphne with self signed ssl HOT 2
- Daphne allows invalid characters within header names HOT 7
- Unix File Socket Argument HOT 12
- TypeError: object HttpResponse can't be used in 'await' expression HOT 3
- add support for --proxy-headers and friends in runserver HOT 4
- fd_endpoint.py is not properly installed HOT 7
- python manage.py runserver not working HOT 5
- Daphne - Twisted custom cipher list using set_cipher method HOT 3
- --noasgi won't serve static files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daphne.