qd-today / qd

QD [v20240210] —— HTTP请求定时任务自动执行框架 base on HAR Editor and Tornado Server
https://qd-today.github.io/qd/
MIT License
4.45k stars 576 forks source link

[Bug] API调用导致任务失败 #392

Closed github-h closed 1 year ago

github-h commented 1 year ago

Verify steps

QianDao Version

20230228

Bug on OS

Linux

Bug on Platform

Docker/Linux 64位

To Reproduce

请求中加入延时API 测试任务

任务会概率性失败

Describe the Bug

图片 报错的日志

图片 模板

模板并未做任何修改 10:02和10:13 任务都失败了

随后12:31再次运行 任务成功

日志中也可以看到

初步怀疑是因为任务集中调用导致的API接口异常

因为我主要的签到请求集中在10:00-10:30这个时间段

图片

QianDao config

No response

QianDao log

[I 230317 10:01:36 tornado.access web:2271] 200 GET /util/delay/30 (127.0.0.1) 29910.40ms
[I 230317 10:01:36 tornado.access web:2271] 200 POST /util/urldecode (127.0.0.1) 1.60ms
[I 230317 10:01:36 qiandao.Worker worker:231] taskid:11 tplid:13 successed! 0.61123s
[I 230317 10:01:36 qiandao.Worker worker:234] taskid:11 tplid:13 clear log.
[I 230317 10:01:59 qiandao.Worker worker:289] Last 60 seconds, 1 task done. 1 success, 0 failed
[I 230317 10:02:07 tornado.access web:2271] 200 GET /util/delay/60 (127.0.0.1) 29903.67ms
[E 230317 10:02:10 qiandao.Worker worker:267] taskid:12 tplid:14 failed! 65.7732s
    Failed at 4/13 request,
    Fail assert: {"re": "class=\"swal2-confirm swal2-styled\" >立刻签到</button></div", "from": "content"} from failed_asserts,
    Request URL: https://www.tiangal.com/sign.html
[I 230317 10:02:59 qiandao.Worker worker:289] Last 60 seconds, 1 task done. 0 success, 1 failed
[I 230317 10:09:16 tornado.access web:2271] 200 GET /util/delay/29 (127.0.0.1) 29005.49ms
[I 230317 10:09:17 tornado.access web:2271] 200 POST /util/urldecode (127.0.0.1) 2.48ms
[I 230317 10:09:17 qiandao.Worker worker:231] taskid:3 tplid:4 successed! 30.98199s
[I 230317 10:09:17 qiandao.Worker worker:234] taskid:3 tplid:4 clear log.
[I 230317 10:09:59 qiandao.Worker worker:289] Last 60 seconds, 1 task done. 1 success, 0 failed
[I 230317 10:12:42 tornado.access web:2271] 200 GET /util/delay/30 (127.0.0.1) 29904.45ms
[I 230317 10:13:13 tornado.access web:2271] 200 GET /util/delay/60 (127.0.0.1) 29908.53ms
[E 230317 10:13:14 qiandao.Worker worker:267] taskid:12 tplid:14 failed! 64.4304s
    Failed at 4/13 request,
    Fail assert: {"re": "class=\"swal2-confirm swal2-styled\" >立刻签到</button></div", "from": "content"} from failed_asserts,
    Request URL: https://www.tiangal.com/sign.html
[I 230317 10:13:59 qiandao.Worker worker:289] Last 60 seconds, 1 task done. 0 success, 1 failed

Expected behavior

希望能修复这个概率性失败的问题

从日志看到使用延时API后 直接报错了

然后日志抛出失败 就很奇怪

Screenshots

No response

a76yyyy commented 1 year ago

这里并不是延时API的报错

github-h commented 1 year ago

这里并不是延时API的报错

那这个怎么去判断是谁的报错呢 今天又出现了

[I 230323 10:09:04 tornado.access web:2271] 200 GET /util/delay/30 (127.0.0.1) 29904.21ms
[I 230323 10:09:35 tornado.access web:2271] 200 GET /util/delay/60 (127.0.0.1) 29907.73ms
[E 230323 10:09:36 qiandao.Worker worker:267] taskid:12 tplid:14 failed! 65.2056s
    Failed at 4/13 request,
    Fail assert: {"re": "class=\"swal2-confirm swal2-styled\" >立刻签到</button></div", "from": "content"} from failed_asserts,
    Request URL: https://www.tiangal.com/sign.html

图片 图片

这是模板

a76yyyy commented 1 year ago

报错的内容是倒数第二条的失败判断

github-h commented 1 year ago

报错的内容是倒数第二条的失败判断

啊对的对的 是签到没成功导致的抛出错误