We have small aiohttp-based running on many customers servers. All errors from these servers are reported to Sentry. There are many errors whitch looks like aiohttp bugs, here's details:
Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x7f3388134400>
transport: <_SelectorSocketTransport closing fd=30 read=idle write=<idle, bufsize=0>>
AttributeError: 'NoneType' object has no attribute 'feed_appdata'
File "asyncio/sslproto.py", line 637, in _process_write_backlog
ssldata, offset = self._sslpipe.feed_appdata(data, offset)
Unfortunately, we can not reproduce this issue on our environment and do not have access to affected servers.
aiohttp server 2.3.2
Centos 6/7
Please advice
Thanks for report.
The problem is actually in asyncio itself.
I'm trying to write a complex fix for SSL transport but it takes a while.
You can simply ignore this noisy error message.
P.S.
Let's keep the issue open for the reference for a while.
same error I got:
Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x0311ADD0>
transport: <_SelectorSocketTransport closing fd=876 read=idle write=<idle, bufsize=0>>
Traceback (most recent call last):
File "C:\Python36\lib\asyncio\sslproto.py", line 638, in _process_write_backlog
ssldata, offset = self._sslpipe.feed_appdata(data, offset)
AttributeError: 'NoneType' object has no attribute 'feed_appdata'
waiting for the fix. Thanks a lot.
I hit this one too but not with aiohttp. Is there a relevant issue on CPython's bug tracker?
There are several issues related to asyncio ssl support, I'll address them before new Python release.
just hit this too
I have the same issue, just to let you know :)
I too.
I too. have something temp way fix it? pls
The error is harmless, you could just ignore it.
asyncio tries to write into closed SSL connection and fails -- but nothing is corrupted, the socket is closed successfully etc. Bug fix should just ignore such write tries.
I'll apply the fix to Python 3.6.5
It depends.
It harms our voice channel steram using discordpy. I'm not sure if that's because discordpy doesn't handle that error from aiohttp, or aiohttp doesn't handle error from asyncio.
End result - i can't handle that in my code, no indicators that something happend, stream "looks" as usual, like nothing happend, but no data is streamed (i don't even have a way to check and restart stream).
(i'm waiting for a next occurence of that issue to grab full stack and see)
I pretty sure discord problem is not related.
The relation is stream breaks and i see that error in console. Or in other words - if that error occurs, stream breaks, but discordpy "doesn't know" about that and is still streaming (no further error of any type, it just "streams" like nothing happend, but of course no data is transferred).
I'll try to find out what and where doesn't handle that properly and update here if necessary.
Socket is closed before displaying the message, writing into closed socket is an error anyway.
Probably related, additionnaly to the error reported in this issue, I also get such errors :
ERROR:root:Exception in callback SSLProtocol._process_write_backlog()
handle: <Handle SSLProtocol._process_write_backlog()>
Traceback (most recent call last):
File "/home/inso/.pyenv/versions/3.5.4/lib/python3.5/asyncio/sslproto.py", line 639, in _process_write_backlog
ssldata = self._sslpipe.do_handshake(
AttributeError: 'NoneType' object has no attribute 'do_handshake'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/inso/.pyenv/versions/3.5.4/lib/python3.5/asyncio/events.py", line 127, in _run
self._callback(*self._args)
File "/home/inso/.pyenv/versions/3.5.4/lib/python3.5/asyncio/sslproto.py", line 665, in _process_write_backlog
self._on_handshake_complete(exc)
File "/home/inso/.pyenv/versions/3.5.4/lib/python3.5/asyncio/sslproto.py", line 579, in _on_handshake_complete
sslobj = self._sslpipe.ssl_object
AttributeError: 'NoneType' object has no attribute 'ssl_object'
Does this error means we need to reinit the Client Session before trying to send new requests ?
I guess no. Just ignore all errors that happen on connection closing.
Fixed in upstream, please test on Python 3.6.5
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs.
If you feel like there's important points made in this discussion, please include those exceprts into that [new issue].
Most helpful comment
Thanks for report.
The problem is actually in asyncio itself.
I'm trying to write a complex fix for SSL transport but it takes a while.
You can simply ignore this noisy error message.
P.S.
Let's keep the issue open for the reference for a while.