Skip to content
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

无法初始化efb,Specified client not found #105

Open
NekoMirra opened this issue Feb 8, 2022 · 7 comments
Open

无法初始化efb,Specified client not found #105

NekoMirra opened this issue Feb 8, 2022 · 7 comments
Labels
question Further information is requested

Comments

@NekoMirra
Copy link

root@1092536304hax:~# ehforwarderbot
2022-02-08 02:54:09,982 [Level 99]: ehforwarderbot.main (main.init; main.py:129)
Initializing slave milkice.qq...
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs) # type: ignore # noqa
File "/usr/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection
raise exceptions[0]
File "/usr/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection
sock = await self._connect_sock(
File "/usr/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect
return await fut
File "/usr/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 8080)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/mirai_core/network.py", line 98, in post
response = await self.session.post(self.base_url + url, headers=headers, json=data)
File "/usr/local/lib/python3.9/dist-packages/aiohttp/client.py", line 520, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 535, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 892, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
transp, proto = await self._wrap_create_connection(
File "/usr/local/lib/python3.9/dist-packages/aiohttp/connector.py", line 975, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 127.0.0.1:8080 ssl:default [Connect call failed ('127.0.0.1', 8080)]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/efb_qq_slave/ClientMgr.py", line 27, in init
self.client = cls(name, config, channel)
File "/usr/local/lib/python3.9/dist-packages/efb_qq_plugin_mirai/mirai.py", line 66, in init
self.loop.run_until_complete(self.bot.handshake())
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/usr/local/lib/python3.9/dist-packages/mirai_core/bot.py", line 58, in handshake
await self.verify()
File "/usr/local/lib/python3.9/dist-packages/mirai_core/bot.py", line 65, in verify
result = await self.session.post('/verify', data={'verifyKey': self.verify_key})
File "/usr/local/lib/python3.9/dist-packages/mirai_core/network.py", line 100, in post
raise NetworkException('Unable to reach Mirai console')
mirai_core.exceptions.NetworkException: Unable to reach Mirai console

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/ehforwarderbot", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/ehforwarderbot/main.py", line 335, in main
init(conf)
File "/usr/local/lib/python3.9/dist-packages/ehforwarderbot/main.py", line 135, in init
coordinator.add_channel(cls(instance_id=instance_id))
File "/usr/local/lib/python3.9/dist-packages/efb_qq_slave/init.py", line 44, in init
self.init_client_manager()
File "/usr/local/lib/python3.9/dist-packages/efb_qq_slave/init.py", line 73, in init_client_manager
self.QQClientMgr = ClientMgr(self.config['Client'], self.config, self)
File "/usr/local/lib/python3.9/dist-packages/efb_qq_slave/ClientMgr.py", line 30, in init
raise Exception("Specified client not found!")
Exception: Specified client not found!

issues所有方法都试了一遍,还是这样。。

@milkice233
Copy link
Member

Mirai 有安装 Mirai-api-http 吗?如果有,监听在了哪个端口,可以用 netstat -lntp 看下

@NekoMirra
Copy link
Author

NekoMirra commented Feb 10, 2022 via email

@NekoMirra
Copy link
Author

NekoMirra commented Feb 10, 2022 via email

@artxia
Copy link

artxia commented Mar 28, 2022

和楼上一模一样的日志和情况。
Mirai-api-http 这边配置也和楼上一样。
Mirai 已经可以登陆并看到聊天信息的日志。
efb-qq-slave通信一直显示不能连接

@milkice233 milkice233 added the question Further information is requested label May 24, 2022
@phoenixxie0
Copy link

遇到了同样的问题。使用netstat -lntp查看到
tcp 0 0 ::ffff:127.0.0.1:8080 :::* LISTEN 192/java
但是依然连接不上。使用的是alpine的docker环境。
2022-06-29 17:02:39,928 [Level 99]: ehforwarderbot.main (main.init; main.py:129)
Initializing slave milkice.qq...
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/efb_qq_slave/ClientMgr.py", line 25, in init
c = entry_point.load()
File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 2471, in load
return self.resolve()
File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 2477, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/lib/python3.10/site-packages/efb_qq_plugin_mirai/init.py", line 1, in
from . import mirai
File "/usr/lib/python3.10/site-packages/efb_qq_plugin_mirai/mirai.py", line 16, in
from mirai_core import Bot, Updater
File "/usr/lib/python3.10/site-packages/mirai_core/init.py", line 1, in
from .bot import Bot
File "/usr/lib/python3.10/site-packages/mirai_core/bot.py", line 9, in
from .models.Types import NewFriendRequestResponse, MemberJoinRequestResponse
File "/usr/lib/python3.10/site-packages/mirai_core/models/init.py", line 1, in
from . import Message
File "/usr/lib/python3.10/site-packages/mirai_core/models/Message.py", line 7, in
from collections import MutableSequence
ImportError: cannot import name 'MutableSequence' from 'collections' (/usr/lib/python3.10/collections/init.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/ehforwarderbot", line 33, in
sys.exit(load_entry_point('ehforwarderbot==2.1.1', 'console_scripts', 'ehforwarderbot')())
File "/usr/lib/python3.10/site-packages/ehforwarderbot/main.py", line 335, in main
init(conf)
File "/usr/lib/python3.10/site-packages/ehforwarderbot/main.py", line 135, in init
coordinator.add_channel(cls(instance_id=instance_id))
File "/usr/lib/python3.10/site-packages/efb_qq_slave/init.py", line 44, in init
self.init_client_manager()
File "/usr/lib/python3.10/site-packages/efb_qq_slave/init.py", line 73, in init_client_manager
self.QQClientMgr = ClientMgr(self.config['Client'], self.config, self)
File "/usr/lib/python3.10/site-packages/efb_qq_slave/ClientMgr.py", line 30, in init
raise Exception("Specified client not found!")
Exception: Specified client not found!

@phoenixxie0
Copy link

已经找到问题,退回python3.8环境就正常了。3.10环境下
from collections import MutableSequence
要改成
from collections.abc import MutableSequence

shejialuo added a commit to shejialuo/efb-qq-slave that referenced this issue Nov 6, 2022
Now when loading the corresponding clients, it uses a `try-except` to
make sure that the specified client in the configuration file has been
installed by the user. However, there are some tricky things. The code
uses `c.load()` to load a distribution. However, the `c.load()` itself
may fail which causes exception "Specified client not found". Although
users have already installed some specified client, `c.load()` could
fail in the following situations:

+ The explicit dependency error (the client dependency doesn't require).
+ The implicit dependency (it is more tricky to deal).

However, the code just provides exception "Specified client not found"
which is not clear for users. That's why there are many issues which
talks about this exception (ehForwarderBot#105 ehForwarderBot#113 ehForwarderBot#102)

So this patch aims at providing more robust error handling which could
make users understand what really happens to make the users life easier.
@huchenz1
Copy link

同样是这个问题 只不过客户端GoCQHttp python版本3.8

配置文件如下

Client: GoCQHttp # 指定要使用的 QQ 客户端(此处为 GoCQHttp) GoCQHttp: type: HTTP # 指定 efb-qq-plugin-go-cqhttp 与 GoCQHttp 通信的方式 现阶段仅支持 HTTP access_token: api_root: http://127.0.0.1:5700/ # GoCQHttp API接口地址/端口 host: 127.0.0.1 # efb-qq-slave 所监听的地址用于接收消息 port: 8000 # 同上

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants