HibiKier / zhenxun_bot

基于 Nonebot2 开发,非常可爱的绪山真寻bot
GNU Affero General Public License v3.0
3.35k stars 605 forks source link

tortoise.exceptions.OperationalError: no such table: ban_users #1276

Closed Nenot233 closed 1 year ago

Nenot233 commented 1 year ago

系统版本:WIN10

真寻版本:0.1.6.6

错误截图

62CPF)%M3%R{(68%N4JBYYV

错误文字 02-23 15:53:43 [ERROR] nonebot | Error when running RunPreProcessors. Running cancelled! Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\tortoise\backends\sqlite\client.py", line 34, in translateexceptions return await func(self, query, *args) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\tortoise\backends\sqlite\client.py", line 141, in execute_query rows = await connection.execute_fetchall(query, values) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\aiosqlite\core.py", line 203, in execute_fetchall return await self._execute(self._execute_fetchall, sql, parameters) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\aiosqlite\core.py", line 129, in _execute return await future File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\aiosqlite\core.py", line 102, in run result = function() File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\aiosqlite\core.py", line 81, in _execute_fetchall cursor = self._conn.execute(sql, parameters) sqlite3.OperationalError: no such table: ban_users

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\nonebot\message.py", line 142, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\nonebot\message.py", line 173, in _run_matcher await asyncio.gather(*coros) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\nonebot\utils.py", line 157, in run_coro_with_catch return await coro File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\nonebot\dependencies__init.py", line 108, in call__ return await cast(Callable[..., Awaitable[R]], self.call)(**values) File "D:\BOT\zhenxun_bot\basic_plugins\hooks\authhook.py", line 21, in await AuthChecker().auth(matcher, bot, event) File "D:\BOT\zhenxun_bot\basic_plugins\hooks_utils.py", line 150, in auth await self.auth_basic(plugin_name, bot, event) File "D:\BOT\zhenxun_bot\basic_plugins\hooks_utils.py", line 467, in auth_basic or await BanUser.is_ban(event.user_id) File "D:\BOT\zhenxun_bot\models\ban_user.py", line 72, in is_ban if await cls.check_ban_time(user_qq): File "D:\BOT\zhenxun_bot\models\ban_user.py", line 52, in check_ban_time if user := await cls.filter(user_qq=user_qq).first(): File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\tortoise\queryset.py", line 1008, in _execute instance_list = await self._db.executor_class( File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\tortoise\backends\base\executor.py", line 131, in executeselect , raw_results = await self.db.execute_query(query.get_sql()) File "C:\Users\Administrator\AppData\Local\pypoetry\Cache\virtualenvs\zhenxun-bot-l9AehN_x-py3.9\lib\site-packages\tortoise\backends\sqlite\client.py", line 36, in translateexceptions raise OperationalError(exc) tortoise.exceptions.OperationalError: no such table: ban_users

更新了新版本的真寻后出现错误

Nenot233 commented 1 year ago

image 数据库配置

HibiKier commented 1 year ago

表没创建成功吗

HibiKier commented 1 year ago

用命令行和或pgadmin看看

Nenot233 commented 1 year ago

K1YEX3P 9WD62M$(@7{ 6 H

A1oneR commented 1 year ago

ubuntu 20.04 从0.1.6.3版本升级至0.1.6.6版本有相同问题

Nenot233 commented 1 year ago

已解决,是带有数据库的插件导致无法读取 新建数据库并删除该插件大概率能解决

MWTJC commented 1 year ago

本人win10,从0.1.6.6升级到0.1.6.7版本有相同问题,特征与1楼相同,即带有\site-packages\tortoise\backends\sqlite\字样且不能从错误信息判断具体报错插件,经排查,是本人自行添加的“learning_chat”插件引起,此插件确实带有sqlite数据库。另:本人删除插件后即恢复正常,未手动变更数据库。