Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

拉取源代码更新后大量服务器资源被异常消耗 #872

Closed
Nigel-NI opened this issue Aug 3, 2022 · 36 comments
Closed

拉取源代码更新后大量服务器资源被异常消耗 #872

Nigel-NI opened this issue Aug 3, 2022 · 36 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@Nigel-NI
Copy link

Nigel-NI commented Aug 3, 2022

问题描述

我编写了一个.sh文件以实现每天自动拉取上游源码并更新。但有时候使用脚本更新后,chromium被调用,主机CPU占用100%;随后约5分钟后磁盘io读取量达到110000kb/s以上,导致服务器直接瘫痪(此时htop显示CPU占用约16%,chromium进程不再大量消耗CPU)。服务器重启后恢复正常。

PS: 印象中导致高IO的其中一个进程是Adachi-BOT/app.js。占用CPU的chromium完整线程与高IO的具体进程将会在下次补充,因服务器出现问题时输入指令无响应而被迫重启,重启后问题进程消失

复现流程

在crontab中定时调用脚本拉取更新。该问题概率出现,大约1-4天一次。脚本内容如下:

#!/bin/sh

unset GIT_DIR
cd /root/Adachi-BOT
git pull -p
sleep 1
npm install && npm run restart

后台日志

(该日志于服务器重启后获取,重启后服务器性能消耗无异常)

0|bot      | }
0|bot      | Error: listen EADDRINUSE: address already in use 127.0.0.1:9934
0|bot      |     at Server.setupListenHandle [as _listen2] (node:net:1334:16)
0|bot      |     at listenInCluster (node:net:1382:12)
0|bot      |     at GetAddrInfoReqWrap.doListen [as callback] (node:net:1520:7)
0|bot      |     at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:73:8) {
0|bot      |   code: 'EADDRINUSE',
0|bot      |   errno: -98,
0|bot      |   syscall: 'listen',
0|bot      |   address: '127.0.0.1',
0|bot      |   port: 9934
0|bot      | }
0|bot      | Error: listen EADDRINUSE: address already in use 127.0.0.1:9934
0|bot      |     at Server.setupListenHandle [as _listen2] (node:net:1334:16)
0|bot      |     at listenInCluster (node:net:1382:12)
0|bot      |     at GetAddrInfoReqWrap.doListen [as callback] (node:net:1520:7)
0|bot      |     at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:73:8) {
0|bot      |   code: 'EADDRINUSE',
0|bot      |   errno: -98,
0|bot      |   syscall: 'listen',
0|bot      |   address: '127.0.0.1',
0|bot      |   port: 9934
0|bot      | }
0|bot      | Error: listen EADDRINUSE: address already in use 127.0.0.1:9934
0|bot      |     at Server.setupListenHandle [as _listen2] (node:net:1334:16)
0|bot      |     at listenInCluster (node:net:1382:12)
0|bot      |     at GetAddrInfoReqWrap.doListen [as callback] (node:net:1520:7)
0|bot      |     at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:73:8) {
0|bot      |   code: 'EADDRINUSE',
0|bot      |   errno: -98,
0|bot      |   syscall: 'listen',
0|bot      |   address: '127.0.0.1',
0|bot      |   port: 9934
0|bot      | }
0|bot      | ApiRejection { code: -2, message: 'packet timeout (9183)' }
0|bot      | Error: unknown music id: 1350330823, in platform: 163
0|bot      |     at buildMusic (/root/Adachi-BOT/node_modules/oicq/lib/message/music.js:110:15)
0|bot      |     at runMicrotasks (<anonymous>)
0|bot      |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
0|bot      |     at async Group.shareMusic (/root/Adachi-BOT/node_modules/oicq/lib/group.js:239:22)
0|bot      | TypeError: Cannot read properties of undefined (reading '1')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '1')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '1')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | ApiRejection { code: -2, message: 'packet timeout (3877)' }
0|bot      | ApiRejection { code: -2, message: 'packet timeout (4163)' }
0|bot      | TypeError: Cannot convert undefined or null to object
0|bot      |     at Function.keys (<anonymous>)
0|bot      |     at mysNewsNotice (file:///root/Adachi-BOT/src/utils/notice.js:34:26)
0|bot      |     at mysNewsJob (file:///root/Adachi-BOT/src/utils/init.js:60:5)
0|bot      |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
0|bot      | ApiRejection { code: -2, message: 'packet timeout (4247)' }
0|bot      | ApiRejection { code: -2, message: 'packet timeout (4248)' }
0|bot      | ApiRejection { code: -2, message: 'packet timeout (4304)' }
0|bot      | app.js: 文件服务器异常退出!
0|bot      | app.js: 文件服务器异常退出!
0|bot      | node:internal/process/promises:246
0|bot      |           triggerUncaughtException(err, true /* fromPromise */);
0|bot      |           ^
0|bot      | 
0|bot      | [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<ApiRejection>".] {
0|bot      |   code: 'ERR_UNHANDLED_REJECTION'
0|bot      | }
0|bot      | app.js: 机器人异常退出!
0|bot      | node:internal/process/promises:246
0|bot      |           triggerUncaughtException(err, true /* fromPromise */);
0|bot      |           ^
0|bot      | 
0|bot      | [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<ApiRejection>".] {
0|bot      |   code: 'ERR_UNHANDLED_REJECTION'
0|bot      | }
0|bot      | app.js: 机器人异常退出!
0|bot      | app.js: 文件服务器异常退出!
0|bot      | app.js: 文件服务器异常退出!
0|bot      | app.js: 文件服务器异常退出!
0|bot      | node:internal/process/promises:246
0|bot      |           triggerUncaughtException(err, true /* fromPromise */);
0|bot      |           ^
0|bot      | 
0|bot      | [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<ApiRejection>".] {
0|bot      |   code: 'ERR_UNHANDLED_REJECTION'
0|bot      | }
0|bot      | app.js: 机器人异常退出!



### 运行环境

```Text
操作系统:linux(Debian GNU/Linux)
内核版本:4.19.0-18-amd64
内核架构:x64
处理器:  6.83%(Intel Xeon® Platinum 8255C @ 2.5Ghz)
启动时间:5 minutes
内存使用:28.55%(597 MB / 2.09 GB)
数据占用:677 kB
Node.js: 16.13.1
npm:     8.1.2
浏览器:  Chromium 90.0.4430.212 built on Debian 10.9, running on Debian 10.11

当前提交

Author: Qin Fandong <shell_way@foxmail.com>
Date:   Sun Jul 31 19:28:13 2022 +0800

    <E8><BF><99><E4><B8><AA><E6><8F><90><E4><BA><A4><E7><9A><84><E5><94><AF><E4><B8><80><E4><BD><9C><E7><94><A8><E5><B0><B1><E6><98><AF>
<E6><98><BE><E5><BE><97><E6><AD><A4><E9><A1><B9><E7><AE><E6><B4><E6><96><B0><E6><AF><94><E8><BE><83><E9><A2><91><E7><B9><81>

代码状态

On branch master
Your branch is up to date with 'origin/master'.
@Nigel-NI Nigel-NI added bug Something isn't working question Further information is requested labels Aug 3, 2022
@Arondight Arondight removed the question Further information is requested label Aug 3, 2022
@Arondight
Copy link
Owner

暂时先别更新,有空我看一下。

我记得当初还不怎么会 js 的时候,有几个 fetch 的 Promise 我用了 try catch ,而实际上 try 并不能处理 Promise(未来的异常),可能这里有问题。改成同步的版本看一看。

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 3, 2022

感谢您的回复。为了确定高占用CPU和IO的具体线程,我可能还会让crontab自动执行更新脚本,因为我不确定手动执行该脚本是否会复现问题,并且从开始大量占用CPU到大量占用IO有几分钟的缓冲时间,差不多足够收集数据用了。

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 3, 2022

问题复现。我刚才查了一下深渊战绩情况,现在chromium大量占用CPU及内存,已持续5分钟。对应具体的子线程输出如下:

ps -efL | grep 31019
root     31019 30995 31019 37    9 17:50 ?        00:02:29 /usr/lib/chromium/chromium --type=renderer --no-sandbox --disable-dev-shm-usage --disable-background-timer-throttling --disable-breakpad --enable-automation --file-url-path-alias=/gen=/usr/lib/chromium/gen --force-color-profile=srgb --remote-debugging-port=0 --allow-pre-commit-input --field-trial-handle=13517629842365507945,8484640932690998268,131072 --enable-features=NetworkServiceInProcess2 --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BackForwardCache,Translate --enable-blink-features=IdleDetection --lang=en-US --headless --export-tagged-pdf --lang=en-US --num-raster-threads=1 --renderer-client-id=4 --shared-files=v8_context_snapshot_data:100
root     31019 30995 31021  0    9 17:50 ?        00:00:00 /usr/lib/chromium/chromium --type=renderer --no-sandbox --disable-dev-shm-usage --disable-background-timer-throttling --disable-breakpad --enable-automation --file-url-path-alias=/gen=/usr/lib/chromium/gen --force-color-profile=srgb --remote-debugging-port=0 --allow-pre-commit-input --field-trial-handle=13517629842365507945,8484640932690998268,131072 --enable-features=NetworkServiceInProcess2 --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BackForwardCache,Translate --enable-blink-features=IdleDetection --lang=en-US --headless --export-tagged-pdf --lang=en-US --num-raster-threads=1 --renderer-client-id=4 --shared-files=v8_context_snapshot_data:100
root     31019 30995 31025 33    9 17:50 ?        00:02:13 /usr/lib/chromium/chromium --type=renderer --no-sandbox --disable-dev-shm-usage --disable-background-timer-throttling --disable-breakpad --enable-automation --file-url-path-alias=/gen=/usr/lib/chromium/gen --force-color-profile=srgb --remote-debugging-port=0 --allow-pre-commit-input --field-trial-handle=13517629842365507945,8484640932690998268,131072 --enable-features=NetworkServiceInProcess2 --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BackForwardCache,Translate --enable-blink-features=IdleDetection --lang=en-US --headless --export-tagged-pdf --lang=en-US --num-raster-threads=1 --renderer-client-id=4 --shared-files=v8_context_snapshot_data:100
(以下略)

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 3, 2022

导致高IO占用的进程如下:

  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND                                                                   
  531 be/4 root       19.66 M/s    0.00 B/s  0.00 % 89.12 % PM2 v5.2.0: God Daemon (/root/Adachi-BOT/bot.pm2/)
30925 be/4 root       22.12 M/s    0.00 B/s  0.00 % 85.81 % node /root/Adachi-BOT/app.js
  992 be/4 root       14.22 M/s    2.98 K/s  0.00 % 81.67 % barad_agent
31019 be/4 root       19.19 M/s    0.00 B/s  0.17 % 63.15 % gen --force-color-profile=srgb --remot~red-files=v8_context_snapshot_data:100
 1233 be/4 root        7.37 M/s    0.00 B/s  3.25 % 45.40 % containerd

@mark9804
Copy link
Collaborator

mark9804 commented Aug 3, 2022

chromium 的问题我尽力了,感觉是 chromium 或者 puppeteer 有一个bug,会随机出现占用特别高的情况

io不太清楚

@Arondight
Copy link
Owner

应该是老旧代码的锅,我这几天改改看看有没有效 @Nigel-NI 你先停掉定时任务吧

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 3, 2022

好的,给您添麻烦了,谢谢

@Arondight
Copy link
Owner

好的,给您添麻烦了,谢谢

你太客气了,假如有一天做测试可是要吃大亏的 _(:з」∠)_

@Arondight
Copy link
Owner

@Nigel-NI 看下现在好了吗

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 5, 2022

拉取更新后bot似乎无法启动了,报错日志如下:

/root/Adachi-BOT/bot.pm2/logs/bot-error.log last 200 lines:
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '0')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '1')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | TypeError: Cannot read properties of undefined (reading '1')
0|bot      |     at gachaTimes (file:///root/Adachi-BOT/src/plugins/gacha/data.js:248:89)
0|bot      |     at doGacha (file:///root/Adachi-BOT/src/plugins/gacha/gacha.js:8:18)
0|bot      |     at Module.Plugin (file:///root/Adachi-BOT/src/plugins/gacha/index.js:22:9)
0|bot      |     at doPossibleCommand (file:///root/Adachi-BOT/src/utils/load.js:126:27)
0|bot      |     at processed (file:///root/Adachi-BOT/src/utils/load.js:193:9)
0|bot      |     at Client.<anonymous> (file:///root/Adachi-BOT/app.js:89:26)
0|bot      |     at Client.emit (node:events:390:28)
0|bot      |     at Client.em (/root/Adachi-BOT/node_modules/oicq/lib/client.js:519:18)
0|bot      |     at Client.groupMsgListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/onlinepush.js:409:14)
0|bot      |     at Client.eventsListener (/root/Adachi-BOT/node_modules/oicq/lib/internal/listeners.js:81:41)
0|bot      | ApiRejection { code: -2, message: 'packet timeout (3877)' }
0|bot      | ApiRejection { code: -2, message: 'packet timeout (4163)' }
0|bot      | TypeError: Cannot convert undefined or null to object
0|bot      |     at Function.keys (<anonymous>)
0|bot      |     at mysNewsNotice (file:///root/Adachi-BOT/src/utils/notice.js:34:26)
0|bot      |     at mysNewsJob (file:///root/Adachi-BOT/src/utils/init.js:60:5)
0|bot      |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
0|bot      | ApiRejection { code: -2, message: 'packet timeout (4247)' }
0|bot      | ApiRejection { code: -2, message: 'packet timeout (4248)' }
0|bot      | ApiRejection { code: -2, message: 'packet timeout (4304)' }
0|bot      | app.js: 文件服务器异常退出!
0|bot      | app.js: 文件服务器异常退出!
0|bot      | node:internal/process/promises:246
0|bot      |           triggerUncaughtException(err, true /* fromPromise */);
0|bot      |           ^
0|bot      | 
0|bot      | [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<ApiRejection>".] {
0|bot      |   code: 'ERR_UNHANDLED_REJECTION'
0|bot      | }
0|bot      | app.js: 机器人异常退出!
0|bot      | node:internal/process/promises:246
0|bot      |           triggerUncaughtException(err, true /* fromPromise */);
0|bot      |           ^
0|bot      | 
0|bot      | [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<ApiRejection>".] {
0|bot      |   code: 'ERR_UNHANDLED_REJECTION'
0|bot      | }
0|bot      | app.js: 机器人异常退出!
0|bot      | app.js: 文件服务器异常退出!
0|bot      | app.js: 文件服务器异常退出!
0|bot      | app.js: 文件服务器异常退出!
0|bot      | node:internal/process/promises:246
0|bot      |           triggerUncaughtException(err, true /* fromPromise */);
0|bot      |           ^
0|bot      | 
0|bot      | [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<ApiRejection>".] {
0|bot      |   code: 'ERR_UNHANDLED_REJECTION'
0|bot      | }
0|bot      | app.js: 机器人异常退出!
0|bot      | (node:29888) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
0|bot      |     at node:punycode:5:10
0|bot      |     at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:312:7)
0|bot      |     at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:252:10)
0|bot      |     at loadNativeModule (node:internal/modules/cjs/helpers:49:9)
0|bot      |     at Function.Module._load (node:internal/modules/cjs/loader:804:15)
0|bot      |     at Module.require (node:internal/modules/cjs/loader:1005:19)
0|bot      |     at require (node:internal/modules/cjs/helpers:102:18)
0|bot      |     at Object.<anonymous> (/root/Adachi-BOT/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
0|bot      |     at Module._compile (node:internal/modules/cjs/loader:1101:14)
0|bot      |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
0|bot      | (node:30338) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
0|bot      |     at node:punycode:5:10
0|bot      |     at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:312:7)
0|bot      |     at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:252:10)
0|bot      |     at loadNativeModule (node:internal/modules/cjs/helpers:49:9)
0|bot      |     at Function.Module._load (node:internal/modules/cjs/loader:804:15)
0|bot      |     at Module.require (node:internal/modules/cjs/loader:1005:19)
0|bot      |     at require (node:internal/modules/cjs/helpers:102:18)
0|bot      |     at Object.<anonymous> (/root/Adachi-BOT/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
0|bot      |     at Module._compile (node:internal/modules/cjs/loader:1101:14)
0|bot      |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
0|bot      | (node:30883) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
0|bot      |     at node:punycode:5:10
0|bot      |     at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:312:7)
0|bot      |     at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:252:10)
0|bot      |     at loadNativeModule (node:internal/modules/cjs/helpers:49:9)
0|bot      |     at Function.Module._load (node:internal/modules/cjs/loader:804:15)
0|bot      |     at Module.require (node:internal/modules/cjs/loader:1005:19)
0|bot      |     at require (node:internal/modules/cjs/helpers:102:18)
0|bot      |     at Object.<anonymous> (/root/Adachi-BOT/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
0|bot      |     at Module._compile (node:internal/modules/cjs/loader:1101:14)
0|bot      |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
0|bot      | (node:31393) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
0|bot      |     at node:punycode:5:10
0|bot      |     at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:312:7)
0|bot      |     at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:252:10)
0|bot      |     at loadNativeModule (node:internal/modules/cjs/helpers:49:9)
0|bot      |     at Function.Module._load (node:internal/modules/cjs/loader:804:15)
0|bot      |     at Module.require (node:internal/modules/cjs/loader:1005:19)
0|bot      |     at require (node:internal/modules/cjs/helpers:102:18)
0|bot      |     at Object.<anonymous> (/root/Adachi-BOT/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
0|bot      |     at Module._compile (node:internal/modules/cjs/loader:1101:14)
0|bot      |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
0|bot      | app.js: 机器人异常退出!
0|bot      | (node:762) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
0|bot      |     at node:punycode:5:10
0|bot      |     at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:312:7)
0|bot      |     at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:252:10)
0|bot      |     at loadNativeModule (node:internal/modules/cjs/helpers:49:9)
0|bot      |     at Function.Module._load (node:internal/modules/cjs/loader:804:15)
0|bot      |     at Module.require (node:internal/modules/cjs/loader:1005:19)
0|bot      |     at require (node:internal/modules/cjs/helpers:102:18)
0|bot      |     at Object.<anonymous> (/root/Adachi-BOT/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
0|bot      |     at Module._compile (node:internal/modules/cjs/loader:1101:14)
0|bot      |     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

@Arondight
Copy link
Owner

拉取更新后bot似乎无法启动了,报错日志如下

npm install

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 5, 2022

试了好几遍npm install && npm run restart,还是无法启动

@Arondight
Copy link
Owner

试了好几遍npm install && npm run restart,还是无法启动

npm install

npm run stop

npm run init

看一下正常起来了没

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 5, 2022

还是失败了,报错内容如下:

……
[2022-08-05T16:42:33.038] [DEBUG] [iMac:0000] - 配置:默认打开权限 reply_auth 。
[2022-08-05T16:42:33.038] [DEBUG] [iMac:0000] - 配置:默认打开权限 query_gameinfo_auth 。
[2022-08-05T16:42:33.049] [DEBUG] [iMac:0000] - 浏览器:正在从 /usr/lib/chromium/chromium 拉起实例。
(node:3209) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    at node:punycode:5:10
    at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:312:7)
    at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:252:10)
    at loadNativeModule (node:internal/modules/cjs/helpers:49:9)
    at Function.Module._load (node:internal/modules/cjs/loader:804:15)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/root/Adachi-BOT/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

@Arondight
Copy link
Owner

还是失败了,报错内容如下:

这个不是错误,是有个 oicq 代码用了一个 deprecated 的函数,如果你卡在这儿了,那就是浏览器没起来

@Arondight
Copy link
Owner

是有个 oicq 代码用了一个 deprecated 的函数

我看了下是因为低版本的 node-fetch 引入了一个过时版本的库

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 5, 2022

我看了下是因为低版本的 node-fetch 引入了一个过时版本的库

抱歉,我还是没有太理解,这一部分内容可以再解释地详细一些吗?我刚才尝试将node更新至最新版,但启动时还是遇到了相同的问题。

@Arondight
Copy link
Owner

抱歉,我还是没有太理解

就是说这个问题可以忽略,这只是警告,不是错误

@Arondight
Copy link
Owner

我看了下是因为低版本的 node-fetch 引入了一个过时版本的库

larsgw/sync-fetch#29

@Arondight
Copy link
Owner

Arondight commented Aug 5, 2022

如果还有问题麻烦回复一下,我回滚一下代码,看上去 sync-fetch 的作者不太能短时间内搞定这个问题

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 5, 2022

要不还是先回滚吧,辛苦您了

@Arondight
Copy link
Owner

要不还是先回滚吧,辛苦您了

你是 bot 起不来吗,不应该有这个问题的,另外你可以本地回滚,git reset --hard a5738c6e4e5d7b7d13d6dddf38d7dda474b86019

@Arondight
Copy link
Owner

我不知道你在哪里出了问题,不过我在 Linux 和 Windows 都正常,你如果卡在 larsgw/sync-fetch#29 就很奇怪,如果是还遇到了这个 issue 反映的问题,那我在主线回滚一下

> adachi-bot@1.5.3 init
> node --pending-deprecation --trace-warnings --max-http-header-size=2097152 ./app.js

app.js:
app.js:                █████                    █████       ███             █████               █████
app.js:               ░░███                    ░░███       ░░░             ░░███               ░░███
app.js:   ██████    ███████   ██████    ██████  ░███████   ████             ░███████   ██████  ███████
app.js:  ░░░░░███  ███░░███  ░░░░░███  ███░░███ ░███░░███ ░░███  ██████████ ░███░░███ ███░░███░░░███░
app.js:   ███████ ░███ ░███   ███████ ░███ ░░░  ░███ ░███  ░███ ░░░░░░░░░░  ░███ ░███░███ ░███  ░███
app.js:  ███░░███ ░███ ░███  ███░░███ ░███  ███ ░███ ░███  ░███             ░███ ░███░███ ░███  ░███ ███
app.js: ░░████████░░████████░░████████░░██████  ████ █████ █████            ████████ ░░██████   ░░█████
app.js:  ░░░░░░░░  ░░░░░░░░  ░░░░░░░░  ░░░░░░  ░░░░ ░░░░░ ░░░░░            ░░░░░░░░   ░░░░░░     ░░░░░
app.js:
app.js:
app.js:
app.js:                         项目主页:https://github.com/Arondight/Adachi-BOT
app.js:
app.js: 正在从 F:\Repo\Arondight\Adachi-BOT\server.js 拉起文件服务器。
app.js: 正在从 F:\Repo\Arondight\Adachi-BOT\bot.js 拉起机器人。
[2022-08-05T17:40:23.185] [MARK] [iPad:1850039128] - ----------
[2022-08-05T17:40:23.188] [MARK] [iPad:1850039128] - Package Version: oicq@2.3.1 (Released on 2022/6/21)
[2022-08-05T17:40:23.188] [MARK] [iPad:1850039128] - View Changelogs:https://github.com/takayama-lily/oicq/releases
[2022-08-05T17:40:23.188] [MARK] [iPad:1850039128] - ----------
[2022-08-05T17:40:23.188] [DEBUG] [iPad:1850039128] - 配置:加载了 2 条 Cookie 。
[2022-08-05T17:40:23.189] [DEBUG] [iPad:1850039128] - 配置:登录账号 1850039128 。
[2022-08-05T17:40:23.189] [DEBUG] [iPad:1850039128] - 配置:管理者已设置为 835158237 、 992737446 。
[2022-08-05T17:40:23.189] [DEBUG] [iPad:1850039128] - 配置:所有的消息都将被视为命令。
[2022-08-05T17:40:23.189] [DEBUG] [iPad:1850039128] - 配置:允许用户 @ 机器人。
[2022-08-05T17:40:23.190] [DEBUG] [iPad:1850039128] - 配置:群回复将会 @ 用户。
[2022-08-05T17:40:23.190] [DEBUG] [iPad:1850039128] - 配置:群消息复读的概率为 0.25% 。
[2022-08-05T17:40:23.190] [DEBUG] [iPad:1850039128] - 配置:上线发送群通知。
[2022-08-05T17:40:23.190] [DEBUG] [iPad:1850039128] - 配置:向新群友问好。
[2022-08-05T17:40:23.190] [DEBUG] [iPad:1850039128] - 配置:向新好友问好。
[2022-08-05T17:40:23.190] [DEBUG] [iPad:1850039128] - 配置:推送米游社新闻。
[2022-08-05T17:40:23.191] [DEBUG] [iPad:1850039128] - 配置:米游社新闻推送类型为 announcement 、 event 、 information。
[2022-08-05T17:40:23.191] [DEBUG] [iPad:1850039128] - 配置:角色查询尝试更新玩家信息。
[2022-08-05T17:40:23.191] [DEBUG] [iPad:1850039128] - 配置:耗时操作前不发送提示。
[2022-08-05T17:40:23.191] [DEBUG] [iPad:1850039128] - 配置:用户每隔 0 秒可以使用一次机器人。
[2022-08-05T17:40:23.191] [DEBUG] [iPad:1850039128] - 配置:115 秒后尝试撤回机器人发送的群消息
[2022-08-05T17:40:23.191] [DEBUG] [iPad:1850039128] - 配置:广播中消息间时延 0.20 秒。
[2022-08-05T17:40:23.191] [DEBUG] [iPad:1850039128] - 配置:深渊记录将缓存 1 小时。
[2022-08-05T17:40:23.191] [DEBUG] [iPad:1850039128] - 配置:玩家信息将缓存 1 小时。
[2022-08-05T17:40:23.191] [DEBUG] [iPad:1850039128] - 配置:清理数据库 aby 中超过 1 小时的记录。
[2022-08-05T17:40:23.191] [DEBUG] [iPad:1850039128] - 配置:清理数据库 info 中超过 168 小时的记录。
[2022-08-05T17:40:23.192] [DEBUG] [iPad:1850039128] - 配置:使用前端调试模式。
[2022-08-05T17:40:23.192] [DEBUG] [iPad:1850039128] - 配置:不保存图片。
[2022-08-05T17:40:23.192] [DEBUG] [iPad:1850039128] - 配置:默认打开权限 artifact_auth 。
[2022-08-05T17:40:23.192] [DEBUG] [iPad:1850039128] - 配置:默认打开权限 character_overview_auth 。
[2022-08-05T17:40:23.192] [DEBUG] [iPad:1850039128] - 配置:默认打开权限 feedback_auth 。
[2022-08-05T17:40:23.192] [DEBUG] [iPad:1850039128] - 配置:默认打开权限 fun_auth 。
[2022-08-05T17:40:23.192] [DEBUG] [iPad:1850039128] - 配置:默认打开权限 gacha_auth 。
[2022-08-05T17:40:23.192] [DEBUG] [iPad:1850039128] - 配置:默认打开权限 music_auth 。
[2022-08-05T17:40:23.192] [DEBUG] [iPad:1850039128] - 配置:默认打开权限 rating_auth 。
[2022-08-05T17:40:23.193] [DEBUG] [iPad:1850039128] - 配置:默认打开权限 mys_news_auth 。
[2022-08-05T17:40:23.193] [DEBUG] [iPad:1850039128] - 配置:默认打开权限 qa_auth 。
[2022-08-05T17:40:23.193] [DEBUG] [iPad:1850039128] - 配置:默认打开权限 reply_auth 。
[2022-08-05T17:40:23.193] [DEBUG] [iPad:1850039128] - 配置:默认打开权限 query_gameinfo_auth 。
[2022-08-05T17:40:23.198] [DEBUG] [iPad:1850039128] - 浏览器:正在从 C:\Program Files\Google\Chrome\Application\chrome.exe 拉起实例。
(node:26252) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    at node:punycode:5:10
    at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:312:7)
    at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:252:10)
    at loadNativeModule (node:internal/modules/cjs/helpers:49:9)
    at Function.Module._load (node:internal/modules/cjs/loader:804:15)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (F:\Repo\Arondight\Adachi-BOT\node_modules\whatwg-url\lib\url-state-machine.js:2:18)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
[2022-08-05T17:40:25.202] [DEBUG] [iPad:1850039128] - 卡池:内容已刷新。
[2022-08-05T17:40:25.203] [DEBUG] [iPad:1850039128] - 清理:删除数据库 aby 中 1 条无用记录。
[2022-08-05T17:40:25.216] [DEBUG] [iPad:1850039128] - 清理:删除数据库 cookies 中 0 条无用记录。
[2022-08-05T17:40:25.216] [DEBUG] [iPad:1850039128] - 清理:删除数据库 cookies_invalid 中 0 条无用记录。
[2022-08-05T17:40:25.216] [DEBUG] [iPad:1850039128] - 清理:删除数据库 info 中 0 条无用记录。
[2022-08-05T17:40:25.218] [DEBUG] [iPad:1850039128] - 同步:将数据库 aby 缓存写入到磁盘。
[2022-08-05T17:40:25.219] [DEBUG] [iPad:1850039128] - 同步:将数据库 artifact 缓存写入到磁盘。
[2022-08-05T17:40:25.220] [DEBUG] [iPad:1850039128] - 同步:将数据库 authority 缓存写入到磁盘。
[2022-08-05T17:40:25.221] [DEBUG] [iPad:1850039128] - 同步:将数据库 character 缓存写入到磁盘。
[2022-08-05T17:40:25.222] [DEBUG] [iPad:1850039128] - 同步:将数据库 cookies 缓存写入到磁盘。
[2022-08-05T17:40:25.223] [DEBUG] [iPad:1850039128] - 同步:将数据库 cookies_invalid 缓存写入到磁盘。
[2022-08-05T17:40:25.225] [DEBUG] [iPad:1850039128] - 同步:将数据库 gacha 缓存写入到磁盘。
[2022-08-05T17:40:25.226] [DEBUG] [iPad:1850039128] - 同步:将数据库 info 缓存写入到磁盘。
[2022-08-05T17:40:25.227] [DEBUG] [iPad:1850039128] - 同步:将数据库 map 缓存写入到磁盘。
[2022-08-05T17:40:25.228] [DEBUG] [iPad:1850039128] - 同步:将数据库 music 缓存写入到磁盘。
[2022-08-05T17:40:25.231] [DEBUG] [iPad:1850039128] - 同步:将数据库 news 缓存写入到磁盘。
[2022-08-05T17:40:25.232] [DEBUG] [iPad:1850039128] - 同步:将数据库 time 缓存写入到磁盘。
[2022-08-05T17:40:25.478] [DEBUG] [iPad:1850039128] - 插件:加载 aby 成功。
[2022-08-05T17:40:25.574] [DEBUG] [iPad:1850039128] - 插件:加载 artifacts 成功。
[2022-08-05T17:40:25.654] [DEBUG] [iPad:1850039128] - 插件:加载 card 成功。
[2022-08-05T17:40:25.912] [DEBUG] [iPad:1850039128] - 插件:加载 character 成功。
[2022-08-05T17:40:26.010] [DEBUG] [iPad:1850039128] - 插件:加载 gacha 成功。
[2022-08-05T17:40:26.028] [DEBUG] [iPad:1850039128] - 插件:加载 master 成功。
[2022-08-05T17:40:26.049] [DEBUG] [iPad:1850039128] - 插件:加载 material 成功。
[2022-08-05T17:40:26.097] [DEBUG] [iPad:1850039128] - 插件:加载 music 成功。
[2022-08-05T17:40:26.145] [DEBUG] [iPad:1850039128] - 插件:加载 overview 成功。
[2022-08-05T17:40:26.186] [DEBUG] [iPad:1850039128] - 插件:加载 package 成功。
[2022-08-05T17:40:26.340] [DEBUG] [iPad:1850039128] - 插件:加载 rating 成功。
[2022-08-05T17:40:26.344] [DEBUG] [iPad:1850039128] - 插件:加载 save 成功。
[2022-08-05T17:40:26.359] [DEBUG] [iPad:1850039128] - 插件:加载 tools 成功。
[2022-08-05T17:40:27.249] [DEBUG] [iPad:1850039128] - 插件:加载 tools_master 成功。
[2022-08-05T17:40:27.478] [MARK] [iPad:1850039128] - 111.30.170.211:8080 connected
[2022-08-05T17:40:27.658] [MARK] [iPad:1850039128] - Welcome, 小小派蒙 ! 正在加载资源...
[2022-08-05T17:40:27.992] [MARK] [iPad:1850039128] - 加载了4个好友,1个群,0个陌生人

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 5, 2022

直接卡在浏览器拉起实例这一步了,直到我ctrl+c退出,都没有继续加载。
会是系统变量的问题吗?出现系统资源占用异常的问题后,我改过一次系统变量,直接修改了bashrc,将chromium的ELF路径改为与 #465 一致,保存退出后输入了source ~./bashrc使修改生效。

@Arondight
Copy link
Owner

直接卡在浏览器拉起实例这一步了

是不是拉卡池超时了,在 bot 的机器上跑一下俩命令看看能很快出来么

curl https://webstatic.mihoyo.com/hk4e/gacha_info/cn_gf01/gacha/list.json
curl https://webstatic.mihoyo.com/hk4e/gacha_info/cn_gf01/fecafa7b6560db5f3182222395d88aaa6aaac1bc/zh-cn.json

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 5, 2022

emmm.....瞬间就出结果了

@Arondight
Copy link
Owner

你本地先回滚吧,能用再说,回滚之后记得 npm install

#872 (comment)

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 5, 2022

辛苦了,大概率是我的机器出了点问题chromium无法拉起,导致无法继续启动

@Nigel-NI
Copy link
Author

Nigel-NI commented Aug 5, 2022

辛苦了,大概率是我的机器出了点问题chromium无法拉起,导致无法继续启动

因为回滚之后还是卡在相同的位置

@Arondight
Copy link
Owner

因为回滚之后还是卡在相同的位置

重启解决一切问题,如果可以的话还是 git pull; npm install 更新代码,测试一下新代码看看有没有这个 issue 的问题吧,我也不确定能不能解决,我只是觉得可能有关联

@Arondight
Copy link
Owner

不对啊,你的这个 issue 里贴的代码和你的提交对不上啊,提交是很新的提交,但是看代码的报错,是很久的了

Arondight added a commit that referenced this issue Aug 5, 2022
@Arondight
Copy link
Owner

我在主线回滚了,我觉得这个 issue 的错误日志和提交是不匹配的,不能当做 debug 的依据,所以根据日志分析得出的结论不可靠,对应的提交也应当回退,你愿意的话可以本地继续测试一下

@Arondight Arondight added the question Further information is requested label Aug 5, 2022
@Arondight
Copy link
Owner

目前这个 issue 所有的日志都是和现象不匹配的,这些错误应该发生在很久之前,如果出现频繁的卡顿,有可能是浏览器自身的原因,目前我做不了什么,假设计算浏览器的 object 设置超额重启也会遇到其他的问题,继续观望一下是否也有人遇到这个问题吧

@Arondight
Copy link
Owner

版本更新后,你的定时任务记得改一下

npm run update && npm run restart

如果还有死机问题回复一下

@Nigel-NI
Copy link
Author

Nigel-NI commented Sep 8, 2022

好的,谢谢

@Nigel-NI Nigel-NI closed this as completed Sep 8, 2022
@Arondight
Copy link
Owner

这个问题没了?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants