whyour / qinglong

支持 Python3、JavaScript、Shell、Typescript 的定时任务管理平台(Timed task management platform supporting Python3, JavaScript, Shell, Typescript)
https://qinglong.online
Apache License 2.0
15.66k stars 2.91k forks source link

一段时间后就会报错不运行 #2361

Closed hejun041 closed 2 months ago

hejun041 commented 3 months ago

Qinglong version

2.17.3

Steps to reproduce

jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null)

What is expected?

每次更新最新版本也是一样,大约一个月一两次

What is actually happening?

jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) image image image 执行ql check 也是一堆正常 root@armbian:~/docker/ql# docker exec -it ql_web_1 ql check

开始执行... 2024-05-13 09:10:57

=====> 开始检测 npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

removed 1 package, and changed 167 packages in 2m

17 packages are looking for funding run npm fund for details ---> 1. 开始检测配置文件

---> 配置文件检测完成

---> 2. 开始安装青龙依赖

安装 /ql 依赖包...

Packages are hard linked from the content-addressable store to the virtual store. Content-addressable store is at: /root/.local/share/pnpm/store/v3 Virtual store is at: node_modules/.pnpm

╭─────────────────────────────────────────────────────────────────╮ │ │ │ Update available! 8.3.1 → 9.1.1. │ │ Changelog: https://github.com/pnpm/pnpm/releases/tag/v9.1.1 │ │ Run "pnpm add -g pnpm" to update. │ │ │ │ Follow @pnpmjs for updates: https://twitter.com/pnpmjs │ │ │ ╰─────────────────────────────────────────────────────────────────╯

.../node_modules/protobufjs postinstall$ node scripts/postinstall .../node_modules/protobufjs postinstall: Done .../node_modules/@whyour/sqlite3 install$ node-pre-gyp install --fallback-to-build .../node_modules/@whyour/sqlite3 install: [@whyour/sqlite3] Success: "/ql/node_modules/.pnpm/github.com+whyour+node-sqlite3@3a00af0b5d7603b7f1b290032507320b18a6b741/node_modules/@whyour/sqlite3/lib/binding/napi-v6-linux-arm64/node_sqlite3.node" is installed via remote .../node_modules/@whyour/sqlite3 install: Done

dependencies:

devDependencies: skipped

@ postinstall /ql max setup 2>/dev/null || true

Done in 43.4s ---> 青龙依赖安装完成

---> 脚本依赖安装完成

---> 1. 复制通知文件

---> 复制一份 /ql/sample/notify.py 为 /ql/data/scripts/notify.py

'/ql/sample/notify.py' -> '/ql/data/scripts/notify.py'

---> 复制一份 /ql/sample/notify.js 为 /ql/data/scripts/sendNotify.js

'/ql/sample/notify.js' -> '/ql/data/scripts/sendNotify.js' ---> 通知文件复制完成

---> 2. 复制nginx配置文件

'/ql/docker/nginx.conf' -> '/etc/nginx/nginx.conf' '/ql/docker/front.conf' -> '/etc/nginx/conf.d/front.conf' ---> 配置文件复制完成

=====> 检测面板

<!DOCTYPE html>

=====> 面板服务启动正常 =====> 检测nginx服务 56 nginx: master process nginx -c /etc/nginx/nginx.conf 57 nginx: worker process 58 nginx: worker process 59 nginx: worker process 60 nginx: worker process =====> nginx服务正常 ---> pm2日志 2024-04-20T20:06:49: ✌️ DB loaded 2024-04-20T20:06:49: ✌️ Init file down 2024-04-20T20:06:49: ✌️ Sentry loaded 2024-04-20T20:06:51: ✌️ Dependency Injector loaded 2024-04-20T20:06:52: ✌️ Express loaded 2024-04-20T20:06:52: ✌️ init data loaded 2024-04-20T20:06:52: ✌️ link deps loaded 2024-04-20T20:06:52: ✌️ init task loaded 2024-04-20T20:06:53: ✌️ 后端服务启动成功! =====> 检测后台 {"code":200,"data":{"isInitialized":true,"version":"2.17.3","publishTime":1711726200,"branch":"master","changeLog":"1. python 通知文件支持自定义参数,可由每个脚本控制通知参数配置 2. ql repo 命令复制仓库任务时,保留仓库脚本原始目录层级 3. 修改自定义通知 body 解析逻辑 4. 修改系统重启逻辑 5. 修改 latest 基础镜像 node 版本为 v20 ","changeLogLink":"https://t.me/jiao_long/404"}} =====> 后台服务启动正常 [PM2] Applying action reloadProcessId on app [update](ids: [ 0 ]) [PM2] [update](0) ✓ ┌────┬─────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐ │ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ ├────┼─────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤ │ 3 │ panel │ default │ N/A │ fork │ 158 │ 22D │ 0 │ online │ 1.4% │ 124.8mb │ root │ disabled │ │ 2 │ public │ default │ N/A │ fork │ 127 │ 22D │ 0 │ online │ 1.2% │ 92.5mb │ root │ disabled │ │ 1 │ schedule │ default │ N/A │ fork │ 126 │ 22D │ 0 │ online │ 0.8% │ 87.9mb │ root │ disabled │ │ 0 │ update │ default │ N/A │ fork │ 3098302 │ 4s │ 1 │ online │ 0% │ 90.6mb │ root │ disabled │ └────┴─────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘ [PM2] Applying action reloadProcessId on app [schedule](ids: [ 1 ]) [PM2] Applying action reloadProcessId on app [public](ids: [ 2 ]) [PM2] [schedule](1) ✓ [PM2] Applying action reloadProcessId on app [panel](ids: [ 3 ]) [PM2] [public](2) ✓ [PM2] [panel](3) ✓ ┌────┬─────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐ │ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ ├────┼─────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤ │ 3 │ panel │ default │ N/A │ fork │ 3098386 │ 8s │ 1 │ online │ 0% │ 109.3mb │ root │ disabled │ │ 2 │ public │ default │ N/A │ fork │ 3098354 │ 13s │ 1 │ online │ 0% │ 96.6mb │ root │ disabled │ │ 1 │ schedule │ default │ N/A │ fork │ 3098353 │ 13s │ 1 │ online │ 12.8% │ 91.9mb │ root │ disabled │ │ 0 │ update │ default │ N/A │ fork │ 3098302 │ 20s │ 1 │ online │ 0.3% │ 92.0mb │ root │ disabled │ └────┴─────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘ =====> 检测结束 ## 执行结束... 2024-05-13 09:14:12 耗时 195 秒 设置-系统日志也是一切正常 ### System Info _No response_ ### Any additional comments? _No response_
whyour commented 3 months ago

报错来源是哪里

hejun041 commented 3 months ago

脚本内,所有脚本开头都是这个错,其他功能正常 容器一般是正常情况都不会重启,大概一两个月就会复现一次 有些时候执行ql check依然问题存在,这次是ql check之后就正常了 我容器内也只有两个正常的脚本,没有其他定时任务 重新docker-compose pull stop 再重新启动才行,或者从新进bash 里面重新安装一下pnpm i pnpm日志有些时候看到是node_sqlite3这个安装失败

whyour commented 3 months ago

手动运行任务会有这个提示吗,看样子像是自动执行任务的时候,更新任务状态报错了

hejun041 commented 3 months ago

手动运行好像也是一样的

hejun041 commented 3 months ago

今天凌晨又复现了 这是脚本内部日志

开始执行... 2024-06-02 23:58:40

jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null) jq: error (at :1): Cannot iterate over null (null)

优先固定账号数量不得大于或等于有效账号总量,本次暂不重组 Cookie ...

变量PHONE_NUM共配置0条CK,请添加环境变量,或查看环境变量状态 未填写环境变量 PHONE_NUM 请添加

钉钉机器人 服务启动 PUSHPLUS 服务启动 PUSHPLUS 推送失败! 钉钉机器人 推送成功!

执行结束... 耗时 1 秒  

早上重新执行又成功了

whyour commented 3 months ago

这个貌似是你自己脚本里用了 jq,打印开始执行前,内置的jq已经执行完了

hejun041 commented 3 months ago

我看task_before.sh里面好像是有jq相关的执行,应该怎么处理呢

whyour commented 2 months ago

你的代码,你想怎么处理都行

hejun041 commented 2 months ago

感谢大佬的回复!