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

开启 server-satori 出现 session undefined 报错 #335

Open
shangxueink opened this issue Jan 31, 2025 · 4 comments
Open

开启 server-satori 出现 session undefined 报错 #335

shangxueink opened this issue Jan 31, 2025 · 4 comments

Comments

@shangxueink
Copy link

shangxueink commented Jan 31, 2025

问题描述:

在使用 yarn create koishi 创建项目模板后,开启 server-satori 插件会导致指令无反应,并且在日志中观察到明显的报错。

报错信息与之前的一个类似 issue(#177)基本一致,但今天再次遇到。

复现条件:

  1. 使用 yarn create koishi 创建项目模板。
  2. 开启 server-satori 插件。
  3. 在沙盒尝试触发任意指令

报错日志:

2025-01-31 16:10:44 [I] loader apply plugin server-satori:0wl98t
2025-01-31 16:10:46 [W] session undefined
                        TypeError: Cannot read properties of undefined (reading 'startsWith')
                            at Proxy.<anonymous> (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@koishijs\core\lib\index.cjs:1284:22)
                            at Object.apply (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\core\lib\index.cjs:417:23)
                            at Proxy.dispatch (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\core\lib\index.cjs:514:27)
                            at dispatch.next (<anonymous>)
                            at Function.from (<anonymous>)
                            at Proxy.emit (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\core\lib\index.cjs:521:11)
                            at Processor.attach (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@koishijs\core\lib\index.cjs:792:14)
                            at next (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@koishijs\core\lib\index.cjs:829:38)
                            at Processor._handleMessage (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@koishijs\core\lib\index.cjs:840:28)
                            at Object.apply (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\core\lib\index.cjs:417:23)

预期行为:

正常接收消息并处理消息。

完整日志:


Microsoft Windows [版本 10.0.19045.4717]
(c) Microsoft Corporation。保留所有权利。

D:\QQbots\QQ_bots\koishing\coding\ceshi>yarn create koishi
yarn create v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "[email protected]" with binaries:
      - create-koishi
[##########################] 26/26
  Create Koishi  v6.3.2

√ Project name: ... koishi-app
  Scaffolding project in koishi-app ...
  Done.

√ Install and start it now? ... yes
➤ YN0000: · Yarn 4.5.3
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @koishijs/client@npm:5.30.2, @koishijs/plugin-actions@npm:0.0.2, and 700 more.
➤ YN0000: └ Completed in 2s 465ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0002: │ koishi-app@workspace:. doesn't provide @koishijs/loader (p9ebae), requested by @koishijs/plugin-config and other dependencies.
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 411ms
➤ YN0000: ┌ Link step
➤ YN0007: │ esbuild@npm:0.23.1 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.21.5 must be built because it never has been before or the last one failed
➤ YN0007: │ vue-demi@npm:0.14.10 [d866f] must be built because it never has been before or the last one failed
➤ YN0007: │ @parcel/watcher@npm:2.5.1 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.24.2 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 4s 650ms
➤ YN0000: · Done with warnings in 7s 607ms
2025-01-31 16:10:32 [I] app Koishi/4.18.7
2025-01-31 16:10:32 [I] loader apply plugin group:entry
2025-01-31 16:10:32 [I] loader apply plugin group:server
2025-01-31 16:10:32 [I] loader apply plugin server:eq4bzi
2025-01-31 16:10:32 [I] loader apply plugin group:basic
2025-01-31 16:10:32 [I] loader apply plugin commands:dglfab
2025-01-31 16:10:32 [I] loader apply plugin help:790v89
2025-01-31 16:10:32 [I] loader apply plugin http:7i5p61
2025-01-31 16:10:32 [I] loader apply plugin locales:h6vre5
2025-01-31 16:10:32 [I] loader apply plugin proxy-agent:sa7psq
2025-01-31 16:10:32 [I] loader apply plugin rate-limit:yn9t87
2025-01-31 16:10:32 [I] loader apply plugin telemetry:jcoiau
2025-01-31 16:10:32 [I] loader apply plugin group:console
2025-01-31 16:10:32 [I] loader apply plugin actions:gprgmc
2025-01-31 16:10:32 [I] loader apply plugin analytics:whd3wv
2025-01-31 16:10:32 [I] loader apply plugin config:v4hw4u
2025-01-31 16:10:32 [I] loader apply plugin console:qzar48
2025-01-31 16:10:32 [I] loader apply plugin dataview:3zhlua
2025-01-31 16:10:32 [I] loader apply plugin explorer:orkwk5
2025-01-31 16:10:32 [I] loader apply plugin logger:tx12kw
2025-01-31 16:10:32 [I] loader apply plugin insight:7hmgkw
2025-01-31 16:10:32 [I] loader apply plugin market:d2n33i
2025-01-31 16:10:32 [I] loader apply plugin notifier:dw2ekj
2025-01-31 16:10:32 [I] loader apply plugin oobe:kkcjq0
2025-01-31 16:10:32 [I] loader apply plugin sandbox:gelfe5
2025-01-31 16:10:32 [I] loader apply plugin status:lqlz9e
2025-01-31 16:10:32 [I] loader apply plugin theme-vanilla:t88038
2025-01-31 16:10:32 [I] loader apply plugin group:storage
2025-01-31 16:10:32 [I] loader apply plugin database-sqlite:99fqau
2025-01-31 16:10:32 [I] loader apply plugin assets-local:kf0120
2025-01-31 16:10:32 [I] loader apply plugin group:adapter
2025-01-31 16:10:33 [I] assets missing config "selfUrl", fallback to "file:" scheme
2025-01-31 16:10:33 [I] server server listening at http://127.0.0.1:5140
2025-01-31 16:10:33 [I] console webui is available at http://127.0.0.1:5140
2025-01-31 16:10:33 [I] sqlite auto creating table user
2025-01-31 16:10:33 [I] sqlite auto creating table binding
2025-01-31 16:10:33 [I] sqlite auto creating table channel
2025-01-31 16:10:33 [I] sqlite auto creating table analytics.message
2025-01-31 16:10:33 [I] sqlite auto creating table analytics.command
2025-01-31 16:10:33 [S] telemetry
                        欢迎使用 Koishi!
                        telemetry 服务是一组可选的 Koishi 服务,旨在通过分析您的 Koishi 使用情况来改善 Koishi 的使用体验、提供精确的插件使用量数据,并仅在您需要时为您提供支持。
                        拒绝同意将影响我们提供的相关数据和功能,但不会影响 Koishi 的基础功能。
                        要了解更多信息,请打开 Koishi 控制台并参阅我们的隐私政策。在您点击「同意」前,telemetry 服务不会启动。

2025-01-31 16:10:43 [W] market ConnectTimeoutError: Connect Timeout Error (attempted address: registry.koishi.chat:443, timeout: 10000ms)
                            at onConnectTimeout (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\undici\lib\core\connect.js:237:24)
                            at Immediate._onImmediate (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\undici\lib\core\connect.js:188:35)
                            at process.processImmediate (node:internal/timers:491:21)
2025-01-31 16:10:43 [W] market TypeError: fetch failed
                            at node:internal/deps/undici/undici:13185:13
                            at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
                            at async [cordis.invoke] (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\plugin-http\lib\index.cjs:325:19)
                            at async Proxy.<anonymous> (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\plugin-http\lib\index.cjs:178:26)
                            at async MarketProvider.collect (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@koishijs\plugin-market\lib\node\index.js:378:22)
2025-01-31 16:10:43 [W] market Error: fetch https://registry.koishi.chat/index.json failed
                            at D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\plugin-http\lib\index.cjs:327:23
                            at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
                            at async [cordis.invoke] (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\plugin-http\lib\index.cjs:325:19)
                            at async Proxy.<anonymous> (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\plugin-http\lib\index.cjs:178:26)
                            at async MarketProvider.collect (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@koishijs\plugin-market\lib\node\index.js:378:22)
2025-01-31 16:10:44 [I] loader apply plugin server-satori:0wl98t
2025-01-31 16:10:46 [W] session undefined
                        TypeError: Cannot read properties of undefined (reading 'startsWith')
                            at Proxy.<anonymous> (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@koishijs\core\lib\index.cjs:1284:22)
                            at Object.apply (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\core\lib\index.cjs:417:23)
                            at Proxy.dispatch (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\core\lib\index.cjs:514:27)
                            at dispatch.next (<anonymous>)
                            at Function.from (<anonymous>)
                            at Proxy.emit (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\core\lib\index.cjs:521:11)
                            at Processor.attach (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@koishijs\core\lib\index.cjs:792:14)
                            at next (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@koishijs\core\lib\index.cjs:829:38)
                            at Processor._handleMessage (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@koishijs\core\lib\index.cjs:840:28)
                            at Object.apply (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\core\lib\index.cjs:417:23)
2025-01-31 16:10:54 [W] market ConnectTimeoutError: Connect Timeout Error (attempted address: registry.koishi.chat:443, timeout: 10000ms)
                            at onConnectTimeout (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\undici\lib\core\connect.js:237:24)
                            at Immediate._onImmediate (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\undici\lib\core\connect.js:188:35)
                            at process.processImmediate (node:internal/timers:491:21)
2025-01-31 16:10:54 [W] market TypeError: fetch failed
                            at node:internal/deps/undici/undici:13185:13
                            at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
                            at async [cordis.invoke] (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\plugin-http\lib\index.cjs:325:19)
                            at async Proxy.<anonymous> (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\plugin-http\lib\index.cjs:178:26)
                            at async MarketProvider.collect (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@koishijs\plugin-market\lib\node\index.js:378:22)
2025-01-31 16:10:54 [W] market Error: fetch https://registry.koishi.chat/index.json failed
                            at D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\plugin-http\lib\index.cjs:327:23
                            at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
                            at async [cordis.invoke] (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\plugin-http\lib\index.cjs:325:19)
                            at async Proxy.<anonymous> (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@cordisjs\plugin-http\lib\index.cjs:178:26)
                            at async MarketProvider.collect (D:\QQbots\QQ_bots\koishing\coding\ceshi\koishi-app\node_modules\@koishijs\plugin-market\lib\node\index.js:378:22)

@shangxueink
Copy link
Author

Image

@shigma
Copy link
Contributor

shigma commented Feb 11, 2025

好像没复现……?我刚刚试了模板项目直接启动是好的。

@shangxueink
Copy link
Author

好像没复现……?我刚刚试了模板项目直接启动是好的。

看了一下

在 @koishijs/plugin-console 版本 为 5.30.2 的时候才有这个问题

启动项目模板之后,

开启server-satori插件,然后需要在沙盒 尝试触发指令

这个时候就会复现报错了


目前 @koishijs/plugin-console 版本 为 5.30.3 的确没有了这个问题了!

感谢咪~~~


@koishijs/plugin-console -- 5.30.3 好像有新的问题

在这里提一下咪

https://forum.koishi.xyz/t/topic/10373

@shangxueink
Copy link
Author

在 @koishijs/plugin-console 版本 为 5.30.2 的时候才有这个问题


现在在 @koishijs/plugin-console 最新版的 5.30.4 又可以复现这个情况了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants