-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPv6 not falling back to IPv4 (aiohttp upstream issue - No Happy Eyeballs support) #85
Comments
Are you connecting to a VPN with an "IPv6 killswitch"? |
I once failed to configure VPN, but then I turned off all agents in the environment variable. I am not sure if I have completely cancelled my configuration |
This seems like an IPv6 configuration issue on your end. |
Indeed, it seems aiohttp does not support Happy Eyeballs: aio-libs/aiohttp#4451 |
So should I try to turn off ipv6? |
Could you try that and let me know? |
yes,thank you for your help |
Perfect, I will see if I could work around it. In the worst case I'll consider switching to another library. |
This seems to be valid, but I have encountered a certificate issue again: aiohttp.client_ exceptions.ClientConnectorCertificateError: Cannot connect to host speech.platform.bing.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)')] |
@wanqifa Someone is hijacking your SSL connection, are you using this at a workplace? Edit, can you run this:
|
The first one can run |
@wanqifa I mean can you share the output? |
[root@localhost ~]# curl -4vvvv https://speech.platform.bing.com
< HTTP/1.1 400 Bad Request
Our services aren't available right nowWe're working to restore all services as soon as possible. Please check back soon. 0O2JaZAAAAADeWVAa6FhpQ4kUKczxXQDrU0cxRURHRTAzMjEARWRnZQ==[root@localhost ~]# curl -6vvvv https://speech.platform.bing.com
|
@wanqifa Thank you, my understanding is that the SSL error only happens sometimes; right? |
Since I started using edge-tts, this function has not been successful. |
I use vim /opt/python3/lib/python3.9/site-packages/edge_tts/communicate.py26 from aiohttp import TCPConnector 305 async with aiohttp.ClientSession( |
I have tried this before, but it failed. I will try your method again |
This is useful, thank you very much !!!!!!!!!!!! |
I'm going to implement this but why did you disable SSL verification? |
Perhaps the SSL certificate validation error was caused by invalid certificates in certain systems or Python versions. I have found similar issues in the issues section of aiohttp before. |
Should be resolved by 8f8a334 |
Fixed upstream since at least aiohttp 3.10.0 |
When I tried to run 'edge tts -- text' Hello, world '-- write media hello. mp3', this error occurred.
I believe this is my own reason, but I cannot solve it.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 980, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1070, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1054, in create_connection
sock = await self._connect_sock(
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 963, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 501, in sock_connect
return await fut
File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 541, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('2620:1ec:c11::237', 443, 0, 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/edge-tts", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/edge_tts/util.py", line 136, in main
loop.run_until_complete(_async_main())
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/usr/local/lib/python3.10/site-packages/edge_tts/util.py", line 129, in _async_main
await _run_tts(args)
File "/usr/local/lib/python3.10/site-packages/edge_tts/util.py", line 65, in _run_tts
async for chunk in tts.stream():
File "/usr/local/lib/python3.10/site-packages/edge_tts/communicate.py", line 305, in stream
async with aiohttp.ClientSession(
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 1141, in aenter
self._resp = await self._coro
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 779, in _ws_connect
resp = await self.request(
File "/usr/local/lib/python3.10/site-packages/aiohttp/client.py", line 536, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1206, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/usr/local/lib/python3.10/site-packages/aiohttp/connector.py", line 988, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host speech.platform.bing.com:443 ssl:default [Connect call failed ('2620:1ec:c11::237', 443, 0, 0)]
The text was updated successfully, but these errors were encountered: