noneplugin / nonebot-plugin-memes-api

nonebot-plugin-memes 调用 api 版本
MIT License
12 stars 1 forks source link

使用时遇到错误 #1

Closed babynanxi closed 1 year ago

babynanxi commented 1 year ago

meme-generator已经正常运行且可以访问文档 api无法连接 使用默认配置文件 端口无占用 nonebot报错: Task exception was never retrieved future: <Task finished name='Task-6' coro=<init() done, defined at /root/.cache/pypoetry/virtualenvs/littlepaimon-dKYaLa2Z-py3.9/lib/python3.9/site-packages/nonebot_plugin_memes_api/__init__.py:410> exception=TypeError("'NoneType' object is not iterable")> Traceback (most recent call last): File "/root/.cache/pypoetry/virtualenvs/littlepaimon-dKYaLa2Z-py3.9/lib/python3.9/site-packages/nonebot_plugin_memes_api/__init__.py", line 411, in init await meme_manager.init() File "/root/.cache/pypoetry/virtualenvs/littlepaimon-dKYaLa2Z-py3.9/lib/python3.9/site-packages/nonebot_plugin_memes_api/manager.py", line 51, in init sorted(meme_keys, key=lambda meme_key: meme_key), TypeError: 'NoneType' object is not iterable

MeetWq commented 1 year ago

检查连接是否正常 正常情况下 memes-api 启动时 meme-generator 会收到一堆请求,类似这样: Snipaste_2023-03-26_14-07-16

babynanxi commented 1 year ago

没有请求 只在访问docs时有 我的系统是Ubuntu 22.04.1

MeetWq commented 1 year ago

你的 meme-generator 和 memes-api 跑在一个地方吗? 如果不是 需要修改 meme_generator_base_url 配置

babynanxi commented 1 year ago

是本地的 bot和meme-generator在同一个设备 但是不在同一个环境 bot是使用的虚拟环境 meme-generator是使用的本地环境

MeetWq commented 1 year ago

你这个结果很奇怪,我没法复现 能否提供更多的信息?

MeetWq commented 1 year ago

meme-generator 和 memes-api 分别是什么版本

babynanxi commented 1 year ago

好的 我重新复现一下 nonebot_plugin_memes_api-0.1.0 meme_generator in /usr/local/lib/python3.9/site-packages (0.0.7) ` 先启动meme

image 再启动bot

03-26 21:04:58 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_memes_api" image 使用bot查看表情列表时也是空白

babynanxi commented 1 year ago

image

babynanxi commented 1 year ago

meme_generator也是无输出

babynanxi commented 1 year ago

我将nonebot_plugin_memes_api使用pip安装在bot.py中引入与使用nb 安装的结果是一样的

babynanxi commented 1 year ago

以下是bot启动日志 我省去了其他插件的列表 `root@nanxi:/storage/bot/LittlePaimon# poetry run python bot.py 03-26 21:14:39 [SUCCESS] nonebot | NoneBot is initializing... 03-26 21:14:39 [INFO] nonebot | Current Env: prod

03-26 21:14:44 [SUCCESS] nonebot | Succeeded to import "nonebot_plugin_memes_api"

03-26 21:15:00 [WARNING] main | Always use nb run to start the bot instead of manually running! 03-26 21:15:00 [SUCCESS] nonebot | Running NoneBot... 03-26 21:15:00 [INFO] uvicorn | Started server process [1048837] 03-26 21:15:00 [INFO] uvicorn | Waiting for application startup. 03-26 21:15:00 [INFO] nonebot_plugin_datastore | 数据库初始化完成 03-26 21:15:00 [INFO] nonebot_plugin_apscheduler | Scheduler Started 03-26 21:15:00 [SUCCESS] nonebot_plugin_tortoise_orm | 数据库: 连接成功 03-26 21:15:01 [INFO] nonebot_plugin_htmlrender | 使用 chromium 启动 03-26 21:15:01 [INFO] nonebot_plugin_htmlrender | Browser Started. 03-26 21:15:01 [INFO] LittlePaimon | Scheduler Started Task exception was never retrieved future: <Task finished name='Task-4' coro=<init() done, defined at /root/.cache/pypoetry/virtualenvs/littlepaimon-dKYaLa2Z-py3.9/lib/python3.9/site-packages/nonebot_plugin_memes_api/init.py:410> exception=TypeError("'NoneType' object is not iterable")> Traceback (most recent call last): File "/root/.cache/pypoetry/virtualenvs/littlepaimon-dKYaLa2Z-py3.9/lib/python3.9/site-packages/nonebot_plugin_memes_api/init.py", line 411, in init await meme_manager.init() File "/root/.cache/pypoetry/virtualenvs/littlepaimon-dKYaLa2Z-py3.9/lib/python3.9/site-packages/nonebot_plugin_memes_api/manager.py", line 51, in init sorted(meme_keys, key=lambda meme_key: meme_key), TypeError: 'NoneType' object is not iterable 03-26 21:15:01 [INFO] LittlePaimon | [Web UI]启用成功,默认地址为http://127.0.0.1:13579/LittlePaimon/login 03-26 21:15:01 [INFO] LittlePaimon | ██╗ ██╗████████╗████████╗██╗ ███████╗ ██████╗ █████╗ ██╗███╗ ███╗ ██████╗ ███╗ ██╗ ██║ ██║╚══██╔══╝╚══██╔══╝██║ ██╔════╝ ██╔══██╗██╔══██╗██║████╗ ████║██╔═══██╗████╗ ██║ ██║ ██║ ██║ ██║ ██║ █████╗ ██████╔╝███████║██║██╔████╔██║██║ ██║██╔██╗ ██║ ██║ ██║ ██║ ██║ ██║ ██╔══╝ ██╔═══╝ ██╔══██║██║██║╚██╔╝██║██║ ██║██║╚██╗██║ ███████╗██║ ██║ ██║ ███████╗███████╗ ██║ ██║ ██║██║██║ ╚═╝ ██║╚██████╔╝██║ ╚████║ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ 03-26 21:15:01 [SUCCESS] LittlePaimon | [数据库]连接成功 03-26 21:15:02 [SUCCESS] LittlePaimon | [插件管理器]初始化完成 03-26 21:15:02 [INFO] LittlePaimon | [资源检查]开始检查资源 03-26 21:15:03 [INFO] LittlePaimon | [Playwright]浏览器初始化成功 03-26 21:15:03 [INFO] LittlePaimon | [原神日历]订阅数量共3个加载成功 03-26 21:15:03 [SUCCESS] LittlePaimon | [60秒读世界]订阅数量共4个加载成功 `

MeetWq commented 1 year ago

换个端口试试?

AF5656 commented 1 year ago

换个端口试试?

遇到类似的情况,换一个端口解决了