chatgpt-web icon indicating copy to clipboard operation
chatgpt-web copied to clipboard

fetch failed报错

Open TheLittleB opened this issue 1 year ago • 9 comments

前端错误显示:connect() failed (111: Connection refused) while connecting to upstream 后端错误显示:TypeError: fetch failed, code: 'UND_ERR_CONNECT_TIMEOUT' 或者 code: 'ECONNRESET'

这个错误在2.10之前的版本从未出现过,包括现在也是一样。

而且这个错误出现的很奇怪, 当我部署在域名 dev.theb.ai 时,没有任何问题,但部署在 chat.theb.ai 时,就无法加载网页并报错。

使用Nginx 1.21进行反代,没有使用docker。

各位有什么主意吗?

TheLittleB avatar Mar 11 '23 13:03 TheLittleB

我也遇到了这个问题,使用的是ACCESS_TOKEN,之前都是正常的,这两天就出现这个问题了,最近没有更新过版本,结果更新以后也是这样,去了官网看了账号正常,应该是官网那边更新了什么吧

BaeKey avatar Mar 11 '23 13:03 BaeKey

我也遇到了这个问题,使用的是ACCESS_TOKEN,之前都是正常的,这两天就出现这个问题了,最近没有更新过版本,结果更新以后也是这样,去了官网看了账号正常,应该是官网那边更新了什么吧

我这个是在dev部署没问题,上chat就不行,环境是一样的,而且旧版本是没问题的,和官网没任何关系。

TheLittleB avatar Mar 11 '23 13:03 TheLittleB

TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11413:11)
    at fetchSSE (/XXXXXXX/service/node_modules/.pnpm/[email protected]/node_modules/chatgpt/build/index.js:46:15) {
  cause: Error: write EPIPE
      at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
      at __node_internal_errnoException (node:internal/errors:620:12)
      at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:94:16)
      at handleWriteReq (node:internal/stream_base_commons:51:26)
      at writeGeneric (node:internal/stream_base_commons:149:15)
      at Socket._writeGeneric (node:net:930:11)
      at Socket._write (node:net:942:8)
      at doWrite (node:internal/streams/writable:411:12)
      at clearBuffer (node:internal/streams/writable:572:7)
      at onwrite (node:internal/streams/writable:464:7)
      at WriteWrap.onWriteComplete [as oncomplete] (node:internal/stream_base_commons:106:10) {
    errno: -32,
    code: 'EPIPE',
    syscall: 'write'
  }
}

TheLittleB avatar Mar 11 '23 13:03 TheLittleB

目前也不清楚是不是流量过大导致的,但是老版本可以承载。

TheLittleB avatar Mar 11 '23 13:03 TheLittleB

目前也不清楚是不是流量过大导致的,但是老版本可以承载。

我是用docker部署的,降级到老版本也是一样的情况,API正常使用

BaeKey avatar Mar 11 '23 13:03 BaeKey

官方增加了补丁,https://github.com/transitive-bullshit/chatgpt-api/issues/461

Joyrocky avatar Mar 11 '23 15:03 Joyrocky

官方增加了补丁,transitive-bullshit/chatgpt-api#461

我之前看到了的,这个对用官方API的也有效?

TheLittleB avatar Mar 11 '23 15:03 TheLittleB

用access token同样报这个错,用api key 正常:

TypeError: fetch failed at Object.fetch (node:internal/deps/undici/undici:11413:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at fetchSSE (/app/node_modules/.pnpm/[email protected]/node_modules/chatgpt/build/index.js:46:15) { cause: Error: getaddrinfo ENOTFOUND chat.duti.tech at __node_internal_captureLargerStackTrace (node:internal/errors:490:5) at _node_internal (node:internal/errors:712:10) at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) { errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'chat.duti.tech' } } TypeError: fetch failed at Object.fetch (node:internal/deps/undici/undici:11413:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at fetchSSE (/app/node_modules/.pnpm/[email protected]/node_modules/chatgpt/build/index.js:46:15) { cause: Error: getaddrinfo ENOTFOUND chat.duti.tech at __node_internal_captureLargerStackTrace (node:internal/errors:490:5) at _node_internal (node:internal/errors:712:10) at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) { errno: -3008, code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'chat.duti.tech' }

zhychen1173 avatar Mar 11 '23 16:03 zhychen1173

官方增加了补丁,transitive-bullshit/chatgpt-api#461

尝试了,没有用,仍然是上面的code: 'EPIPE',我可以判断是web这边的问题,因为老版本的web用的也是node-chatgpt 5.0.9

TheLittleB avatar Mar 11 '23 16:03 TheLittleB