Skip to content

数据无法迁移 #67

@luoyu-lty

Description

@luoyu-lty

PS C:\luoyu\NoneBot\nonebot_qq> nb orm upgrade
使用 Python: C:\luoyu\NoneBot\nonebot_qq.venv\Scripts\python.exe
01-12 03:26:05 [SUCCESS] nonebot | NoneBot is initializing...
01-12 03:26:05 [INFO] nonebot | Current Env: prod
01-12 03:26:05 [SUCCESS] nonebot | Succeeded to load plugin "echo" from "nonebot.plugins.echo"
01-12 03:26:05 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_alconna:uniseg" from "nonebot_plugin_alconna.uniseg"
01-12 03:26:06 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_alconna"
01-12 03:26:06 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_uninfo"
01-12 03:26:06 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_localstore"
01-12 03:26:07 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_session"
01-12 03:26:07 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_zxwb"
01-12 03:26:07 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_questionmark"
01-12 03:26:07 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_apscheduler"
01-12 03:26:07 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_water_geoup_stats"
01-12 03:26:07 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_color_see_see"
01-12 03:26:07 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_waiter"
01-12 03:26:08 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_htmlrender"
01-12 03:26:08 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_akinator"
01-12 03:26:08 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_apscheduler"
01-12 03:26:09 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_saa"
01-12 03:26:10 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_saalc"
01-12 03:26:15 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_orm"
01-12 03:26:15 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_chatrecorder"
01-12 03:26:15 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_localstore"
01-12 03:26:16 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_handle"
01-12 03:26:16 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_number_detection"
01-12 03:26:16 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_abbrreply"
01-12 03:26:16 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_datastore"
01-12 03:26:16 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_wife"
01-12 03:26:16 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_maze"
01-12 03:26:16 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_emojimix"
01-12 03:26:17 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_tortoise_orm"
01-12 03:26:17 [SUCCESS] nonebot_plugin_tortoise_orm | 数据库: 添加模型: nonebot_plugin_setu_now.database
01-12 03:26:17 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_setu_now"
01-12 03:26:17 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_repesix"
01-12 03:26:17 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_cave"
01-12 03:26:17 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_bread_shop"
01-12 03:26:17 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_htmlrender"
01-12 03:26:17 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_userinfo"
01-12 03:26:17 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_abstract"
01-12 03:26:17 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_envious"
pokepoke_miss is running!
01-12 03:26:17 [SUCCESS] nonebot | Succeeded to load plugin "pokepoke_miss"
01-12 03:26:17 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_remake"
01-12 03:26:18 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_og"
01-12 03:26:18 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_fhl"
01-12 03:26:18 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_today_waifu"
01-12 03:26:18 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_boardgame"
01-12 03:26:18 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_uninfo"
01-12 03:26:18 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_alchelper"
01-12 03:26:18 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_cesaa"
01-12 03:26:20 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_wordcloud"
01-12 03:26:20 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_analysis_bilibili"
01-12 03:26:21 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_kawaii_status"
01-12 03:26:21 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_saa"
01-12 03:26:21 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_soup"
01-12 03:26:21 [SUCCESS] nonebot_plugin_clovers | nonebot.adapters.onebot.v11 加载成功!
01-12 03:26:21 [ERROR] nonebot_plugin_clovers | nonebot.adapters.qq 加载失败...
01-12 03:26:21 [ERROR] nonebot_plugin_clovers | nonebot.adapters.satori 加载失败...
01-12 03:26:21 [INFO] clovers | 【loading plugin】 clovers_setu_collection ...
01-12 03:26:21 [INFO] clovers | clovers_setu_collection 加载成功
01-12 03:26:21 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_setu_collection"
01-12 03:26:21 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_bracket"
01-12 03:26:21 [INFO] clovers | 【loading plugin】 clovers_apscheduler ...
01-12 03:26:21 [INFO] clovers | clovers_apscheduler 加载成功
01-12 03:26:21 [INFO] clovers | 【loading plugin】 clovers_leafgame ...
01-12 03:26:21 [INFO] clovers | 【loading plugin】 clovers_leafgame.modules.account ...
01-12 03:26:24 [INFO] clovers | 【loading plugin】 clovers_leafgame.modules.game ...
01-12 03:26:24 [INFO] clovers_leafgame | 加载事件文件:Stand.json 成功!
01-12 03:26:24 [INFO] clovers_leafgame | 加载事件文件:“日常,真的很日常”.json 成功!
01-12 03:26:24 [INFO] clovers_leafgame | 加载事件文件:克苏鲁.json 成功!
01-12 03:26:24 [INFO] clovers_leafgame | 加载事件文件:基础事件.json 成功!
01-12 03:26:24 [INFO] clovers_leafgame | 加载事件文件:复刻经典事件集合v1.json 成功!
01-12 03:26:24 [INFO] clovers_leafgame | 加载事件文件:崩坏集合v1.json 成功!
01-12 03:26:24 [INFO] clovers_leafgame | 加载事件文件:群友日常.json 成功!
01-12 03:26:24 [INFO] clovers_leafgame | 加载事件文件:芜湖事件合集.json 成功!
01-12 03:26:24 [INFO] clovers_leafgame | 加载事件文件:赫尔事件集v1.json 成功!
01-12 03:26:24 [INFO] clovers_leafgame | 加载事件文件:赫尔的赛马场事件簿.json 成功!
01-12 03:26:24 [INFO] clovers | 【loading plugin】 clovers_leafgame.modules.market ...
01-12 03:26:24 [INFO] clovers | 【loading plugin】 clovers_leafgame.modules.prop ...
01-12 03:26:24 [INFO] clovers | 【loading plugin】 clovers_leafgame.modules.ranklist ...
01-12 03:26:25 [INFO] clovers | 【loading plugin】 clovers_leafgame.modules.task ...
01-12 03:26:25 [INFO] clovers | clovers_leafgame 加载成功
01-12 03:26:26 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_game_collection"
01-12 03:26:27 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_alconna"
01-12 03:26:28 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_jrrp2"
C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\nonebot_plugin_alconna\matcher.py:208: UserWarning: Shortcut Key should not start with '^', otherwise it will ignore the prefix automatically.
cls.command().shortcut(key, args, **kwargs) # type: ignore
01-12 03:26:28 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_whateat_pic"
01-12 03:26:32 [SUCCESS] nonebot | Succeeded to load plugin "deepseek_ai" from "nonebot_qq.plugins.deepseek_ai"
01-12 03:26:35 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_impart"
01-12 03:26:35 [WARNING] nonebot_plugin_random_stereotypes | Cannot construct meme generator, will disable meme feature
01-12 03:26:36 [WARNING] nonebot_plugin_random_stereotypes | Cannot find usable meme source, consider running pip install nonebot-plugin-random-stereotypes[meme] to use embed source
01-12 03:26:36 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_random_stereotypes"
01-12 03:26:36 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_emojilike"
01-12 03:26:36 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_fishing"
01-12 03:26:36 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_dog"
C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\fuzzywuzzy\fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
01-12 03:26:37 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_PicMenu"
01-12 03:26:37 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_mypower"
01-12 03:26:37 [SUCCESS] nonebot | Succeeded to load plugin "nonebot_plugin_tortoise_orm"
Traceback (most recent call last):
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\script\base.py", line 254, in _catch_revision_errors
yield
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\script\base.py", line 462, in _upgrade_revs
for script in reversed(list(revs))
~~~~^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\script\revision.py", line 814, in iterate_revisions
revisions, heads = fn(
~~^
upper,
^^^^^^
...<3 lines>...
assert_relative_length=assert_relative_length,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\script\revision.py", line 1475, in collect_upgrade_revisions
current_revisions = self.get_revisions(lower)
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\script\revision.py", line 542, in get_revisions
return sum([self.get_revisions(id_elem) for id_elem in id
], ())
~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\script\revision.py", line 565, in get_revisions
return tuple(
self._revision_for_ident(rev_id, branch_label)
for rev_id in resolved_id
)
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\script\revision.py", line 566, in
self._revision_for_ident(rev_id, branch_label)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\script\revision.py", line 637, in _revision_for_ident
raise ResolutionError(
...<11 lines>...
)
alembic.script.revision.ResolutionError: No such revision or branch '2e0c173949d3'

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

Traceback (most recent call last):
File "", line 29, in
e.load()()
~~~~~~~~^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\nonebot_plugin_orm_main_.py", line 283, in main
orm(*args, **kwargs)
~~~^^^^^^^^^^^^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\click\core.py", line 1161, in call
return self.main(*args, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\click\core.py", line 1082, in main
rv = self.invoke(ctx)
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\click\core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\click\core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\click\core.py", line 788, in invoke
return callback(*args, **kwargs)
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\click\decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\nonebot_plugin_orm_main
.py", line 86, in wrapper
return f(ctx.obj, *args, **kwargs)
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\nonebot_plugin_orm_main
.py", line 175, in upgrade
return migrate.upgrade(*args, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\nonebot_plugin_orm\migrate.py", line 662, in upgrade
script.run_env()
~~~~~~~~~~~~~~^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\script\base.py", line 586, in run_env
util.load_python_file(self.dir, "env.py")
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\util\pyfiles.py", line 95, in load_python_file
module = load_module_py(module_id, path)
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\util\pyfiles.py", line 113, in load_module_py
spec.loader.exec_module(module) # type: ignore
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "", line 1026, in exec_module
File "", line 488, in _call_with_frames_removed
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\nonebot_plugin_orm\templates\generic\env.py", line 88, in
asyncio.run(coro)
~~~~~~~~~~~^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python313\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
~~~~~~~~~~^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python313\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python313\Lib\asyncio\base_events.py", line 720, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\nonebot_plugin_orm\templates\generic\env.py", line 79, in run_migrations_online
await connection.run_sync(do_run_migrations)
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\sqlalchemy\ext\asyncio\engine.py", line 887, in run_sync
return await greenlet_spawn(
^^^^^^^^^^^^^^^^^^^^^
fn, self._proxied, *arg, _require_await=False, **kw
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\sqlalchemy\util_concurrency_py3k.py", line 203, in greenlet_spawn
result = context.switch(value)
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\nonebot_plugin_orm\templates\generic\env.py", line 69, in do_run_migrations
context.run_migrations()
~~~~~~~~~~~~~~~~~~~~~~^^
File "", line 8, in run_migrations
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\runtime\environment.py", line 946, in run_migrations
self.get_context().run_migrations(**kw)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\runtime\migration.py", line 611, in run_migrations
for step in self._migrations_fn(heads, self):
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\nonebot_plugin_orm\migrate.py", line 650, in upgrade
yield from script._upgrade_revs(revision, rev)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\script\base.py", line 450, in _upgrade_revs
with self._catch_revision_errors(
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
ancestor="Destination %(end)s is not a valid upgrade "
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"target from current head(s)",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
end=destination,
^^^^^^^^^^^^^^^^
):
^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python313\Lib\contextlib.py", line 162, in exit
self.gen.throw(value)
~~~~~~~~~~~~~~^^^^^^^
File "C:\luoyu\NoneBot\nonebot_qq.venv\Lib\site-packages\alembic\script\base.py", line 286, in _catch_revision_errors
raise util.CommandError(resolution) from re
alembic.util.exc.CommandError: Can't locate revision identified by '2e0c173949d3'
PS C:\luoyu\NoneBot\nonebot_qq>

我不知到这个2e0c173949d3 是什么,卸载这个插件就没有这个报错(但是有很多插件依赖这个)再装回去就又有这个报错了

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions