Содержание
- Fatal error on SSL transport #3393
- Comments
- Asyncio Fatal Error on SSL Transport — IndexError Deque Index Out Of Range
- Fatal error on SSL transport #67
- Comments
- Footer
- «Fatal error on SSL transport» when exiting python script #20482
- Comments
- Fatal error on SSL transport #67
- Comments
- Footer
Fatal error on SSL transport #3393
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File «/var/containers/Bundle/Application/84DF3BDF-B442-41B6-93B3-AB45EDA9E5FC/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/sslproto.py», line 640, in _process_write_backlog
ssldata = self._sslpipe.shutdown(self._finalize)
File «/var/containers/Bundle/Application/84DF3BDF-B442-41B6-93B3-AB45EDA9E5FC/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/sslproto.py», line 156, in shutdown
ssldata, appdata = self.feed_ssldata(b»)
File «/var/containers/Bundle/Application/84DF3BDF-B442-41B6-93B3-AB45EDA9E5FC/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/sslproto.py», line 220, in feed_ssldata
self._sslobj.unwrap()
File «/var/containers/Bundle/Application/84DF3BDF-B442-41B6-93B3-AB45EDA9E5FC/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/ssl.py», line 692, in unwrap
return self._sslobj.shutdown()
ssl.SSLError: [SSL] called a function you should not call (_ssl.c:2299)
The text was updated successfully, but these errors were encountered:
I used “try” and tried handle this exception, but I can’ catch it.
GitMate.io thinks the contributor most likely able to help you is @asvetlov.
Possibly related issues are #3242 (Error), #3117 (Fatal read error on socket transport), #3141 (Fatal read error on socket transport ), #2822 (Unexpected SSL error (CERTIFICATE_VERIFY_FAILED)), and #272 (SSL documentation).
Источник
Asyncio Fatal Error on SSL Transport — IndexError Deque Index Out Of Range
I keep running into the bellow error and can’t work out how to fix it or whether it is a bug in asyncio that I need to report. My program works fine is it basically the same as the example in there docs but it can send lots of messages upto 20 per second to multiple clients when there is a low number of updates it works fine but when the number of writes increases I run into this error.
I am using create_server from asyncio to make the server listen for new clients and I believe this creates a new connection on each connection. Not all clients stop only one clients stops and the rest keep running it’s usually the last client that connected but not always. I have played with the asyncio/sslproto.py file removing the reference to [0] and replacing them with popleft which they got me the not very helpful SSL: BAD_LENGTH error which I have had before and using asyncio was supposed to be the fix.
When I logged the value of self._write_backlog it returned the deque as expected and before the error there was clearly data in it and I believe that self._write_backlog[0] should return the leftmost element in the deque which there appeared to be one.
On further investigation the same error also seems to happen at a diffrent point in the code but it is the same error like it’s trying to access an empty deque.
EDIT
The version of python I am running on is 3.7.1 but I have also tried 3.7.3 which gave the same error.
Источник
Fatal error on SSL transport #67
I have cloned the New Monocle.
Now the Scanner has Errors in the Logs Like This.
The text was updated successfully, but these errors were encountered:
I’m not quite sure what the problem is here. Does it happen in the middle of sessions or while exiting? On every request, many, or just a few? Is your internet connection stable?
Yes my internet connection is stable.
Here a littlebit more.
I figured out what this is.
asyncio.sslproto.SSLProtocol and other TCP related errors tend to happen when the server can’t process TCP in a timely manner. While there could be various reasons for this (mostly infra related), one common reason is the maximum CPU usage of server.
Usually, Monocle is very conservative in terms of CPU usage but when doing certain operations like bootstrap, MORE_POINTS, etc, it maxes out CPU and when that happens, server fails to properly process TCP connections and you get those errors.
@MonkeyTedBaker great findings. We find similar issuing on SSLProtocol with the Fatal error on SSL transport . Do you have suggestions to mitigate the issue other than to lower cpu usage? Seems when that happens, many IO/TCP requests are failing
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
«Fatal error on SSL transport» when exiting python script #20482
- Package Name: azure-eventhub-checkpointstoreblob-aio
- Package Version: 1.1.4
- Operating System: MacOs 10.15.7
- Python Version: 3.9.1
Describe the bug
Error is occurring after exiting python program :
To Reproduce
Steps to reproduce the behavior:
Minimal repro :
Expected behavior
Error should not occur
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Thanks for the feedback, we’ll investigate asap.
hey @rjohnsonrxr, I am able to reproduce the issue on windows which gave me more information on the error:
according to the doc of asyncio.run :
This function always creates a new event loop and closes it at the end. It should be used as a main entry point for asyncio programs, and should ideally only be called once.
So I think it’s because the underlying ssl obj is hooked with one asyncio loop in the first asyncio.run , and the loop get closed after the running which leads to the second call find that the previous loop hooked with the ssl obj is already closed.
To bypass it, you could use the same loop to run those two method, so your code could be like:
Please let me whether it works for you or you need any other help.
Источник
Fatal error on SSL transport #67
I have cloned the New Monocle.
Now the Scanner has Errors in the Logs Like This.
The text was updated successfully, but these errors were encountered:
I’m not quite sure what the problem is here. Does it happen in the middle of sessions or while exiting? On every request, many, or just a few? Is your internet connection stable?
Yes my internet connection is stable.
Here a littlebit more.
I figured out what this is.
asyncio.sslproto.SSLProtocol and other TCP related errors tend to happen when the server can’t process TCP in a timely manner. While there could be various reasons for this (mostly infra related), one common reason is the maximum CPU usage of server.
Usually, Monocle is very conservative in terms of CPU usage but when doing certain operations like bootstrap, MORE_POINTS, etc, it maxes out CPU and when that happens, server fails to properly process TCP connections and you get those errors.
@MonkeyTedBaker great findings. We find similar issuing on SSLProtocol with the Fatal error on SSL transport . Do you have suggestions to mitigate the issue other than to lower cpu usage? Seems when that happens, many IO/TCP requests are failing
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
Issue33093
Created on 2018-03-17 17:36 by Eric Toombs, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Messages (5) | ||
---|---|---|
msg314008 — (view) | Author: Eric Toombs (Eric Toombs) | Date: 2018-03-17 17:36 |
I'm not exactly sure what caused this error, but I was a client receiving messages on a websocket for a while (about 12 hours). Suddenly all incoming data stopped, then nothing happened for about 5 hours. Finally, I received a ConnectionClosed and the following appeared on stdout: ``` Fatal error on SSL transport protocol: <asyncio.sslproto.SSLProtocol object at 0x7f17ae393e48> transport: <_SelectorSocketTransport closing fd=15 read=idle write=<idle, bufsize=0>> Traceback (most recent call last): File "/usr/lib/python3.6/asyncio/sslproto.py", line 636, in _process_write_backlog ssldata, offset = self._sslpipe.feed_appdata(data, offset) AttributeError: 'NoneType' object has no attribute 'feed_appdata' ``` I can't imagine this is what was supposed to happen. This has happened about three times now, so I can confirm it is reproducible. I'm writing a minimalist client now to see if I can isolate the problem any further. It's still unclear, though, which layer is responsible---websockets or asyncio. The websockets issue is here: https://github.com/aaugustin/websockets/issues/356 |
||
msg314042 — (view) | Author: Matt Eaton (agnosticdev) * | Date: 2018-03-18 14:31 |
Eric, what is needed to try and reproduce this issue accurately? Would it be installing websockets and setting up your client to ping to the server forever (12 hours in this case)? If you are able to provide a client I would be willing to setup a test case on my end. |
||
msg314184 — (view) | Author: Neil Booth (kyuupichan) * | Date: 2018-03-21 02:14 |
Looks like https://bugs.python.org/issue33037 |
||
msg314302 — (view) | Author: Eric Toombs (Eric Toombs) | Date: 2018-03-23 09:59 |
Well, that looks good! Looking forward to 3.6.5! |
||
msg314324 — (view) | Author: Ned Deily (ned.deily) * |
Date: 2018-03-23 20:30 |
Thanks for the report and for the analysis! Closing as duplicate. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:58 | admin | set | github: 77274 |
2018-03-23 20:30:58 | ned.deily | set | status: open -> closed
superseder: Skip sending/receiving after SSL transport closing nosy: |
2018-03-23 11:20:59 | ppperry | set | type: behavior |
2018-03-23 09:59:02 | Eric Toombs | set | messages: + msg314302 |
2018-03-21 02:14:13 | kyuupichan | set | nosy: + kyuupichan messages: + msg314184 |
2018-03-18 14:31:29 | agnosticdev | set | nosy: + agnosticdev messages: + msg314042 |
2018-03-17 17:36:10 | Eric Toombs | create |
Fatal error on SSL transport #3393
Comments
yjqiang commented Nov 17, 2018
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File «/var/containers/Bundle/Application/84DF3BDF-B442-41B6-93B3-AB45EDA9E5FC/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/sslproto.py», line 640, in _process_write_backlog
ssldata = self._sslpipe.shutdown(self._finalize)
File «/var/containers/Bundle/Application/84DF3BDF-B442-41B6-93B3-AB45EDA9E5FC/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/sslproto.py», line 156, in shutdown
ssldata, appdata = self.feed_ssldata(b»)
File «/var/containers/Bundle/Application/84DF3BDF-B442-41B6-93B3-AB45EDA9E5FC/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/sslproto.py», line 220, in feed_ssldata
self._sslobj.unwrap()
File «/var/containers/Bundle/Application/84DF3BDF-B442-41B6-93B3-AB45EDA9E5FC/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/ssl.py», line 692, in unwrap
return self._sslobj.shutdown()
ssl.SSLError: [SSL] called a function you should not call (_ssl.c:2299)
The text was updated successfully, but these errors were encountered:
yjqiang commented Nov 17, 2018
I used “try” and tried handle this exception, but I can’ catch it.
aio-libs-bot commented Nov 17, 2018
GitMate.io thinks the contributor most likely able to help you is @asvetlov.
Possibly related issues are #3242 (Error), #3117 (Fatal read error on socket transport), #3141 (Fatal read error on socket transport ), #2822 (Unexpected SSL error (CERTIFICATE_VERIFY_FAILED)), and #272 (SSL documentation).
asvetlov commented Nov 17, 2018
What Python and aiohttp versions do yo use?
yjqiang commented Nov 17, 2018
python 3.6.1 and aiohttp 3.4.4 by using pip
asvetlov commented Nov 17, 2018
The problem not in aiohttp itself but in Python asyncio.
Try to upgrade to Python 3.7.1 — it has several asyncio SSL fixes.
I don’t know if these fixes are enough for your case though.
yjqiang commented Nov 17, 2018
I’m using Pythonista on ios, so I can’t upgrade to 3.7.1 by myself. But if the author made it, I would try and give you the feedback.
yjqiang commented Nov 17, 2018
Should I close it now or let it open until …?
yjqiang commented Nov 17, 2018 •
By the way, I think I find the reason of #3117 and #3141 and #3202. Can I reopen #3202 , since I made that issue? And I left a message for you there, several days ago.
asvetlov commented Nov 17, 2018
Yes, better to report on upstream.
Regarding #3202 — let’s briefly discuss your findings with closed issue status and decide what to do after that.
yjqiang commented Nov 17, 2018 •
@asvetlov I wrote something in #3202 few minutes ago.
yjqiang commented Nov 17, 2018
Yes, better to report on upstream.
Regarding #3202 — let’s briefly discuss your findings with closed issue status and decide what to do after that.
Did you read that? I think that’s important.
Источник
«Fatal error on SSL transport» when exiting python script #20482
Comments
rjohnsonrxr commented Aug 31, 2021
- Package Name: azure-eventhub-checkpointstoreblob-aio
- Package Version: 1.1.4
- Operating System: MacOs 10.15.7
- Python Version: 3.9.1
Describe the bug
Error is occurring after exiting python program :
To Reproduce
Steps to reproduce the behavior:
Minimal repro :
Expected behavior
Error should not occur
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
xiangyan99 commented Sep 2, 2021
Thanks for the feedback, we’ll investigate asap.
yunhaoling commented Sep 13, 2021
hey @rjohnsonrxr, I am able to reproduce the issue on windows which gave me more information on the error:
according to the doc of asyncio.run :
This function always creates a new event loop and closes it at the end. It should be used as a main entry point for asyncio programs, and should ideally only be called once.
So I think it’s because the underlying ssl obj is hooked with one asyncio loop in the first asyncio.run , and the loop get closed after the running which leads to the second call find that the previous loop hooked with the ssl obj is already closed.
To bypass it, you could use the same loop to run those two method, so your code could be like:
Please let me whether it works for you or you need any other help.
Источник
Fatal error on SSL transport #67
Comments
Memurame commented Jan 28, 2017 •
I have cloned the New Monocle.
Now the Scanner has Errors in the Logs Like This.
The text was updated successfully, but these errors were encountered:
Noctem commented Feb 2, 2017
I’m not quite sure what the problem is here. Does it happen in the middle of sessions or while exiting? On every request, many, or just a few? Is your internet connection stable?
Memurame commented Feb 5, 2017
Yes my internet connection is stable.
Here a littlebit more.
MonkeyTedBaker commented Sep 28, 2017
I figured out what this is.
asyncio.sslproto.SSLProtocol and other TCP related errors tend to happen when the server can’t process TCP in a timely manner. While there could be various reasons for this (mostly infra related), one common reason is the maximum CPU usage of server.
Usually, Monocle is very conservative in terms of CPU usage but when doing certain operations like bootstrap, MORE_POINTS, etc, it maxes out CPU and when that happens, server fails to properly process TCP connections and you get those errors.
jeffpeiyt commented Mar 25, 2018
@MonkeyTedBaker great findings. We find similar issuing on SSLProtocol with the Fatal error on SSL transport . Do you have suggestions to mitigate the issue other than to lower cpu usage? Seems when that happens, many IO/TCP requests are failing
Footer
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
fatal error on ssl transport #571
Comments
yjqiang commented Nov 1, 2018
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File «/var/containers/Bundle/Application/84DF3BDF-B442-41B6-93B3-AB45EDA9E5FC/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/sslproto.py», line 640, in _process_write_backlog
ssldata = self._sslpipe.shutdown(self._finalize)
File «/var/containers/Bundle/Application/84DF3BDF-B442-41B6-93B3-AB45EDA9E5FC/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/sslproto.py», line 156, in shutdown
ssldata, appdata = self.feed_ssldata(b»)
File «/var/containers/Bundle/Application/84DF3BDF-B442-41B6-93B3-AB45EDA9E5FC/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/asyncio/sslproto.py», line 220, in feed_ssldata
self._sslobj.unwrap()
File «/var/containers/Bundle/Application/84DF3BDF-B442-41B6-93B3-AB45EDA9E5FC/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/ssl.py», line 692, in unwrap
return self._sslobj.shutdown()
ssl.SSLError: [SSL] called a function you should not call (_ssl.c:2299)
The text was updated successfully, but these errors were encountered:
yjqiang commented Nov 1, 2018
pythonista 320000 python 3.6.1 aiohttp 3.4.4
cclauss commented Nov 1, 2018 •
Please also provide a minimal code snippet that generates this error message.
Источник
AttributeError: ‘NoneType’ object has no attribute ‘feed_appdata’ #2546
Comments
binrush commented Nov 22, 2017
Long story short
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:
Steps to reproduce
Unfortunately, we can not reproduce this issue on our environment and do not have access to affected servers.
Your environment
aiohttp server 2.3.2
Centos 6/7
The text was updated successfully, but these errors were encountered:
asvetlov commented Nov 22, 2017
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.
bigbagboom commented Dec 20, 2017 •
same error I got:
waiting for the fix. Thanks a lot.
agronholm commented Feb 1, 2018
I hit this one too but not with aiohttp. Is there a relevant issue on CPython’s bug tracker?
asvetlov commented Feb 2, 2018
There are several issues related to asyncio ssl support, I’ll address them before new Python release.
thehesiod commented Feb 6, 2018
just hit this too
daniel-kukiela commented Feb 16, 2018
I have the same issue, just to let you know 🙂
vladiscripts commented Feb 16, 2018
thomaszdxsn commented Feb 23, 2018
I too. have something temp way fix it? pls
asvetlov commented Feb 23, 2018
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
daniel-kukiela commented Feb 23, 2018 •
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)
asvetlov commented Feb 23, 2018
I pretty sure discord problem is not related.
daniel-kukiela commented Feb 23, 2018 •
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.
asvetlov commented Feb 23, 2018
Socket is closed before displaying the message, writing into closed socket is an error anyway.
Insoleet commented Mar 2, 2018
Probably related, additionnaly to the error reported in this issue, I also get such errors :
Insoleet commented Mar 9, 2018
Does this error means we need to reinit the Client Session before trying to send new requests ?
asvetlov commented Mar 9, 2018
I guess no. Just ignore all errors that happen on connection closing.
asvetlov commented Mar 10, 2018 •
Fixed in upstream, please test on Python 3.6.5
lock bot commented Oct 28, 2019
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].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new
Footer
© 2023 GitHub, Inc.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Источник
Hi there!
I’m seeing an error when exiting an Async PRAW script that I don’t understand. I suspect this isn’t strictly related to Async PRAW code but rather a problem in lower level aiohttp
and/or asyncio
but since Google wasn’t of much help at all I wanted to ask here in case someone can shed light on this.
Code:
import asyncpraw
import asyncio
async def main():
# authentication with credentials from praw.ini
reddit = asyncpraw.Reddit("R6Bot", user_agent="web:rainbow6:r6bot:v3.0.0 (by u/jeypiti)")
print(await reddit.user.me())
if __name__ == "__main__":
asyncio.run(main())
The following output is generated:
R6Bot
Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x7ff0c43037c0>
transport: <_SelectorSocketTransport closing fd=6>
Traceback (most recent call last):
File "/usr/lib/python3.9/asyncio/selector_events.py", line 918, in write
n = self._sock.send(data)
OSError: [Errno 9] Bad file descriptor
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.9/asyncio/sslproto.py", line 684, in _process_write_backlog
self._transport.write(chunk)
File "/usr/lib/python3.9/asyncio/selector_events.py", line 924, in write
self._fatal_error(exc, 'Fatal write error on socket transport')
File "/usr/lib/python3.9/asyncio/selector_events.py", line 719, in _fatal_error
self._force_close(exc)
File "/usr/lib/python3.9/asyncio/selector_events.py", line 731, in _force_close
self._loop.call_soon(self._call_connection_lost, exc)
File "/usr/lib/python3.9/asyncio/base_events.py", line 746, in call_soon
self._check_closed()
File "/usr/lib/python3.9/asyncio/base_events.py", line 510, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7ff0c42edfd0>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7ff0c4308220>, 129.955002929)]']
connector: <aiohttp.connector.TCPConnector object at 0x7ff0c42edf10>
It correctly prints the username of the authenticated user and then raises the error during script exit. It can tell this is only on exit because inserting await ascynio.sleep(3)
at the end of main()
delays the exception accordingly.
This is running in a completely fresh Ubuntu 21.04 VM that is up-to-date as of yesterday (but I also had the problem on macOS and Windows). Python version is 3.9.5 (but I also had the problem on 3.9.6 and 3.10b3 before) running in a completely clean environment that only has the latest version of asyncpraw
+ dependencies and default virtualenv
stuff installed:
$ python3 -m pip list
Package Version
----------------- -----------
aiofiles 0.6.0
aiohttp 3.7.4.post0
aiosqlite 0.17.0
async-generator 1.10
async-timeout 3.0.1
asyncio-extras 1.3.2
asyncpraw 7.3.1
asyncprawcore 2.2.1
attrs 21.2.0
certifi 2021.5.30
chardet 4.0.0
idna 2.10
multidict 5.1.0
pip 20.3.4
pkg-resources 0.0.0
requests 2.25.1
setuptools 44.1.1
typing-extensions 3.10.0.0
update-checker 0.18.0
urllib3 1.26.6
wheel 0.34.2
yarl 1.6.3
Probably not relevant but the installed OpenSSL version:
$ openssl version
OpenSSL 1.1.1j 16 Feb 2021
Frankly, I have no clue where to start debugging so any ideas are appreciated!
Я продолжаю сталкиваться с приведенной ниже ошибкой и не могу понять, как ее исправить или это ошибка в asyncio, о которой мне нужно сообщить. Моя программа работает нормально, в основном она такая же, как в примере документы, но она может отправлять много сообщений до 20 в секунду нескольким клиентам, когда есть небольшое количество обновлений, она работает нормально, но когда количество записей увеличивается, я сталкиваюсь с эта ошибка.
Я использую create_server из asyncio, чтобы заставить сервер слушать новых клиентов, и я считаю, что это создает новое соединение для каждого соединения. Не все клиенты останавливаются, останавливается только один клиент, а остальные продолжают работать, обычно это последний клиент, который подключился, но не всегда. Я поиграл с файлом asyncio/sslproto.py, удалив ссылку на [0] и заменив их на popleft, что привело к не очень полезной ошибке SSL: BAD_LENGTH, которая у меня была раньше, и использование asyncio должно было исправить.
Когда я записал значение self._write_backlog, оно вернуло очередь, как и ожидалось, и до ошибки в ней явно были данные, и я считаю, что self._write_backlog[0] должен возвращать крайний левый элемент в очереди, который, как оказалось, был один.
Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x7f267462e780>
transport: <_SelectorSocketTransport fd=38 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/asyncio/sslproto.py", line 689, in
_process_write_backlog
del self._write_backlog[0]
IndexError: deque index out of range
При дальнейшем расследовании та же ошибка, по-видимому, также возникает в другой точке кода, но это та же ошибка, что и при попытке доступа к пустой очереди.
Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x7f45f802ec88>
transport: <_SelectorSocketTransport fd=29 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/asyncio/sslproto.py", line 664, in _process_write_backlog
data, offset = self._write_backlog[0]
IndexError: deque index out of range
РЕДАКТИРОВАТЬ
Версия Python, на которой я работаю, — 3.7.1, но я также пробовал 3.7.3, которая выдавала ту же ошибку.
ОБНОВИТЬ
Считается, что эта проблема вызвана несовместимостью между asyncio и OpenSSL https://bugs.python.org/issue37226.
ОБНОВЛЕНИЕ 2
Минимальный пример доступен на Гитхаб.
Open
Issue created Dec 02, 2016 by
SSL error
2016-12-02 20:03:16,840 ERROR Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x7fa164036c18>
transport: <_SelectorSocketTransport closing fd=42 read=idle write=<idle, bufsize=0>>
Traceback (most recent call last):
File «/usr/lib/python3.5/asyncio/sslproto.py», line 628, in _process_write_backlog
ssldata = self._sslpipe.shutdown(self._finalize)
File «/usr/lib/python3.5/asyncio/sslproto.py», line 151, in shutdown
raise RuntimeError(‘shutdown in progress’)
RuntimeError: shutdown in progress
2016-12-02 20:03:16,842 ERROR Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x7fa14ffafeb8>
transport: <_SelectorSocketTransport closing fd=59 read=idle write=<idle, bufsize=0>>
Traceback (most recent call last):
File «/usr/lib/python3.5/asyncio/sslproto.py», line 628, in _process_write_backlog
ssldata = self._sslpipe.shutdown(self._finalize)
File «/usr/lib/python3.5/asyncio/sslproto.py», line 151, in shutdown
raise RuntimeError(‘shutdown in progress’)
RuntimeError: shutdown in progress
2016-12-02 20:03:16,842 ERROR Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x7fa14ffafb38>
transport: <_SelectorSocketTransport closing fd=60 read=idle write=<idle, bufsize=0>>
Traceback (most recent call last):
File «/usr/lib/python3.5/asyncio/sslproto.py», line 628, in _process_write_backlog
ssldata = self._sslpipe.shutdown(self._finalize)
File «/usr/lib/python3.5/asyncio/sslproto.py», line 151, in shutdown
raise RuntimeError(‘shutdown in progress’)
RuntimeError: shutdown in progress
2016-12-02 20:03:16,842 ERROR Fatal error on SSL transport
protocol: <asyncio.sslproto.SSLProtocol object at 0x7fa1640612b0>
transport: <_SelectorSocketTransport closing fd=61 read=idle write=<idle, bufsize=0>>
Traceback (most recent call last):
File «/usr/lib/python3.5/asyncio/sslproto.py», line 628, in _process_write_backlog
ssldata = self._sslpipe.shutdown(self._finalize)
File «/usr/lib/python3.5/asyncio/sslproto.py», line 151, in shutdown
raise RuntimeError(‘shutdown in progress’)
RuntimeError: shutdown in progress
2016-12-02 20:03:17,022 ERROR Task exception was never retrieved
future: <Task finished coro=<_delete_folder() done, defined at /home/corona/feralsync/feralsync/feral_sync.py:74> exception=TimeoutError()>
Traceback (most recent call last):
File «/usr/lib/python3.5/asyncio/tasks.py», line 241, in _step
result = coro.throw(exc)
File «/home/corona/feralsync/feralsync/feral_sync.py», line 80, in _delete_folder
await webdav.delete(remote_path)
File «/home/corona/feralsync/aioeasywebdav/aioeasywebdav/client.py», line 254, in delete
async with (await self._send(‘DELETE’, path, 204)):
File «/home/corona/feralsync/aioeasywebdav/aioeasywebdav/client.py», line 192, in _send
response = await self.session.request(method, url, allow_redirects=False, **kwargs)
File «/home/corona/feralsync/virtualenv_linux/lib/python3.5/site-packages/aiohttp/client.py», line 524, in await
resp = yield from self._coro
File «/home/corona/feralsync/virtualenv_linux/lib/python3.5/site-packages/aiohttp/client.py», line 165, in _request
conn = yield from self._connector.connect(req)
File «/home/corona/feralsync/virtualenv_linux/lib/python3.5/site-packages/async_timeout/init.py», line 44, in exit
raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError
2016-12-02 20:03:17,069 ERROR _sync_folder timeout