我降低了mirai-console版本,问题解决了
J
Jadlokin-Scarlet 发布的帖子
-
mirai-http-api启动时报错
我重启了mirai,然后遇到了这个问题。
我是使用 ./mcl 启动,http-api版本为1.10.0。
是因为mcl自动更新了哪个模块导致的吗还是其他原因。我应该怎么解决他。
(ps:不用在意mirai-login-solver-selenium的报错,以前启动也会报错,但是没有影响,我已经不用了。)
报错内容2021-07-01 18:44:30 E/Mirai HTTP API: java.lang.NoSuchMethodError: 'double kotlin.time.DurationKt.toDuration(int, java.util.concurrent.TimeUnit)' java.lang.NoSuchMethodError: 'double kotlin.time.DurationKt.toDuration(int, java.util.concurrent.TimeUnit)' at net.mamoe.mirai.api.http.route.BaseRouteKt$mirai$2.invoke(BaseRoute.kt:48) at net.mamoe.mirai.api.http.route.BaseRouteKt$mirai$2.invoke(BaseRoute.kt) at io.ktor.features.CORS$Feature.install(CORS.kt:517) at io.ktor.features.CORS$Feature.install(CORS.kt:509) at io.ktor.application.ApplicationFeatureKt.install(ApplicationFeature.kt:68) at net.mamoe.mirai.api.http.route.BaseRouteKt.mirai(BaseRoute.kt:45) at net.mamoe.mirai.api.http.MiraiHttpAPIServer$start$2$1$1.invoke(MiraiHttpAPIServer.kt:93) at net.mamoe.mirai.api.http.MiraiHttpAPIServer$start$2$1$1.invoke(MiraiHttpAPIServer.kt:29) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.instantiateAndConfigureApplication(ApplicationEngineEnvironmentReloading.kt:303) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.createApplication(ApplicationEngineEnvironmentReloading.kt:138) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.start(ApplicationEngineEnvironmentReloading.kt:270) at io.ktor.server.cio.CIOApplicationEngine$serverJob$1$1.invokeSuspend(CIOApplicationEngine.kt:53) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
上下文
18:44:24 [INFO] iTXTech Mirai Console Loader version 1.0.5-9b6cf6d 18:44:24 [INFO] https://github.com/iTXTech/mirai-console-loader 18:44:24 [INFO] This program is licensed under GNU AGPL v3 18:44:24 [DEBUG] Loading script: repo.js 18:44:24 [DEBUG] Loading script: oraclejdk.js 18:44:24 [DEBUG] Loading script: announcement.js 18:44:24 [DEBUG] Loading script: boot.js 18:44:24 [DEBUG] Loading script: updater.js 18:44:24 [DEBUG] Loading script: config.js 18:44:25 [INFO] Fetching Mirai Console Loader Announcement... 18:44:26 [INFO] Mirai Console Loader Announcement: Mirai Console Loader 公告栏 [mirai-console] 最近, 项目组发现了权限系统可能会被错误的提前加载导致的3rd权限系统无法正确加载 于是决定, 于 2.6 起, 超前访问权限系统将得到一个错误并中断插件加载, 请各开发者及时检查 影响范围: https://github.com/mamoe/mirai-console/pull/307 18:44:26 [INFO] Verifying "net.mamoe:mirai-console" version 2.7-M1 18:44:26 [INFO] Verifying "net.mamoe:mirai-console-terminal" version 2.7-M1 18:44:26 [INFO] Verifying "net.mamoe:mirai-core-all" version 2.7-M1 18:44:26 [INFO] Verifying "net.mamoe:mirai-api-http" version 1.10.0 18:44:27 [INFO] Verifying "net.mamoe:chat-command" version 0.5.1 18:44:27 [WARNING] Package "net.mamoe:mirai-api-http" requires "net.mamoe:mirai-console" version 2.5.0. Current version is 2.7-M1 18:44:27 [WARNING] Package "net.mamoe:chat-command" requires "net.mamoe:mirai-console" version 2.0-RC. Current version is 2.7-M1 2021-07-01 18:44:28 I/main: Starting mirai-console... 2021-07-01 18:44:28 I/main: Backend: version 2.7-M1, built on 2021-06-20 02:21:33. 2021-07-01 18:44:28 I/main: Frontend Terminal: version 2.7-M1, provided by Mamoe Technologies 2021-07-01 18:44:28 I/main: Welcome to visit https://mirai.mamoe.net/ 2021-07-01 18:44:28 I/plugin: Successfully loaded plugin net.mamoe.mirai-api-http 2021-07-01 18:44:28 I/net.mamoe.mirai-login-solver-selenium: Loading mirai-login-solver-selenium v1.0-dev-12 2021-07-01 18:44:29 W/net.mamoe.mirai-login-solver-selenium: mirai-login-solver-selenium is not supported. java.lang.RuntimeException: Exception in loading selenium at net.mamoe.mirai.selenium.SeleniumLoginSolverImpl.<init>(SeleniumLoginSolverImpl.kt:33) at net.mamoe.mirai.selenium.SeleniumLoginSolver$SeleniumLoginSolver$2.invoke(SeleniumLoginSolver.kt:17) at net.mamoe.mirai.selenium.SeleniumLoginSolver$SeleniumLoginSolver$2.invoke(SeleniumLoginSolver.kt) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at net.mamoe.mirai.selenium.SeleniumLoginSolver.getInstance(SeleniumLoginSolver.kt) at net.mamoe.mirai.selenium.SeleniumLoginSolverPluginMode.onLoad(SeleniumLoginSolverPluginMode.kt:29) at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnLoad$mirai_console(JvmPluginInternal.kt:196) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.load(BuiltInJvmPluginLoaderImpl.kt:108) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.load(JvmPluginLoader.kt) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.load(JvmPluginLoader.kt:36) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.loadPluginNoEnable(PluginManagerImpl.kt:85) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.loadAllPluginsUsingBuiltInLoaders$mirai_console(PluginManagerImpl.kt:141) at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:157) at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:276) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:152) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:151) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:47) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.itxtech.mcl.Utility.bootMirai(Utility.java:76) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107) at org.mozilla.javascript.ArrowFunction.call(ArrowFunction.java:43) at org.mozilla.javascript.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:155) at org.mozilla.javascript.InterfaceAdapter.lambda$invoke$0(InterfaceAdapter.java:105) at org.mozilla.javascript.Context.call(Context.java:554) at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:522) at org.mozilla.javascript.InterfaceAdapter.invoke(InterfaceAdapter.java:105) at org.mozilla.javascript.jdk18.VMBridge_jdk18$1.invoke(VMBridge_jdk18.java:126) at com.sun.proxy.$Proxy4.run(Unknown Source) at org.itxtech.mcl.script.ScriptManager.phaseBoot(ScriptManager.java:101) at org.itxtech.mcl.Loader.start(Loader.java:129) at org.itxtech.mcl.Loader.main(Loader.java:53) Caused by: java.lang.UnsupportedOperationException: Unsupported Platform: Linux at io.github.karlatemp.mxlib.selenium.MxSelenium.initialize0(MxSelenium.java:266) at io.github.karlatemp.mxlib.selenium.MxSelenium.initialize(MxSelenium.java:138) at net.mamoe.mirai.selenium.SeleniumLoginSolverImplKt$setup$2.invoke(SeleniumLoginSolverImpl.kt:64) at net.mamoe.mirai.selenium.SeleniumLoginSolverImplKt$setup$2.invoke(SeleniumLoginSolverImpl.kt) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at net.mamoe.mirai.selenium.SeleniumLoginSolverImplKt.getSetup(SeleniumLoginSolverImpl.kt) at net.mamoe.mirai.selenium.SeleniumLoginSolverImpl.<init>(SeleniumLoginSolverImpl.kt:32) ... 44 more Caused by: java.io.IOException: Cannot run program "xdg-settings": error=2, No such file or directory at java.base/java.lang.ProcessBuilder.start(Unknown Source) at java.base/java.lang.ProcessBuilder.start(Unknown Source) at io.github.karlatemp.mxlib.selenium.MxSelenium.commandProcessResult(MxSelenium.java:124) at io.github.karlatemp.mxlib.selenium.MxSelenium.commandProcessResult(MxSelenium.java:114) at io.github.karlatemp.mxlib.selenium.MxSelenium.initialize0(MxSelenium.java:252) ... 50 more Caused by: java.io.IOException: error=2, No such file or directory at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) at java.base/java.lang.ProcessImpl.<init>(Unknown Source) at java.base/java.lang.ProcessImpl.start(Unknown Source) ... 55 more 2021-07-01 18:44:29 W/net.mamoe.mirai-login-solver-selenium: Visit https://github.com/project-mirai/mirai-login-solver-selenium for more information java.lang.RuntimeException: Exception in loading selenium at net.mamoe.mirai.selenium.SeleniumLoginSolverImpl.<init>(SeleniumLoginSolverImpl.kt:33) at net.mamoe.mirai.selenium.SeleniumLoginSolver$SeleniumLoginSolver$2.invoke(SeleniumLoginSolver.kt:17) at net.mamoe.mirai.selenium.SeleniumLoginSolver$SeleniumLoginSolver$2.invoke(SeleniumLoginSolver.kt) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at net.mamoe.mirai.selenium.SeleniumLoginSolver.getInstance(SeleniumLoginSolver.kt) at net.mamoe.mirai.selenium.SeleniumLoginSolverPluginMode.onLoad(SeleniumLoginSolverPluginMode.kt:29) at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnLoad$mirai_console(JvmPluginInternal.kt:196) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.load(BuiltInJvmPluginLoaderImpl.kt:108) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.load(JvmPluginLoader.kt) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.load(JvmPluginLoader.kt:36) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.loadPluginNoEnable(PluginManagerImpl.kt:85) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.loadAllPluginsUsingBuiltInLoaders$mirai_console(PluginManagerImpl.kt:141) at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:157) at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:276) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:152) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:151) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:47) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.itxtech.mcl.Utility.bootMirai(Utility.java:76) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107) at org.mozilla.javascript.ArrowFunction.call(ArrowFunction.java:43) at org.mozilla.javascript.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:155) at org.mozilla.javascript.InterfaceAdapter.lambda$invoke$0(InterfaceAdapter.java:105) at org.mozilla.javascript.Context.call(Context.java:554) at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:522) at org.mozilla.javascript.InterfaceAdapter.invoke(InterfaceAdapter.java:105) at org.mozilla.javascript.jdk18.VMBridge_jdk18$1.invoke(VMBridge_jdk18.java:126) at com.sun.proxy.$Proxy4.run(Unknown Source) at org.itxtech.mcl.script.ScriptManager.phaseBoot(ScriptManager.java:101) at org.itxtech.mcl.Loader.start(Loader.java:129) at org.itxtech.mcl.Loader.main(Loader.java:53) Caused by: java.lang.UnsupportedOperationException: Unsupported Platform: Linux at io.github.karlatemp.mxlib.selenium.MxSelenium.initialize0(MxSelenium.java:266) at io.github.karlatemp.mxlib.selenium.MxSelenium.initialize(MxSelenium.java:138) at net.mamoe.mirai.selenium.SeleniumLoginSolverImplKt$setup$2.invoke(SeleniumLoginSolverImpl.kt:64) at net.mamoe.mirai.selenium.SeleniumLoginSolverImplKt$setup$2.invoke(SeleniumLoginSolverImpl.kt) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at net.mamoe.mirai.selenium.SeleniumLoginSolverImplKt.getSetup(SeleniumLoginSolverImpl.kt) at net.mamoe.mirai.selenium.SeleniumLoginSolverImpl.<init>(SeleniumLoginSolverImpl.kt:32) ... 44 more Caused by: java.io.IOException: Cannot run program "xdg-settings": error=2, No such file or directory at java.base/java.lang.ProcessBuilder.start(Unknown Source) at java.base/java.lang.ProcessBuilder.start(Unknown Source) at io.github.karlatemp.mxlib.selenium.MxSelenium.commandProcessResult(MxSelenium.java:124) at io.github.karlatemp.mxlib.selenium.MxSelenium.commandProcessResult(MxSelenium.java:114) at io.github.karlatemp.mxlib.selenium.MxSelenium.initialize0(MxSelenium.java:252) ... 50 more Caused by: java.io.IOException: error=2, No such file or directory at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) at java.base/java.lang.ProcessImpl.<init>(Unknown Source) at java.base/java.lang.ProcessImpl.start(Unknown Source) ... 55 more 2021-07-01 18:44:29 I/plugin: Successfully loaded plugin net.mamoe.mirai-login-solver-selenium 2021-07-01 18:44:29 I/plugin: Successfully loaded plugin Chat Command 2021-07-01 18:44:29 I/main: Prepared built-in commands: autoLogin, help, login, permission, status, stop 2021-07-01 18:44:30 I/net.mamoe.mirai-api-http: Starting Mirai HTTP Server in 0.0.0.0:8080 2021-07-01 18:44:30 I/Mirai HTTP API: Http api server is running with authKey: ********** 2021-07-01 18:44:30 I/net.mamoe.mirai-api-http: 心跳模块启用状态: true 2021-07-01 18:44:30 I/net.mamoe.mirai-api-http: 上报模块启用状态: true 2021-07-01 18:44:30 I/main: 3 plugin(s) enabled. 2021-07-01 18:44:30 I/main: Auto-login ********** 2021-07-01 18:44:30 E/Mirai HTTP API: java.lang.NoSuchMethodError: 'double kotlin.time.DurationKt.toDuration(int, java.util.concurrent.TimeUnit)' java.lang.NoSuchMethodError: 'double kotlin.time.DurationKt.toDuration(int, java.util.concurrent.TimeUnit)' at net.mamoe.mirai.api.http.route.BaseRouteKt$mirai$2.invoke(BaseRoute.kt:48) at net.mamoe.mirai.api.http.route.BaseRouteKt$mirai$2.invoke(BaseRoute.kt) at io.ktor.features.CORS$Feature.install(CORS.kt:517) at io.ktor.features.CORS$Feature.install(CORS.kt:509) at io.ktor.application.ApplicationFeatureKt.install(ApplicationFeature.kt:68) at net.mamoe.mirai.api.http.route.BaseRouteKt.mirai(BaseRoute.kt:45) at net.mamoe.mirai.api.http.MiraiHttpAPIServer$start$2$1$1.invoke(MiraiHttpAPIServer.kt:93) at net.mamoe.mirai.api.http.MiraiHttpAPIServer$start$2$1$1.invoke(MiraiHttpAPIServer.kt:29) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.instantiateAndConfigureApplication(ApplicationEngineEnvironmentReloading.kt:303) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.createApplication(ApplicationEngineEnvironmentReloading.kt:138) at io.ktor.server.engine.ApplicationEngineEnvironmentReloading.start(ApplicationEngineEnvironmentReloading.kt:270) at io.ktor.server.cio.CIOApplicationEngine$serverJob$1$1.invokeSuspend(CIOApplicationEngine.kt:53) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) 2021-07-01 18:44:31 I/Bot.**********: [AccountSecretsManager] Loaded account secrets from local cache. 2021-07-01 18:44:32 I/Bot.**********: [AccountSecretsManager] Saved account secrets to local cache for fast login. 2021-07-01 18:44:32 I/Bot.**********: Login successful. 2021-07-01 18:44:33 V/Bot.**********: Event: BotOnlineEvent(bot=Bot(**********)) 2021-07-01 18:44:33 I/Bot.**********: Bot login successful. 2021-07-01 18:44:33 I/main: mirai-console started successfully.
-
RE: mirai-api-http中通过websocket获取消息的延迟非常大
是的,这是问题所在,我取消了这段逻辑,他不再有几十秒的延迟,但这是为什么。
另外我之所以这么做是因为如果不持续ping的话,会因为session key过期而关闭连接。
有没有既可以维持连接,又不会有延迟的解决方案。 -
mirai-api-http中通过websocket获取消息的延迟非常大
我在另一台服务器通过http-api的websocket接口请求mirai获取即时的聊天消息。
从我在QQ中发送消息到通过接口获取到消息有几十秒的延迟。
是否是因为mirai已经部署了一个月导致缓存过多的原因,或是其他的原因。
我应该如何改善。补充信息(有需要我再补充):
- mirai-api-http版本为1.10.0,websocket文档:
https://github.com/project-mirai/mirai-api-http/blob/master_1.x/docs/API.md#通过websocket - 通过countMessage接口获取到的缓存消息数为0。{"code":0,"errorMessage":"","data":0}
- 我的api-http配置文件:
cors: - '*' host: 0.0.0.0 port: **** authKey: ******** cacheSize: 4096 enableWebsocket: true report: enable: true groupMessage: report: true friendMessage: report: true tempMessage: report: true eventMessage: report: true destinations: [] extraHeaders: {} heartbeat: enable: true delay: 1000 period: 15000 destinations: [] extraBody: {} extraHeaders: {}
- mirai-api-http版本为1.10.0,websocket文档:
-
关于频繁访问认证接口是否会被风控的问题
使用mirai-api-http时,每次发消息都获取一次session发完释放,是否会因为频繁认证而被QQ风控。
mirai-api-http文档:https://github.com/project-mirai/mirai-api-http/blob/master/docs/API.md