Skip to content
This repository was archived by the owner on Aug 3, 2023. It is now read-only.

asyncio.exceptions.TimeoutError #606

Closed
hziwei opened this issue Jul 13, 2023 · 2 comments
Closed

asyncio.exceptions.TimeoutError #606

hziwei opened this issue Jul 13, 2023 · 2 comments

Comments

@hziwei
Copy link

hziwei commented Jul 13, 2023

Traceback (most recent call last):
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 662, in await_impl
await protocol.handshake(
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 329, in handshake
raise InvalidStatusCode(status_code, response_headers)
websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 200

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 655, in await_impl_timeout
return await self.await_impl()
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 676, in await_impl
await protocol.wait_closed()
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/ecs-user/main.py", line 37, in
ddd=asyncio.run(main())
File "/home/ecs-user/anaconda3/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/home/ecs-user/anaconda3/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
return future.result()
File "/home/ecs-user/main.py", line 10, in main
async for final, data in e:
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/EdgeGPT/EdgeGPT.py", line 181, in ask_stream
async for response in self.chat_hub.ask_stream(
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/EdgeGPT/chathub.py", line 102, in ask_stream
async with connect(
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 637, in aenter
return await self
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 655, in await_impl_timeout
return await self.await_impl()
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/async_timeout.py", line 169, in aexit
self._do_exit(exc_type)
File "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/async_timeout.py", line 252, in _do_exit
raise asyncio.TimeoutError

@DrowskoytayhulGuider
Copy link

DrowskoytayhulGuider commented Jul 13, 2023

How about trying to modify the file "/home/ecs-user/anaconda3/lib/python3.9/site-packages/websockets/legacy/client.py", line 442? open_timeout: Optional[float] = 30,#10 ping_interval: Optional[float] = 20,#20 ping_timeout: Optional[float] = 30,#20 to set them bigger.

@The---onE
Copy link
Contributor

试了一下 #610 这个PR可以修复

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants