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

docker部署找不到配置文件 cacheDir、deviceInfo的读取位置不对吗 #679

Closed
wsdd6 opened this issue May 17, 2023 · 7 comments
Closed
Assignees
Labels
疑问 一个疑问 组件:mirai 与mirai组件相关 陈旧 陈旧且未更新的议题

Comments

@wsdd6
Copy link

wsdd6 commented May 17, 2023

版本号

3.0.0-RC.3

涉及的编程语言

Java

涉及的组件库

mirai(QQ)

疑问描述

修改生成和读取cache和device.json文件的位置

{
  "component": "simbot.mirai",
  "code": 2485922783,
  "passwordInfo": {
    "type": "text",
    "text": "11111111"
  },
  "config": {
    "cacheDir":"src/main/resources/cache",
    "protocol": "MACOS",
    "deviceInfo": {
      "type": "auto"
    },
    "deviceInfo": {
          "type": "auto",
          "baseDir": "src/main/resources/cache",
          "fileBasedFilename": "device.json"
     },
    "recallMessageCacheStrategyConfig": {
      "type": "invalid"
    }
  }
}

image
image

@wsdd6 wsdd6 added the 疑问 一个疑问 label May 17, 2023
@ForliyScarlet ForliyScarlet added the 等待确认 等待负责人员的确认 label May 17, 2023
@wsdd6 wsdd6 changed the title 想问一下有配置可以修改生成和读取cache和device.json文件的位置吗 docker部署找不到配置文件 cacheDir、deviceInfo的读取位置不对吗 May 17, 2023
@ForteScarlet
Copy link
Member

cache 目录在 项目根目录 而不是在资源目录中。
相关配置参考 https://component-mirai.simbot.forte.love/docs/bot-config 中的

  • workingDir
  • cacheDir

@ForteScarlet ForteScarlet added 等待反馈 等待发起者的反馈 组件:mirai 与mirai组件相关 and removed 等待确认 等待负责人员的确认 labels May 17, 2023
@wsdd6
Copy link
Author

wsdd6 commented May 17, 2023

我本地有chache和device.json 但打包到了服务器 还是会让我输入ticket 是服务器的设备信息不一样吗还是没有读取到 是在根目录下

@ForliyScarlet ForliyScarlet added 等待确认 等待负责人员的确认 and removed 等待反馈 等待发起者的反馈 labels May 17, 2023
@wsdd6
Copy link
Author

wsdd6 commented May 17, 2023

2023-05-17T07:46:34.731Z  INFO 1 --- [           main] s.example.SpringBootWebJavaApplication   : Starting SpringBootWebJavaApplication v0.0.1-SNAPSHOT using Java 17.0.2 with PID 1 (/app.jar started by root in /)
2023-05-17T07:46:34.738Z  INFO 1 --- [           main] s.example.SpringBootWebJavaApplication   : The following 1 profile is active: "pro"
2023-05-17T07:46:36.819Z  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2023-05-17T07:46:36.899Z  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 70 ms. Found 1 JPA repository interfaces.
2023-05-17T07:46:37.072Z  WARN 1 --- [           main] o.m.s.mapper.ClassPathMapperScanner      : No MyBatis mapper was found in '[simbot.examole.mapper]' package. Please check your configuration.
2023-05-17T07:46:38.037Z  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2023-05-17T07:46:38.048Z  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-05-17T07:46:38.049Z  INFO 1 --- [           main] o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache Tomcat/10.1.5]
2023-05-17T07:46:38.174Z  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-05-17T07:46:38.178Z  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3276 ms
2023-05-17T07:46:38.264Z  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2023-05-17T07:46:38.679Z  INFO 1 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection conn0: url=jdbc:h2:mem:066c769c-cec2-4a33-899e-5f5c587823d2 user=SA
2023-05-17T07:46:38.681Z  INFO 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2023-05-17T07:46:38.696Z  INFO 1 --- [           main] o.s.b.a.h2.H2ConsoleAutoConfiguration    : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:066c769c-cec2-4a33-899e-5f5c587823d2'
2023-05-17T07:46:38.854Z  INFO 1 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2023-05-17T07:46:38.923Z  INFO 1 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 6.1.6.Final
2023-05-17T07:46:39.080Z  WARN 1 --- [           main] org.hibernate.orm.deprecation            : HHH90000021: Encountered deprecated setting [javax.persistence.sharedCache.mode], use [jakarta.persistence.sharedCache.mode] instead
2023-05-17T07:46:39.228Z  INFO 1 --- [           main] SQL dialect                              : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
Hibernate: create table reply (id bigint not null, content varchar(255), keyword varchar(255), primary key (id))
Hibernate: create sequence reply_seq start with 1 increment by 50
2023-05-17T07:46:40.036Z  INFO 1 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2023-05-17T07:46:40.045Z  INFO 1 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2023-05-17T07:46:40.561Z  INFO 1 --- [           main] love.forte.simbot.utils.BlockingRunner   : Blocking runner wait timeout is enabled with wait timeout 1m. You can enable debug logging for 'love.forte.simbot.utils.BlockingRunner' for more stack information or disable it with the JVM parameter '-Dsimbot.blockingRunner.disableWaitTimeout=true'.
2023-05-17T07:46:40.582Z  INFO 1 --- [           main] ngBootComponentAutoInstallBuildConfigure : The number of Installable Event Provider Factories is 0
2023-05-17T07:46:40.582Z  INFO 1 --- [           main] ngBootComponentAutoInstallBuildConfigure : Install components by [installAllComponents] via classLoader org.springframework.boot.loader.LaunchedURLClassLoader@4dd8dc3
2023-05-17T07:46:41.003Z  INFO 1 --- [           main] otEventProviderAutoInstallBuildConfigure : The number of Installable event provider Factories is 0
2023-05-17T07:46:41.003Z  INFO 1 --- [           main] otEventProviderAutoInstallBuildConfigure : Install event providers by [installAllEventProviders] via classLoader org.springframework.boot.loader.LaunchedURLClassLoader@4dd8dc3
2023-05-17T07:46:41.067Z  INFO 1 --- [           main] s.a.a.SpringBootApplicationConfiguration : The size of providers built is 1
2023-05-17T07:46:41.071Z  INFO 1 --- [           main] s.a.a.SpringBootApplicationConfiguration : Bots all registered. The size of bots: 0
2023-05-17T07:46:41.071Z  INFO 1 --- [           main] s.a.a.SpringBootApplicationConfiguration : Simbot Spring Boot Application built in 491.428191ms
2023-05-17T07:46:41.402Z  WARN 1 --- [           main] .s.b.StandardBotVerifyInfoDecoderFactory : Unable to find the com.charleskorn.kaml:kaml in current classpath, the bot configuration parser in *.bot.yaml format will not be available.
2023-05-17T07:46:41.403Z  WARN 1 --- [           main] .s.b.StandardBotVerifyInfoDecoderFactory : Unable to find the kotlinx-serialization-properties in current classpath, the bot configuration parser in *.bot.properties format will not be available.
2023-05-17T07:46:41.421Z  INFO 1 --- [           main] tSpringBootBotAutoRegisterBuildConfigure : Registering bot with verify info [love.forte.simbot.bot.URLBotVerifyInfo@157d3a45]
2023-05-17T07:46:42.297Z  INFO 1 --- [atcher-worker-3] love.forte.simbot.mirai.net.2485922783   : ECDH key is invalid, start to fetch ecdh public key from server.
2023-05-17T07:46:42.949Z  INFO 1 --- [atcher-worker-3] love.forte.simbot.mirai.net.2485922783   : Successfully fetched ecdh public key from server.
2023-05-17T07:46:43.225Z  INFO 1 --- [atcher-worker-3] love.forte.simbot.mirai.bot.2485922783   : [SliderCaptcha] 需要滑动验证码, 请按照以下链接的步骤完成滑动验证码, 然后输入获取到的 ticket
2023-05-17T07:46:43.225Z  INFO 1 --- [atcher-worker-3] love.forte.simbot.mirai.bot.2485922783   : [SliderCaptcha] Slider captcha required. Please solve the captcha with following link. Type ticket here after completion.
2023-05-17T07:46:43.225Z  INFO 1 --- [atcher-worker-3] love.forte.simbot.mirai.bot.2485922783   : [SliderCaptcha] @see https://github.com/project-mirai/mirai-login-solver-selenium
2023-05-17T07:46:43.225Z  INFO 1 --- [atcher-worker-3] love.forte.simbot.mirai.bot.2485922783   : [SliderCaptcha] @see https://docs.mirai.mamoe.net/mirai-login-solver-selenium/
2023-05-17T07:46:43.225Z  INFO 1 --- [atcher-worker-3] love.forte.simbot.mirai.bot.2485922783   : [SliderCaptcha] 或者输入 TxCaptchaHelper 来使用 TxCaptchaHelper 完成滑动验证码
2023-05-17T07:46:43.225Z  INFO 1 --- [atcher-worker-3] love.forte.simbot.mirai.bot.2485922783   : [SliderCaptcha] Or type `TxCaptchaHelper` to resolve slider captcha with TxCaptchaHelper.apk
2023-05-17T07:46:43.225Z  INFO 1 --- [atcher-worker-3] love.forte.simbot.mirai.bot.2485922783   : [SliderCaptcha] Captcha link: https://ssl.captcha.qq.com/template/wireless_mqq_captcha.html?style=simple&aid=16&uin=2485922783&sid=8861991523158623843&cap_cd=ZbYJn2YFaZ1VxXHfVW70KOqRk4Tj4U1chBiOPnw31vLnisVJTV9g4A**&clientype=1&apptype=2
2023-05-17T07:46:43.232Z  WARN 1 --- [atcher-worker-3] love.forte.simbot.mirai.net.2485922783   : Exception in resumeConnection.

net.mamoe.mirai.internal.network.components.LoginFailedExceptionAsNetworkException: no standard input for captcha
	at net.mamoe.mirai.internal.network.handler.CommonNetworkHandler$StateConnecting$startState$2.invokeSuspend(CommonNetworkHandler.kt:248) ~[mirai-core-jvm-2.14.0.jar!/:2.14.0]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.7.22.jar!/:1.7.22-release-288(1.7.22)]
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
Caused by: net.mamoe.mirai.network.NoStandardInputForCaptchaException: no standard input for captcha
	at net.mamoe.mirai.utils.StandardCharImageLoginSolver$1.invokeSuspend(LoginSolver.jvm.kt:44) ~[mirai-core-api-jvm-2.14.0.jar!/:2.14.0]
	at net.mamoe.mirai.utils.StandardCharImageLoginSolver$1.invoke(LoginSolver.jvm.kt) ~[mirai-core-api-jvm-2.14.0.jar!/:2.14.0]
	at net.mamoe.mirai.utils.StandardCharImageLoginSolver$1.invoke(LoginSolver.jvm.kt) ~[mirai-core-api-jvm-2.14.0.jar!/:2.14.0]
	at net.mamoe.mirai.utils.StandardCharImageLoginSolver$input$1$1.invokeSuspend(LoginSolver.jvm.kt:56) ~[mirai-core-api-jvm-2.14.0.jar!/:2.14.0]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.7.22.jar!/:1.7.22-release-288(1.7.22)]
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95) ~[kotlinx-coroutines-core-jvm-1.6.4.jar!/:na]
	... 4 common frames omitted

@wsdd6
Copy link
Author

wsdd6 commented May 17, 2023

image

@ForteScarlet
Copy link
Member

可以试试修改配置:

// ...
"config": {
    "deviceInfo": {
         "type": "file_based",
         "file": "device.json" // 或其他什么
     }
}

然后清除服务器上 device.json 文件,启动一次,看看是否会在原来预期的位置生成一个新的设备信息文件。如果没生成或生成位置不对,那么就说明之前的位置可能不太对。

按理说应该不会出相同的 device.json 文件在服务端和本地含义不同的情况。我对Docker的运行环境不太清楚。

@ForteScarlet ForteScarlet added 等待反馈 等待发起者的反馈 and removed 等待确认 等待负责人员的确认 labels May 19, 2023
@ForliyScarlet
Copy link
Member

此issue已经在「等待反馈」状态下5日未应答。如果在「陈旧」状态下逾期2日将会被视为无效过期并关闭。

@ForliyScarlet ForliyScarlet added the 陈旧 陈旧且未更新的议题 label May 25, 2023
@wsdd6
Copy link
Author

wsdd6 commented May 25, 2023

使用文件挂载 读取到了 谢谢

@wsdd6 wsdd6 closed this as completed May 25, 2023
@ForliyScarlet ForliyScarlet removed the 等待反馈 等待发起者的反馈 label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
疑问 一个疑问 组件:mirai 与mirai组件相关 陈旧 陈旧且未更新的议题
Projects
None yet
Development

No branches or pull requests

3 participants