Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: plugin-managerbotsundefined #683

Closed
Tracked by #725
ilharp opened this issue May 16, 2022 · 3 comments
Closed
Tracked by #725

Bug: plugin-managerbotsundefined #683

ilharp opened this issue May 16, 2022 · 3 comments
Milestone

Comments

@ilharp
Copy link
Member

ilharp commented May 16, 2022

Describe the bug

启动时和打开控制台页面时报错,同时控制台机器人页面永远加载

报错
2022-05-16 18:32:50 [W] app TypeError: Cannot read properties of undefined (reading 'bots')
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:67:59)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:86:69)
                            at Array.map (<anonymous>)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:86:59)
                            at BotList.map (<anonymous>)
                            at BotProvider.get (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:85:72)
                            at BotProvider.refresh (/files/proj/harperneko/node_modules/@koishijs/plugin-console/src/service.ts:42:39)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:62:12)
                            at App.parallel (/files/proj/harperneko/node_modules/@koishijs/core/src/context.ts:350:43)
                            at App.emit (/files/proj/harperneko/node_modules/@koishijs/core/src/context.ts:360:10)
2022-05-16 18:32:50 [W] app TypeError: Cannot read properties of undefined (reading 'bots')
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:67:59)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:86:69)
                            at Array.map (<anonymous>)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:86:59)
                            at BotList.map (<anonymous>)
                            at BotProvider.get (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:85:72)
                            at BotProvider.refresh (/files/proj/harperneko/node_modules/@koishijs/plugin-console/src/service.ts:42:39)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:52:35)
                            at processTicksAndRejections (node:internal/process/task_queues:78:11)
2022-05-16 18:32:50 [W] stats TypeError: bot.getGuildList is not a function
                            at null.getGuildInfo (/files/proj/harperneko/node_modules/@koishijs/plugin-status/src/stats.ts:247:32)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-status/src/stats.ts:266:13)
                            at BotList.map (<anonymous>)
                            at null.extendGuilds (/files/proj/harperneko/node_modules/@koishijs/plugin-status/src/stats.ts:264:37)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-status/src/stats.ts:296:48)
                            at Array.map (<anonymous>)
                            at _StatisticsProvider.download (/files/proj/harperneko/node_modules/@koishijs/plugin-status/src/stats.ts:296:38)
                            at processTicksAndRejections (node:internal/process/task_queues:96:5)
                            at _StatisticsProvider.refresh (/files/proj/harperneko/node_modules/@koishijs/plugin-console/src/service.ts:42:28)
2022-05-16 18:32:51 [W] app TypeError: Cannot read properties of undefined (reading 'bots')
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:67:59)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:86:69)
                            at Array.map (<anonymous>)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:86:59)
                            at BotList.map (<anonymous>)
                            at BotProvider.get (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:85:72)
                            at BotProvider.refresh (/files/proj/harperneko/node_modules/@koishijs/plugin-console/src/service.ts:42:39)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:62:12)
                            at App.parallel (/files/proj/harperneko/node_modules/@koishijs/core/src/context.ts:350:43)
                            at App.emit (/files/proj/harperneko/node_modules/@koishijs/core/src/context.ts:360:10)
2022-05-16 18:32:58 [W] app TypeError: Cannot read properties of undefined (reading 'bots')
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:67:59)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:86:69)
                            at Array.map (<anonymous>)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:86:59)
                            at BotList.map (<anonymous>)
                            at BotProvider.get (/files/proj/harperneko/node_modules/@koishijs/plugin-manager/src/bots.ts:85:72)
                            at null.<anonymous> (/files/proj/harperneko/node_modules/@koishijs/plugin-console/src/socket.ts:35:35)
                            at runMicrotasks (<anonymous>)
                            at processTicksAndRejections (node:internal/process/task_queues:96:5)

Steps to reproduce

  1. 像这样配置 bots:
plugins:
  adapter-kaiheila:
    bots:
      - protocol: ws
        token: '1/AaAaaa=/AAAAaaAaAAAAAaaaaaAAAaaA=='
  adapter-onebot:
    bots:
      - protocol: ws
        selfId: '10010'
        endpoint: ws://127.0.0.1:8000
  1. 安装世界上所有的插件并重启 Koishi

Expected behavior

控制台正常显示

Versions

# uname -a
Linux VM-4-12-ubuntu 5.4.0-77-generic #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
# node -v
v16.13.1
# yarn koishi -v
yarn run v1.22.17
$ koishi -v
koishi/4.7.0 linux-x64 node-v16.13.1

Additional context

该 bug 不影响程序的正常工作,且不是安装世界上所有插件的话很难出现,可以不用修

@ilharp ilharp added the bug BUG label May 16, 2022
@shigma
Copy link
Member

shigma commented May 16, 2022

这个问题可能是由不遵守 adapter- 前缀的插件导致的,如果可以请提供你的配置文件。

@ilharp
Copy link
Member Author

ilharp commented May 16, 2022

mock

@shigma
Copy link
Member

shigma commented May 16, 2022

这个问题正常情况下不会发生,并且暂时没有很好的解决方法。可以等 4.9 以后相关支持做完了再说。

@shigma shigma added this to the 4.9 milestone Jul 12, 2022
@shigma shigma closed this as completed Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants