08-26 18:57:13 [ERROR] uvicorn | Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-xRHTbRVY-py3.10/lib/python3.10/site-packages/tortoise/backends/asyncpg/client.py", line 82, in _translate_exceptions
return await func(self, *args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-xRHTbRVY-py3.10/lib/python3.10/site-packages/tortoise/backends/asyncpg/client.py", line 136, in execute_query
res = await connection.execute(*params)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-xRHTbRVY-py3.10/lib/python3.10/site-packages/asyncpg/connection.py", line 350, in execute
result = await self._protocol.query(query, timeout)
File "asyncpg/protocol/protocol.pyx", line 374, in query
asyncpg.exceptions.UndefinedFunctionError: operator does not exist: character varying = integer
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-xRHTbRVY-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 732, in lifespan
async with self.lifespan_context(app) as maybe_state:
File "/usr/python/lib/python3.10/contextlib.py", line 199, in __aenter__
return await anext(self.gen)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-xRHTbRVY-py3.10/lib/python3.10/site-packages/nonebot/drivers/fastapi.py", line 153, in _lifespan_manager
await self._lifespan.startup()
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-xRHTbRVY-py3.10/lib/python3.10/site-packages/nonebot/internal/driver/_lifespan.py", line 42, in startup
await self._run_lifespan_func(self._startup_funcs)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-xRHTbRVY-py3.10/lib/python3.10/site-packages/nonebot/internal/driver/_lifespan.py", line 36, in _run_lifespan_func
await cast(ASYNC_LIFESPAN_FUNC, func)()
File "/home/zhenxun_bot-main/zhenxun/builtin_plugins/__init__.py", line 55, in _
await GoodsInfo.bulk_update(goods_list, ["uuid"], 10)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-xRHTbRVY-py3.10/lib/python3.10/site-packages/tortoise/queryset.py", line 1748, in _execute
count += (await self._db.execute_query(str(query)))[0]
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-xRHTbRVY-py3.10/lib/python3.10/site-packages/tortoise/backends/base_postgres/client.py", line 34, in _translate_exceptions
return await self._translate_exceptions(func, *args, **kwargs)
File "/root/.cache/pypoetry/virtualenvs/zhenxun-bot-xRHTbRVY-py3.10/lib/python3.10/site-packages/tortoise/backends/asyncpg/client.py", line 84, in _translate_exceptions
raise OperationalError(exc)
tortoise.exceptions.OperationalError: operator does not exist: character varying = integer
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.
08-26 18:57:13 [ERROR] uvicorn | Application startup failed. Exiting.
在zhenxun/builtin_plugins/__init__.py中的55行
@driver.on_startup
async def _():
"""签到与用户的数据迁移"""
if goods_list := await GoodsInfo.filter(uuid__isnull=True).all():
for goods in goods_list:
goods.uuid = uuid.uuid1() # type: ignore
await GoodsInfo.bulk_update(goods_list, ["uuid"], 10)
在
zhenxun/builtin_plugins/__init__.py
中的55行我看
GoodsInfo
是没有bulk_update
这个函数的,如果注释掉就能跑了