You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

本地网络/互联网连接出现GraphQL请求间歇性失败异常问题求助

本地网络/互联网连接出现GraphQL请求间歇性失败异常问题求助

我最近碰到了本地网络和互联网连接的怪事——有些请求会毫无缘由地失败。家里不同设备都出现了这个情况,但换成其他网络就完全正常。

具体症状如下:

  • GraphQL请求会间歇性失败,仅针对特定服务器,比如调用DatoCMS的GraphQL接口:
curl 'https://graphql.datocms.com/' \
    -H 'Authorization: 12345' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    --data-binary '{ "query": "query { allPosts { title } }" }'

执行后会返回:

curl: (35) Recv failure: Connection reset by peer

我反复测试的话,大概有50%的概率会失败。如果用Node.js应用来发起请求,也会间歇性抛出这个错误:

➜ node query.js
node:internal/deps/undici/undici:12502
      Error.captureStackTrace(err, this);
            ^

TypeError: fetch failed
    at node:internal/deps/undici/undici:...

备注:内容来源于stack exchange,提问作者Giraphi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.17 08:28:02