anyidea / chatgpt-dingtalk-bot

Integrate browser-based ChatGPT with dingtalk chatbot.
MIT License
42 stars 1 forks source link

运行一段时间之后为发消息无反应 #24

Closed Timoshao closed 1 year ago

Timoshao commented 1 year ago

Description

运行一段事件,发消息无反应。发送‘帮助’也无法应。 后台报错如下,不清楚是否有影响: 2023-07-08T08:25:26.082144999Z 2023-07-08T08:25:26.082267336Z Traceback (most recent call last): 2023-07-08T08:25:26.082642865Z File "/usr/local/lib/python3.11/logging/init.py", line 1110, in emit 2023-07-08T08:25:26.082655135Z msg = self.format(record) 2023-07-08T08:25:26.082660293Z ^^^^^^^^^^^^^^^^^^^ 2023-07-08T08:25:26.082736121Z File "/usr/local/lib/python3.11/logging/init.py", line 953, in format 2023-07-08T08:25:26.082746745Z return fmt.format(record) 2023-07-08T08:25:26.082751747Z ^^^^^^^^^^^^^^^^^^ 2023-07-08T08:25:26.082874651Z File "/usr/local/lib/python3.11/logging/init.py", line 687, in format 2023-07-08T08:25:26.082893697Z record.message = record.getMessage() 2023-07-08T08:25:26.082904459Z ^^^^^^^^^^^^^^^^^^^ 2023-07-08T08:25:26.083018617Z File "/usr/local/lib/python3.11/logging/init.py", line 377, in getMessage 2023-07-08T08:25:26.083034857Z msg = msg % self.args 2023-07-08T08:25:26.083043072Z ~~^~~~~ 2023-07-08T08:25:26.083153333Z TypeError: not all arguments converted during string formatting 2023-07-08T08:25:26.083254765Z Call stack: 2023-07-08T08:25:26.083811341Z File "", line 198, in _run_module_as_main 2023-07-08T08:25:26.083901852Z File "", line 88, in _run_code 2023-07-08T08:25:26.083973384Z File "/app/chatbot/main.py", line 3, in 2023-07-08T08:25:26.083983824Z main() 2023-07-08T08:25:26.084045627Z File "/app/chatbot/main.py", line 134, in main 2023-07-08T08:25:26.084055568Z client.start_forever() 2023-07-08T08:25:26.084146068Z File "/app/.venv/lib/python3.11/site-packages/dingtalk_stream/stream.py", line 122, in start_forever 2023-07-08T08:25:26.084158285Z self.logger.exception('unknown exception', e) 2023-07-08T08:25:26.084242027Z Message: 'unknown exception' 2023-07-08T08:25:26.084254279Z Arguments: (UnboundLocalError("cannot access local variable 'http_body' where it is not associated with a value"),) 2023-07-08T08:25:26.085146428Z 2023-07-08 08:25:26,084 dingtalk_stream.client INFO open connection, url=https://api.dingtalk.com/v1.0/gateway/connections/open [stream.py:127] 2023-07-08T08:25:39.179414451Z 2023-07-08 08:25:39,177 dingtalk_stream.client INFO endpoint is {'endpoint': 'wss://wss-open-connection.dingtalk.com:443/connect', 'ticket': '04e7f82f-1d69-11ee-96ff-fe5918767f98'} [stream.py:69] 2023-07-08T08:25:57.208747417Z --- Logging error --- 2023-07-08T08:25:57.210372606Z Traceback (most recent call last): 2023-07-08T08:25:57.211123660Z File "/app/.venv/lib/python3.11/site-packages/websockets/legacy/client.py", line 655, in await_impl_timeout 2023-07-08T08:25:57.211137755Z return await self.await_impl() 2023-07-08T08:25:57.211143318Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-07-08T08:25:57.211253753Z File "/app/.venv/lib/python3.11/site-packages/websockets/legacy/client.py", line 659, in await_impl 2023-07-08T08:25:57.211277188Z _transport, _protocol = await self._create_connection() 2023-07-08T08:25:57.211283227Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-07-08T08:25:57.211365177Z File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1045, in create_connection 2023-07-08T08:25:57.211376298Z infos = await self._ensure_resolved( 2023-07-08T08:25:57.211381344Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-07-08T08:25:57.211456470Z File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1419, in _ensure_resolved 2023-07-08T08:25:57.211470012Z return await loop.getaddrinfo(host, port, family=family, type=type, 2023-07-08T08:25:57.211478903Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-07-08T08:25:57.211627377Z File "/usr/local/lib/python3.11/asyncio/base_events.py", line 867, in getaddrinfo 2023-07-08T08:25:57.211640857Z return await self.run_in_executor( 2023-07-08T08:25:57.211645834Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-07-08T08:25:57.211762556Z asyncio.exceptions.CancelledError 2023-07-08T08:25:57.211933691Z 2023-07-08T08:25:57.211961090Z The above exception was the direct cause of the following exception: 2023-07-08T08:25:57.211971489Z 2023-07-08T08:25:57.212078158Z Traceback (most recent call last): 2023-07-08T08:25:57.212615006Z File "/app/.venv/lib/python3.11/site-packages/dingtalk_stream/stream.py", line 114, in start_forever 2023-07-08T08:25:57.212631705Z asyncio.run(self.start()) 2023-07-08T08:25:57.212722929Z File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run 2023-07-08T08:25:57.212734189Z return runner.run(main) 2023-07-08T08:25:57.212739167Z ^^^^^^^^^^^^^^^^ 2023-07-08T08:25:57.212812649Z File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run 2023-07-08T08:25:57.212823221Z return self._loop.run_until_complete(task) 2023-07-08T08:25:57.212828299Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-07-08T08:25:57.212933325Z File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete 2023-07-08T08:25:57.212956871Z return future.result() 2023-07-08T08:25:57.212962870Z ^^^^^^^^^^^^^^^ 2023-07-08T08:25:57.213041774Z File "/app/.venv/lib/python3.11/site-packages/dingtalk_stream/stream.py", line 72, in start 2023-07-08T08:25:57.213069333Z async with websockets.connect(uri) as websocket: 2023-07-08T08:25:57.213144876Z File "/app/.venv/lib/python3.11/site-packages/websockets/legacy/client.py", line 637, in aenter 2023-07-08T08:25:57.213155640Z return await self 2023-07-08T08:25:57.213160633Z ^^^^^^^^^^ 2023-07-08T08:25:57.213232529Z File "/app/.venv/lib/python3.11/site-packages/websockets/legacy/client.py", line 654, in await_impl_timeout 2023-07-08T08:25:57.213243191Z async with asyncio_timeout(self.open_timeout): 2023-07-08T08:25:57.213315347Z File "/usr/local/lib/python3.11/asyncio/timeouts.py", line 111, in aexit 2023-07-08T08:25:57.213325752Z raise TimeoutError from exc_val 2023-07-08T08:25:57.213408225Z TimeoutError 2023-07-08T08:25:57.213493147Z 2023-07-08T08:25:57.213503510Z During handling of the above exception, another exception occurred: 2023-07-08T08:25:57.213508649Z 2023-07-08T08:25:57.213595089Z Traceback (most recent call last): 2023-07-08T08:25:57.213991282Z File "/usr/local/lib/python3.11/logging/init.py", line 1110, in emit 2023-07-08T08:25:57.214003437Z msg = self.format(record) 2023-07-08T08:25:57.214008644Z ^^^^^^^^^^^^^^^^^^^ 2023-07-08T08:25:57.214085191Z File "/usr/local/lib/python3.11/logging/init.py", line 953, in format 2023-07-08T08:25:57.214095853Z return fmt.format(record) 2023-07-08T08:25:57.214100828Z ^^^^^^^^^^^^^^^^^^ 2023-07-08T08:25:57.214173177Z File "/usr/local/lib/python3.11/logging/init.py", line 687, in format 2023-07-08T08:25:57.214183823Z record.message = record.getMessage() 2023-07-08T08:25:57.214188824Z ^^^^^^^^^^^^^^^^^^^ 2023-07-08T08:25:57.214261311Z File "/usr/local/lib/python3.11/logging/init.py", line 377, in getMessage 2023-07-08T08:25:57.214271923Z msg = msg % self.args 2023-07-08T08:25:57.214276826Z ~~^~~~~ 2023-07-08T08:25:57.214356892Z TypeError: not all arguments converted during string formatting 2023-07-08T08:25:57.214459873Z Call stack: 2023-07-08T08:25:57.215508889Z File "", line 198, in _run_module_as_main 2023-07-08T08:25:57.215766485Z File "", line 88, in _run_code 2023-07-08T08:25:57.215907445Z File "/app/chatbot/main.py", line 3, in 2023-07-08T08:25:57.215926569Z main() 2023-07-08T08:25:57.216057660Z File "/app/chatbot/main.py", line 134, in main 2023-07-08T08:25:57.216075408Z client.start_forever() 2023-07-08T08:25:57.216185510Z File "/app/.venv/lib/python3.11/site-packages/dingtalk_stream/stream.py", line 122, in start_forever 2023-07-08T08:25:57.216203245Z self.logger.exception('unknown exception', e) 2023-07-08T08:25:57.216373869Z Message: 'unknown exception' 2023-07-08T08:25:57.216391212Z Arguments: (TimeoutError(),) 2023-07-08T08:25:57.217825407Z 2023-07-08 08:25:57,217 dingtalk_stream.client INFO open connection, url=https://api.dingtalk.com/v1.0/gateway/connections/open [stream.py:127]

Timoshao commented 1 year ago

重启之后又正常

yandaty commented 1 year ago

我也试过一次,突然无反应了,不过我没查看日志,直接重启就行了

Timoshao commented 1 year ago

又又遇到了,大佬抽时间看下什么问题吧

anyidea commented 1 year ago

这个应该是钉钉stream服务异常,重启下就好了