SilveryStar / Adachi-BOT

Chatbot framework
https://docs.adachi.top
MIT License
366 stars 70 forks source link

mac环境报Error: Could not find expected browser (chrome) locally #121

Closed NiHang closed 2 years ago

NiHang commented 2 years ago

系统版本

macOS 11.4

Node.js 版本

v15.14.0

应用版本

2.2.1-bugfix1

启动方式

Docker

复述操作

QQ发送消息help呼出菜单如下: Adachi-BOT v2.2.1~

  1. 指令帮助 help (-k)
  2. 管理设置 manager|unmanaged [qq]
  3. 封禁用户 ban|unban [qq|群号]
  4. 指令权限 limit [qq|群号] [key] [on|off]
  5. 操作冷却 int [qq|群号] [时间]
  6. 掷骰 r(次数)d[面数]k(前k大)

使用 detail+指令编号 获取更多信息 [] 表示必填, () 表示选填, | 表示选择

怎么修改这个菜单?我修改了commands.yml增加了silvery-star.uid-query并未生效。能不能提供给全的默认配置指令?

配置文件

tips: 此文件修改后需重启应用
adachi.help:
  type: order
  auth: 1
  scope: 3
  headers:
    - help
  enable: true
adachi.detail:
  type: order
  auth: 1
  scope: 3
  headers:
    - detail
  enable: true
adachi.manager:
  type: switch
  auth: 3
  scope: 3
  mode: divided
  onKey: manager
  offKey: unmanaged
  header: ""
  enable: true
adachi.ban:
  type: switch
  auth: 2
  scope: 3
  mode: divided
  onKey: ban
  offKey: unban
  header: ""
  enable: true
adachi.limit:
  type: switch
  auth: 2
  scope: 3
  mode: single
  onKey: on
  offKey: off
  header: limit
  enable: true
adachi.interval:
  type: order
  auth: 2
  scope: 3
  headers:
    - int
  enable: true
tools.dice:
  type: order
  auth: 1
  scope: 3
  headers:
    - __
  enable: true
silvery-star.uid-query:
  type: order
  auth: 1
  scope: 3
  headers:
    - uid
  enable: true

错误报告

No response

SilveryStar commented 2 years ago

这个肯定是有错误报告的,genshin 整个差距都没加载,翻翻 logs 里的文件看看,或者 webconsole 找

NiHang commented 2 years ago

log文件夹中有个空的log,没有记录

NiHang commented 2 years ago

那需要我重新部署一遍吗?

SilveryStar commented 2 years ago

这样,你按下面的做一遍,然后把终端里的输出贴出来

docker-compose stop
docker rm adachi-bot
docker rmi adachi-bot:2.2.0
docker-compose up
NiHang commented 2 years ago

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them WARNING: Image for service bot was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build. Starting adachi-redis ... done Creating adachi-bot ... done Attaching to adachi-redis, adachi-bot adachi-redis | 1:C 30 Nov 2021 04:53:04.272 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo adachi-redis | 1:C 30 Nov 2021 04:53:04.272 # Redis version=6.2.3, bits=64, commit=00000000, modified=0, pid=1, just started adachi-redis | 1:C 30 Nov 2021 04:53:04.272 # Configuration loaded adachi-redis | 1:M 30 Nov 2021 04:53:04.273 monotonic clock: POSIX clock_gettime adachi-redis | 1:M 30 Nov 2021 04:53:04.275 Running mode=standalone, port=56379. adachi-redis | 1:M 30 Nov 2021 04:53:04.275 # Server initialized adachi-redis | 1:M 30 Nov 2021 04:53:04.279 DB loaded from append only file: 0.003 seconds adachi-redis | 1:M 30 Nov 2021 04:53:04.279 Ready to accept connections adachi-bot | adachi-bot | > adachi-bot@2.2.1-bugfix1 start /bot adachi-bot | > ts-node -r tsconfig-paths/register app.ts --files adachi-bot | adachi-bot | [2021-11-30T12:53:11.551] [MARK] [MacOS:3627220093] - ---------- adachi-bot | [2021-11-30T12:53:11.555] [MARK] [MacOS:3627220093] - Package Version: oicq@1.21.2 (Released on 2021/10/10) adachi-bot | [2021-11-30T12:53:11.555] [MARK] [MacOS:3627220093] - View Changelogs:https://github.com/takayama-lily/oicq/releases adachi-bot | [2021-11-30T12:53:11.555] [MARK] [MacOS:3627220093] - ---------- adachi-bot | [2021-11-30T12:53:11.574] [MARK] [MacOS:3627220093] - 正在探索可用服务器... adachi-bot | [2021-11-30T12:53:12.105] [INFO] [MacOS:3627220093] - 插件 @help 加载完成 adachi-bot | [2021-11-30T12:53:12.701] [INFO] [MacOS:3627220093] - 插件 @management 加载完成 adachi-bot | [2021-11-30T12:53:15.609] [INFO] [MacOS:3627220093] - Express 服务器已启动 adachi-bot | [2021-11-30T12:53:15.615] [ERROR] [MacOS:3627220093] - 插件加载异常: Error: Could not find expected browser (chrome) locally. Run npm install to download the correct Chromium revision (884014). adachi-bot | [2021-11-30T12:53:15.878] [INFO] [MacOS:3627220093] - 插件 tools 加载完成 adachi-bot | [2021-11-30T12:53:15.881] [INFO] [MacOS:3627220093] - 事件监听启动成功 adachi-bot | [2021-11-30T12:53:15.891] [INFO] [MacOS:3627220093] - Redis 数据库已连接 adachi-bot | [2021-11-30T12:53:15.963] [MARK] [MacOS:3627220093] - connecting to 193.112.231.60:8080 adachi-bot | [2021-11-30T12:53:15.973] [MARK] [MacOS:3627220093] - 193.112.231.60:8080 connected adachi-bot | [2021-11-30T12:53:16.133] [MARK] [MacOS:3627220093] - unlocking... adachi-bot | [2021-11-30T12:53:16.366] [MARK] [MacOS:3627220093] - Welcome, 提瓦特助手 ! 初始化资源... adachi-bot | [2021-11-30T12:53:16.458] [MARK] [MacOS:3627220093] - 加载了4个好友,2个群,1个陌生人。 adachi-bot | [2021-11-30T12:53:16.551] [MARK] [MacOS:3627220093] - 初始化完毕,开始处理消息。 看到报错了

NiHang commented 2 years ago

Adachi-BOT-New % node node_modules/puppeteer/install.js

Chromium is already in /Users/xxxxx/Desktop/Adachi-BOT-New/node_modules/puppeteer/.local-chromium/mac-901912; skipping download. 我手动去安装Chromium,提示我已经存在了。这个错是什么原因呢?

SilveryStar commented 2 years ago

emmm,我得查一查,晚点再回复你,看起来像撞车了,Mac不太熟悉

NiHang commented 2 years ago

我找到了个方案但是我不会改:https://segmentfault.com/a/1190000038243913 具体原因应该是我装的版本跟要求的版本没对上

SilveryStar commented 2 years ago

其实应该是这样的,docker 里没装上,你提示有的版本是本地运行 npm install oicq yaml 装上的

SilveryStar commented 2 years ago

最笨的方法是 进入容器去再下载一遍,比如这样

docker-compose start
docker exec -it adachi-bot /bin/bash
node node_modules/puppeteer/install.js
exit
NiHang commented 2 years ago

[root@3d680744db17 bot]# node node_modules/puppeteer/install.js

Downloading Chromium r884014 - 138.7 Mb [====================] 99% 0.0s Chromium (884014) downloaded to /bot/node_modules/puppeteer/.local-chromium/linux-884014 下载后重启 Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them WARNING: Image for service bot was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build. Starting adachi-redis ... done Creating adachi-bot ... done Attaching to adachi-redis, adachi-bot adachi-redis | 1:C 30 Nov 2021 06:23:03.839 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo adachi-redis | 1:C 30 Nov 2021 06:23:03.839 # Redis version=6.2.3, bits=64, commit=00000000, modified=0, pid=1, just started adachi-redis | 1:C 30 Nov 2021 06:23:03.839 # Configuration loaded adachi-redis | 1:M 30 Nov 2021 06:23:03.840 monotonic clock: POSIX clock_gettime adachi-redis | 1:M 30 Nov 2021 06:23:03.842 Running mode=standalone, port=56379. adachi-redis | 1:M 30 Nov 2021 06:23:03.842 # Server initialized adachi-redis | 1:M 30 Nov 2021 06:23:03.847 DB loaded from append only file: 0.004 seconds adachi-redis | 1:M 30 Nov 2021 06:23:03.847 Ready to accept connections adachi-bot | adachi-bot | > adachi-bot@2.2.1-bugfix1 start /bot adachi-bot | > ts-node -r tsconfig-paths/register app.ts --files adachi-bot | adachi-bot | [2021-11-30T14:23:11.978] [MARK] [MacOS:3627220093] - ---------- adachi-bot | [2021-11-30T14:23:11.983] [MARK] [MacOS:3627220093] - Package Version: oicq@1.21.2 (Released on 2021/10/10) adachi-bot | [2021-11-30T14:23:11.984] [MARK] [MacOS:3627220093] - View Changelogs:https://github.com/takayama-lily/oicq/releases adachi-bot | [2021-11-30T14:23:11.984] [MARK] [MacOS:3627220093] - ---------- adachi-bot | [2021-11-30T14:23:12.004] [MARK] [MacOS:3627220093] - 正在探索可用服务器... adachi-bot | [2021-11-30T14:23:12.639] [INFO] [MacOS:3627220093] - 插件 @help 加载完成 adachi-bot | [2021-11-30T14:23:13.319] [INFO] [MacOS:3627220093] - 插件 @management 加载完成 adachi-bot | [2021-11-30T14:23:16.614] [INFO] [MacOS:3627220093] - Express 服务器已启动 adachi-bot | [2021-11-30T14:23:16.622] [ERROR] [MacOS:3627220093] - 插件加载异常: Error: Could not find expected browser (chrome) locally. Run npm install to download the correct Chromium revision (884014). adachi-bot | [2021-11-30T14:23:16.888] [INFO] [MacOS:3627220093] - 插件 tools 加载完成 adachi-bot | [2021-11-30T14:23:16.891] [INFO] [MacOS:3627220093] - 事件监听启动成功 adachi-bot | [2021-11-30T14:23:16.907] [INFO] [MacOS:3627220093] - Redis 数据库已连接 adachi-bot | [2021-11-30T14:23:17.023] [MARK] [MacOS:3627220093] - connecting to 109.244.128.23:8080 adachi-bot | [2021-11-30T14:23:17.035] [MARK] [MacOS:3627220093] - 109.244.128.23:8080 connected adachi-bot | [2021-11-30T14:23:17.183] [MARK] [MacOS:3627220093] - unlocking... adachi-bot | [2021-11-30T14:23:17.408] [MARK] [MacOS:3627220093] - Welcome, 提瓦特助手 ! 初始化资源... adachi-bot | [2021-11-30T14:23:17.479] [MARK] [MacOS:3627220093] - 加载了4个好友,2个群,1个陌生人。 adachi-bot | [2021-11-30T14:23:17.562] [MARK] [MacOS:3627220093] - 初始化完毕,开始处理消息。 还是报错

NiHang commented 2 years ago

puppeteer % node install.js Chromium is already in /Users/xxxxxx/Desktop/Adachi-BOT-New/node_modules/puppeteer/.local-chromium/mac-901912; skipping download. 我本地node环境装的版本是mac-901912 报错的是884014是不是这个原因呢?容器里面的版本是linux-884014应该是对的

SilveryStar commented 2 years ago

不会,容器内外环境肯定是隔离的…… 要不……你进容器再尝试下载一次?看看是不是真的有问题

docker exec -it adachi-bot /bin/bash 
node node_modules/puppeteer/install.js 
exit
docker-compose stop
docker-compose start
NiHang commented 2 years ago

Adachi-BOT-New % docker exec -it adachi-bot /bin/bash

[root@c1cbd3f0ce8a bot]# node node_modules/puppeteer/install.js Downloading Chromium r884014 - 138.7 Mb [====================] 99% 0.0s Chromium (884014) downloaded to /bot/node_modules/puppeteer/.local-chromium/linux-884014 [root@c1cbd3f0ce8a bot]# exit exit Adachi-BOT-New % docker-compose stop

Stopping adachi-bot ... done Stopping adachi-redis ... done Adachi-BOT-New % docker-compose start

Starting redis ... done Starting bot ... done

看起来都是正常的,我现在再更新重启吗?

SilveryStar commented 2 years ago

看起来不正常,正常的话你之前下载成功了这里应该是 skipping 的,但是又下载了一遍……

我晚上再看看,下午有课

NiHang commented 2 years ago

看起来不正常,正常的话你之前下载成功了这里应该是 skipping 的,但是又下载了一遍……

我晚上再看看,下午有课

好的

NiHang commented 2 years ago

额,可以了。。。 Adachi-BOT-New % docker-compose up Starting adachi-redis ... done Starting adachi-bot ... done Attaching to adachi-redis, adachi-bot adachi-redis | 1:C 30 Nov 2021 06:57:25.797 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo adachi-redis | 1:C 30 Nov 2021 06:57:25.797 # Redis version=6.2.3, bits=64, commit=00000000, modified=0, pid=1, just started adachi-redis | 1:C 30 Nov 2021 06:57:25.797 # Configuration loaded adachi-redis | 1:M 30 Nov 2021 06:57:25.798 monotonic clock: POSIX clock_gettime adachi-redis | 1:M 30 Nov 2021 06:57:25.800 Running mode=standalone, port=56379. adachi-redis | 1:M 30 Nov 2021 06:57:25.801 # Server initialized adachi-redis | 1:M 30 Nov 2021 06:57:25.808 DB loaded from append only file: 0.006 seconds adachi-redis | 1:M 30 Nov 2021 06:57:25.808 Ready to accept connections adachi-bot | adachi-bot | > adachi-bot@2.2.1-bugfix1 start /bot adachi-bot | > ts-node -r tsconfig-paths/register app.ts --files adachi-bot | adachi-bot | [2021-11-30T14:57:33.501] [MARK] [MacOS:3627220093] - ---------- adachi-bot | [2021-11-30T14:57:33.506] [MARK] [MacOS:3627220093] - Package Version: oicq@1.21.2 (Released on 2021/10/10) adachi-bot | [2021-11-30T14:57:33.506] [MARK] [MacOS:3627220093] - View Changelogs:https://github.com/takayama-lily/oicq/releases adachi-bot | [2021-11-30T14:57:33.507] [MARK] [MacOS:3627220093] - ---------- adachi-bot | [2021-11-30T14:57:33.548] [MARK] [MacOS:3627220093] - 正在探索可用服务器... adachi-bot | [2021-11-30T14:57:34.183] [INFO] [MacOS:3627220093] - 插件 @help 加载完成 adachi-bot | [2021-11-30T14:57:34.823] [INFO] [MacOS:3627220093] - 插件 @management 加载完成 adachi-bot | [2021-11-30T14:57:37.880] [INFO] [MacOS:3627220093] - Express 服务器已启动 adachi-bot | [2021-11-30T14:57:37.919] [INFO] [MacOS:3627220093] - Redis 数据库已连接 adachi-bot | [2021-11-30T14:57:40.607] [INFO] [MacOS:3627220093] - 插件 genshin 加载完成 adachi-bot | [2021-11-30T14:57:40.846] [INFO] [MacOS:3627220093] - 插件 tools 加载完成 adachi-bot | [2021-11-30T14:57:40.849] [INFO] [MacOS:3627220093] - 事件监听启动成功 adachi-bot | [2021-11-30T14:57:40.852] [WARN] [MacOS:3627220093] - 探索服务器失败: timeout adachi-bot | [2021-11-30T14:57:40.853] [MARK] [MacOS:3627220093] - connecting to msfwifi.3g.qq.com:8080 adachi-bot | [2021-11-30T14:57:40.895] [MARK] [MacOS:3627220093] - 113.96.13.125:8080 connected adachi-bot | [2021-11-30T14:57:41.118] [MARK] [MacOS:3627220093] - Welcome, 提瓦特助手 ! 初始化资源... adachi-bot | [2021-11-30T14:57:41.250] [MARK] [MacOS:3627220093] - 加载了4个好友,2个群,1个陌生人。 adachi-bot | [2021-11-30T14:57:41.344] [MARK] [MacOS:3627220093] - 初始化完毕,开始处理消息。 adachi-bot | [2021-11-30T15:00:09.966] [INFO] [MacOS:3627220093] - recv from: [Private: 726742009(friend)] help adachi-bot | [2021-11-30T15:00:10.042] [INFO] [MacOS:3627220093] - send to: [Private: 726742009 / message_id: K1Ez+QAAABbfB+NZYaXL+gE=]

探索服务器失败: timeout 但是这个超时警告没问题吧?

SilveryStar commented 2 years ago

说实话不太清楚这个东西的影响,我一般看到会重登一次,不过好像确实没什么影响

NiHang commented 2 years ago

说实话不太清楚这个东西的影响,我一般看到会重登一次,不过好像确实没什么影响

好的,谢谢了!

SilveryStar commented 2 years ago

这个东西……很怪 pc端移安卓端情况不同,私聊群聊情况也不同,比较稳定能看到图片的是安卓端群聊,Mac和iOS不清楚 有时候发送这种消息还报错,应该是腾讯那边的问题 以后想办法再改吧……现在只能将就用着

SilveryStar commented 2 years ago

另外你注意一下webconsole的日志功能正不正常啊,你之前说日志是空的挺奇怪的……

NiHang commented 2 years ago

另外你注意一下webconsole的日志功能正不正常啊,你之前说日志是空的挺奇怪的……

我现在看还是空的,看样子是没有写入。webconsole的账号密码是哪里看的?哦就是QQ账号密码

SilveryStar commented 2 years ago

web console的账密是部署的 bot 的账密 你还是 exec 进一下容器看看有没有日志?这太奇怪了……

NiHang commented 2 years ago

webconsole里今天的日志也是空的,但是我使用时正常的

SilveryStar commented 2 years ago

等下,你 setting.ymlplatform 配置的什么

SilveryStar commented 2 years ago

修了

NiHang commented 2 years ago

额,就这个问题导致的?我确实填的macOS,我明天验证下,谢谢了!

SilveryStar commented 2 years ago

是这样的,因为日志的 categories 名是库里写死的,为了改 log4js 的配置只能迎合库里设定的格式……