Closed sxjeru closed 2 years ago
监听 IP 换 127.0.0.1
试试?
感谢回复。两边配置文件都尝试改为 127.0.0.1 ,可惜问题依旧,报错相同。
怪怪的 我看看我的配置
mah
host: 127.0.0.1
port: 8765
enableWebsocket: true
sagiri
miraiHost: http://127.0.0.1:8765
怪欸,我debian可以正常跑()
不过咱这边的 Mirai 是跑在 docker 上的,不知道是否有关联。
有可能
我是用mcl跑的
放到本地测试,网络问题不再报错。不过运行到后面还是无法启动。
[2021-12-11 23:35:55,116][INFO]: --- setting end ---
[2021-12-11 23:35:55,116][INFO]: application has been initialized, used 0.0495s
2021-12-11 23:35:55.123 | ERROR | SAGIRIBOT.Core.AppCore:bot_launch_init:174 - Traceback (most recent call last):
File "/root/sagiri-bot-2.1.7/SAGIRIBOT/Core/AppCore.py", line 131, in bot_launch_init
await orm.create_all()
File "/root/sagiri-bot-2.1.7/SAGIRIBOT/ORM/AsyncORM.py", line 96, in create_all
async with self.engine.begin() as conn:
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/ext/asyncio/base.py", line 60, in __aenter__
return await self.start(is_ctxmanager=True)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/ext/asyncio/engine.py", line 586, in start
await self.conn.start(is_ctxmanager=is_ctxmanager)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/ext/asyncio/engine.py", line 131, in start
await (greenlet_spawn(self.sync_engine.connect))
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/util/_concurrency_py3k.py", line 136, in greenlet_spawn
result = context.switch(value)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/future/engine.py", line 406, in connect
return super(Engine, self).connect()
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 3204, in connect
return self._connection_cls(self, close_with_result=close_with_result)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 96, in __init__
else engine.raw_connection()
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 3283, in raw_connection
return self._wrap_pool_connect(self.pool.connect, _connection)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 3250, in _wrap_pool_connect
return fn()
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/pool/base.py", line 310, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/pool/base.py", line 868, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/pool/base.py", line 476, in checkout
rec = pool._do_get()
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/pool/impl.py", line 256, in _do_get
return self._create_connection()
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/pool/base.py", line 256, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/pool/base.py", line 371, in __init__
self.__connect()
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/pool/base.py", line 677, in __connect
pool.dispatch.connect.for_modify(
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/event/attr.py", line 329, in _exec_w_sync_on_first_run
self(*args, **kw)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/event/attr.py", line 343, in __call__
fn(*args, **kw)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/create.py", line 670, in on_connect
do_on_connect(dbapi_connection)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 545, in connect
fn(conn)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 528, in set_regexp
dbapi_connection.create_function(
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 189, in create_function
self._handle_exception(error)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 229, in _handle_exception
raise error
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 187, in create_function
self.await_(self._connection.create_function(*args, **kw))
AttributeError: 'Connection' object has no attribute 'create_function'
[2021-12-11 23:35:55,125][INFO]: websocket daemon: websocket connection starting...
[2021-12-11 23:35:55,202][INFO]: application shutdowned.
没用过 SQLite,问问仓库作者?
用的是 sqlite3 ,全部都在系统环境运行,没用 docker 了。
还是感谢帮助了。
试试 MySQL?(×)
虽然现阶段可能有些千奇百怪的 bug(×)
Stackoverflow 上面找到了个可能的方法,但是没用过 SQLite 所以不敢乱改源码(
config.yaml 中换用 MySQL 后可正常启动。 alembic.ini 中可使用 Sqlite 。
很奇怪,我这里使用 SQLite3 时可以正常运行。
旧版本不再支持,请尝试使用SAGIRI-BOT-Ariadne
环境信息
系统版本: Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-90-generic x86_64) 源码版本: v2.1.7 其他信息: mirai-api-http-v1.12.0
SQLite3 问题日志请见下方回复,此处网络问题已解决。
问题描述
已更换不同版本尝试多次。
mah的“setting.yml”中设置如下(部分):
"config.yaml"中设置如下:
日志
(截取报错部分)
感谢作者付出,star 已给~