SilveryStar/Adachi-BOT

执行npm start后提示Error: EACCES: permission denied, open '/home/lighthouse/Adachi-BOT/src/plugins/genshin/data/almanac.yml' at Object.openSync (node:fs:585:3) at FileManagement.writeYAML (/home/lighthouse/Adachi-BOT/src/modules/file.ts:96:29) at FileManagement.createYAML (/home/lighthouse/Adachi-BOT/src/modules/file.ts:83:9) at /home/lighthouse/Adachi-BOT/src/plugins/genshin/module/almanac.ts:30:14 at processTicksAndRejections (node:internal/process/task_queues:96:5)

weitanai123 opened this issue · 4 comments

系统版本

centos 7.6

Node.js 版本

16.14.0

应用版本

2.2.10-bugfix1

启动方式

Docker

复述操作

执行npm start后有如下信息

adachi-bot@2.2.10-bugfix1 start
ts-node -r tsconfig-paths/register app.ts --files

[2022-03-06T18:28:33.258] [MARK] [MacOS:1340398625] - ----------
[2022-03-06T18:28:33.261] [MARK] [MacOS:1340398625] - Package Version: oicq@1.21.3 (Released on 2021/12/08)
[2022-03-06T18:28:33.262] [MARK] [MacOS:1340398625] - View Changelogs:https://github.com/takayama-lily/oicq/releases
[2022-03-06T18:28:33.262] [MARK] [MacOS:1340398625] - ----------
[2022-03-06T18:28:33.278] [MARK] [MacOS:1340398625] - 正在探索可用服务器...
[2022-03-06T18:28:33.846] [INFO] [MacOS:1340398625] - 插件 @help 加载完成
[2022-03-06T18:28:34.395] [INFO] [MacOS:1340398625] - 插件 @management 加载完成
[2022-03-06T18:28:40.131] [INFO] [MacOS:1340398625] - 插件 genshin 加载完成
[2022-03-06T18:28:40.435] [INFO] [MacOS:1340398625] - 插件 tools 加载完成
[2022-03-06T18:28:40.446] [INFO] [MacOS:1340398625] - 事件监听启动成功
[2022-03-06T18:28:40.449] [INFO] [MacOS:1340398625] - Express 服务器已启动
[2022-03-06T18:28:40.450] [WARN] [MacOS:1340398625] - 探索服务器失败: timeout
[2022-03-06T18:28:40.450] [MARK] [MacOS:1340398625] - connecting to msfwifi.3g.qq.com:8080
[2022-03-06T18:28:40.498] [INFO] [MacOS:1340398625] - Redis 数据库已连接
[2022-03-06T18:28:40.541] [MARK] [MacOS:1340398625] - 120.241.150.69:8080 connected
[2022-03-06T18:28:40.767] [ERROR] [MacOS:1340398625] - Error: EACCES: permission denied, open '/home/lighthouse/Adachi-BOT/src/plugins/genshin/data/almanac.yml'
at Object.openSync (node:fs:585:3)
at FileManagement.writeYAML (/home/lighthouse/Adachi-BOT/src/modules/file.ts:96:29)
at FileManagement.createYAML (/home/lighthouse/Adachi-BOT/src/modules/file.ts:83:9)
at /home/lighthouse/Adachi-BOT/src/plugins/genshin/module/almanac.ts:30:14
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-03-06T18:28:40.898] [MARK] [MacOS:1340398625] - Welcome, 邚妃 ! 初始化资源...
[2022-03-06T18:28:41.115] [MARK] [MacOS:1340398625] - 加载了13个好友,2个群,0个陌生人。
[2022-03-06T18:28:41.226] [INFO] [MacOS:1340398625] - 浏览器启动成功
[2022-03-06T18:28:41.239] [MARK] [MacOS:1340398625] - 初始化完毕,开始处理消息。

但运行之后简单试了一下各项功能貌似没有异常……除了查询深渊发过来的图(合并转发)都是裂开的,萌新第一次提交issue也不知道哪里有冒犯,帮帮可莉吧
另外执行docker-compose up -d之后机器人显示运行但它不会回复我,还需要配置什么吗?

配置文件

qrcode: false
number: 1340398625
password: ******
master: 2435056792
header: "#"
platform: 4
atUser: true
inviteAuth: master
countThreshold: 100
groupIntervalTime: 1000
privateIntervalTime: 2000
helpMessageStyle: message
logLevel: info
dbPort: 6379
webConsole:
  enable: false
  consolePort: 80
  tcpLoggerPort: 54921
  jwtSecret: "564335"
atBOT: false

错误报告

[2022-03-06T18:28:40.767] [ERROR] [MacOS:1340398625] - Error: EACCES: permission denied, open '/home/lighthouse/Adachi-BOT/src/plugins/genshin/data/almanac.yml'
    at Object.openSync (node:fs:585:3)
    at FileManagement.writeYAML (/home/lighthouse/Adachi-BOT/src/modules/file.ts:96:29)
    at FileManagement.createYAML (/home/lighthouse/Adachi-BOT/src/modules/file.ts:83:9)
    at /home/lighthouse/Adachi-BOT/src/plugins/genshin/module/almanac.ts:30:14
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

错误报告显示是因为文件没有读取权限,可以试试 sudo npm start
应该只有私聊转发图会裂,这个是 tx 那边的问题,没办法解决,群聊应该是正常的

你如果 npm start 能运行的话就没必要管 docker-compose up -d 了,本质上都是一样的

错误报告显示是因为文件没有读取权限,可以试试 sudo npm start
应该只有私聊转发图会裂,这个是 tx 那边的问题,没办法解决,群聊应该是正常的

你如果 npm start 能运行的话就没必要管 docker-compose up -d 了,本质上都是一样的

感谢,已解决,现在没有任何报错了,机器人也可以正常启动。
但是用npm start不能关掉命令窗口,否则机器人不会回复,所以还是想试试用docker-compose up -d启动机器人😭帮帮可莉吧,主要是挂在服务器上,自己的电脑也没法24小时开着🌚

那你 sudo npm serve 呗 (forever

那你 sudo npm serve 呗 (forever

好了好了,谢谢,你是个好人(好人卡)