官Q发图错误(不急到是不是插件的问题)-- 官方机器人`Bad Request`、`Internal Server Error` 报错汇总

在使用ba-plugin发送模拟抽卡图片以及活动日程时出现了如下报错,然而抽漫画与关卡指令却可以正确发送图片
补充:沙盒可以正常发送

session Error: Bad Request
at [cordis.invoke] (/koishi/node_modules/@cordisjs/plugin-http/lib/index.cjs:340:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async [as sendFileGuild] (/koishi/node_modules/@satorijs/adapter-qq/lib/index.cjs:595:32)
at async QQMessageEncoder.sendFile (/koishi/node_modules/@satorijs/adapter-qq/lib/index.cjs:1075:15)
at async QQMessageEncoder.visit (/koishi/node_modules/@satorijs/adapter-qq/lib/index.cjs:1134:20)
at async QQMessageEncoder.render (/koishi/node_modules/@satorijs/core/lib/index.cjs:729:7)
at async QQMessageEncoder.send (/koishi/node_modules/@satorijs/core/lib/index.cjs:755:5)
at async Proxy.sendMessage (/koishi/node_modules/@satorijs/core/lib/index.cjs:486:22)
at async /koishi/node_modules/@koishijs/core/lib/index.cjs:2068:7
at async Proxy.withScope (/koishi/node_modules/@koishijs/core/lib/index.cjs:1975:22)

2 个赞

建议先检查图片链接是否可用,其次检查网络带宽,上行是否够用

这个错误往往是腾讯限制上传时间导致的


你在koishi沙盒是不可能复现的


插件按理来说没问题

AL1S类机器人使用的就是ba-plugin

而且也经常看见不同插件发送的此类bad request日志


已经存在的类似issue

2 个赞

可恶的腾讯居然限制这点上传时间,服务器是华为2核2g2m,可能确实是因为上行有点慢导致的(

2 个赞

我这里遇到的 bad request 一般是这样:

其中 请求数据过大,读取超时 一般就是因为上传超时了

请求数据过大,读取超时

图片过大,没有完整上传成功


{ response: { data: { message: '请求数据过大,读取超时', code: 10998, err_code: 40011024, trace_id: '6b21275a44c51d2cfeb2733bae86160a' }, url: 'https://api.sgroup.qq.com/channels/***********/messages', status: 400, statusText: 'Bad Request', headers: Headers { date: 'Wed, 05 Feb 2025 06:37:41 GMT', 'content-type': 'application/json', 'content-length': '126', connection: 'keep-alive', 'x-tps-trace-id': '6b21275a44c51d2cfeb2733bae86160a', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'access-control-allow-headers': 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,authorization' } }, code: undefined, [Symbol(cordis.http.error)]: true }

消息发送失败,机器人非群成员

{ response: { data: { message: '消息发送失败,机器人非群成员', code: 11293, err_code: 40034101, trace_id: 'b9fd6e2c5c5a03379dfd91fb1a5e58fd' }, url: 'https://api.sgroup.qq.com/v2/groups/9DC3F2E1560249FDF8DED212A46FA42C/messages', status: 400, statusText: 'Bad Request', headers: Headers { date: 'Tue, 11 Feb 2025 09:20:08 GMT', 'content-type': 'application/json', 'content-length': '135', connection: 'keep-alive', 'x-tps-trace-id': 'b9fd6e2c5c5a03379dfd91fb1a5e58fd', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'access-control-allow-headers': 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,authorization' } }, code: undefined, [Symbol(cordis.http.error)]: true }

消息被去重,请检查请求msgseq

诶? 宋娜…

{ response: { data: { message: '消息被去重,请检查请求msgseq', code: 40054005, err_code: 40054005, trace_id: '261aef1dee3d9c5feae4e50a130bc2f4' }, url: 'https://api.sgroup.qq.com/v2/groups/0FEC874B2F0C63A368DC7C08799700DD/messages', status: 400, statusText: 'Bad Request', headers: Headers { date: 'Sun, 16 Feb 2025 09:46:20 GMT', 'content-type': 'application/json', 'content-length': '135', connection: 'keep-alive', 'x-tps-trace-id': '261aef1dee3d9c5feae4e50a130bc2f4', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'access-control-allow-headers': 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,authorization' } }, code: undefined, [Symbol(cordis.http.error)]: true }



在我这里,Internal Server Error 更为常见

msg repeated

消息重复了


{ response: { data: { code: 1100000, message: 'msg repeated', err_code: 1100000, trace_id: 'bc04a502f505e1187c7de8344ec60fbd' }, url: 'https://api.sgroup.qq.com/channels/***********/messages', status: 500, statusText: 'Internal Server Error', headers: Headers { date: 'Wed, 05 Feb 2025 07:09:30 GMT', 'content-type': 'application/json', 'content-length': '106', connection: 'keep-alive', 'x-content-type-options': 'nosniff', 'x-tps-trace-id': 'bc04a502f505e1187c7de8344ec60fbd', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'access-control-allow-headers': 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,authorization' } }, code: undefined, [Symbol(cordis.http.error)]: true }

type:business, code:4, msg:null

发消息频率太高了?


{ response: { data: { code: 2000000, message: 'type:business, code:4, msg:null', err_code: 2000000, trace_id: '5193fb02c725a995ba40efa01af18362' }, url: 'https://api.sgroup.qq.com/channels/***********/messages', status: 500, statusText: 'Internal Server Error', headers: Headers { date: 'Wed, 05 Feb 2025 07:08:51 GMT', 'content-type': 'application/json', 'content-length': '125', connection: 'keep-alive', 'x-content-type-options': 'nosniff', 'x-tps-trace-id': '5193fb02c725a995ba40efa01af18362', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'access-control-allow-headers': 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,authorization' } }, code: undefined, [Symbol(cordis.http.error)]: true }

file size exceeded

图片文件过大,可能是抽到了10MB这样的图?

{ response: { data: { message: 'file size exceeded', code: 304020, err_code: 304020, trace_id: '6b48b4a1c84ad594f7b8ae1817acbe2a' }, url: 'https://api.sgroup.qq.com/channels/************/messages', status: 500, statusText: 'Internal Server Error', headers: Headers { date: 'Fri, 07 Feb 2025 17:43:14 GMT', 'content-type': 'application/json', 'content-length': '110', connection: 'keep-alive', 'x-tps-trace-id': '6b48b4a1c84ad594f7b8ae1817acbe2a', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'access-control-allow-headers': 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,authorization' } }, code: undefined, [Symbol(cordis.http.error)]: true }

hit rate limit

命中率限制?

{ response: { data: { code: 20028, message: 'hit rate limit', err_code: 20028, trace_id: 'a36a2a59bf0037b7ae5123066d104204' }, url: 'https://api.sgroup.qq.com/channels/*******/messages', status: 500, statusText: 'Internal Server Error', headers: Headers { date: 'Sat, 15 Feb 2025 17:55:38 GMT', 'content-type': 'application/json', 'content-length': '104', connection: 'keep-alive', 'x-content-type-options': 'nosniff', 'x-tps-trace-id': 'a36a2a59bf0037b7ae5123066d104204', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'access-control-allow-headers': 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,authorization' } }, code: undefined, [Symbol(cordis.http.error)]: true }

token not exist or expire

token 过期?

{ response: { data: { message: 'token not exist or expire', code: 11244, err_code: 11244, trace_id: '3b30f93e5f72f938a5aab09bb836ae26' }, url: 'https://api.sgroup.qq.com/channels/*******/messages', status: 500, statusText: 'Internal Server Error', headers: Headers { date: 'Sat, 15 Feb 2025 17:36:01 GMT', 'content-type': 'application/json', 'content-length': '115', connection: 'keep-alive', 'x-tps-trace-id': '3b30f93e5f72f938a5aab09bb836ae26', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'access-control-allow-headers': 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,authorization' } }, code: undefined, [Symbol(cordis.http.error)]: true }

invalid request

嗯?

{ response: { data: { message: 'invalid request', code: 11255, err_code: 11255, trace_id: '12a1626f7aaefca81a228f5fde04b8e0' }, url: 'https://api.sgroup.qq.com/v2/groups/3A09BEBD54A24555674785B404282501/messages', status: 500, statusText: 'Internal Server Error', headers: Headers { date: 'Tue, 18 Feb 2025 10:31:16 GMT', 'content-type': 'application/json', 'content-length': '105', connection: 'keep-alive', 'x-tps-trace-id': '12a1626f7aaefca81a228f5fde04b8e0', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'access-control-allow-headers': 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,authorization' } }, code: undefined, [Symbol(cordis.http.error)]: true }

系统繁忙,请稍后重试

嗯?

{ response: { data: { message: '系统繁忙,请稍后重试', code: 50015005, err_code: 50015005, trace_id: '0bf620e925559b208b7772c6c6292fb6' }, url: 'https://api.sgroup.qq.com/channels/599830645/messages', status: 500, statusText: 'Internal Server Error', headers: Headers { date: 'Tue, 04 Mar 2025 16:56:05 GMT', 'content-type': 'application/json', 'content-length': '126', connection: 'keep-alive', 'x-tps-trace-id': '0bf620e925559b208b7772c6c6292fb6', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'access-control-allow-headers': 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,authorization' } }, code: undefined, [Symbol(cordis.http.error)]: true }

还有 罕见的的情况

Not Found

不支持的调用

{ response: { data: { message: '不支持的调用', code: 11001, err_code: 40011002, trace_id: '421ba310a850c439e2a44037d1a01e1a' }, url: 'https://api.sgroup.qq.com/v2/users/E439066E62B94EDD0F4E1C46FC6339F0/messages/', status: 404, statusText: 'Not Found', headers: Headers { date: 'Tue, 04 Mar 2025 16:37:17 GMT', 'content-type': 'application/json', 'content-length': '111', connection: 'keep-alive', 'x-tps-trace-id': '421ba310a850c439e2a44037d1a01e1a', 'access-control-allow-credentials': 'true', 'access-control-allow-methods': 'GET, POST, OPTIONS', 'access-control-allow-headers': 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,authorization' } }, code: undefined, [Symbol(cordis.http.error)]: true }
1 个赞