GithubHelp home page GithubHelp logo

Comments (11)

carltongibson avatar carltongibson commented on June 10, 2024

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.

raceybe avatar raceybe commented on June 10, 2024

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.

carltongibson avatar carltongibson commented on June 10, 2024

I have Windows 10 available. So, instructions for there. (No doubt just "run this" but... 🙂)

from daphne.

raceybe avatar raceybe commented on June 10, 2024

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.

carltongibson avatar carltongibson commented on June 10, 2024

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.

raceybe avatar raceybe commented on June 10, 2024

Hmm, I'll take a look through to see if anything pops up once I make a zip available.

from daphne.

raceybe avatar raceybe commented on June 10, 2024

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.

daphnetls.zip

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.

raceybe avatar raceybe commented on June 10, 2024

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.

carltongibson avatar carltongibson commented on June 10, 2024

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.

aalvarez avatar aalvarez commented on June 10, 2024

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.

carltongibson avatar carltongibson commented on June 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.