NapNeko / NapCatQQ

现代化的基于 NTQQ 的 Bot 协议端实现
https://napcat.napneko.icu
Other
2.65k stars 195 forks source link

[BUG] 使用提示超时并卡住无法运行 #2

Closed xiaozhu2007 closed 7 months ago

xiaozhu2007 commented 7 months ago

系统版本

Windows [版本 10.0.19043.928] (Windows 10 Pro 专业版)

QQNT 版本

9.9.9-240412

NapCat 版本

1.0.2

OneBot 客户端

Koishi 4.17.4 (最新) / adapter-onebot 6.5.1 (最新)

发生了什么?

无法连接 Vercel 的服务而导致脚本卡住

如何复现

  1. 在一台禁海外IP访问的Windows机器上运行ps1脚本
  2. 正常发送消息,可在后端接收到
  3. 等待超时(30s?)
  4. 抛出错误 Error: connect ETIMEDOUT 76.76.21.21:443
  5. 脚本卡住,无法继续处理新的信息。复现完成

期望的结果?

上报失败继续运行而不是卡着

NapCat 运行日志

ws 消息上报 ws://xxxxx:11451/onebot {
  status: 'ok',
  retcode: 0,
  data: { message_id: 6 },
  message: '',
  wording: '',
  echo: 10
}
node:events:495
      throw er; // Unhandled 'error' event
      ^

Error: connect ETIMEDOUT 76.76.21.21:443
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
Emitted 'error' event on ClientRequest instance at:
    at TLSSocket.socketErrorListener (node:_http_client:501:9)
    at TLSSocket.emit (node:events:517:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4039,
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '76.76.21.21',
  port: 443
}

Node.js v21.7.1

OneBot 客户端运行日志

MliKiowa commented 7 months ago

下个版本修 现在你可以尝试切换网络

xiaozhu2007 commented 7 months ago

下个版本修 现在你可以尝试切换网络

好的

MliKiowa commented 7 months ago

https://github.com/NapNeko/NapCatQQ/blob/d890b7829071ac627043cb5cf8f927d9bdf16495/src/onebot11/index.ts#L39 这一行用到了vercel用来统计登录而已

MliKiowa commented 7 months ago

已修复