文档

边缘函数ER常见报错问题

更新时间:

禁止fetch请求ER域名自身

报错信息

@Fetch.fetch: fetch authority is same with origin authority, which is forbidden

报错原因

不允许在ER代码内fetch请求ER域名自身。例如ER域名为 1.a.com,您可以在ER代码内fetch请求1.a.com以外的域名,但您不能fetch请求1.a.com自身。

禁止使用内部状态码

报错信息

HttpBody.constructor: invalid status code

报错原因

596597598599均属于ER内部使用的响应状态码,禁止您在代码中主动返回这些状态码。

ER主动断开了连接

报错信息

io error@: io error(Connection reset by peer)

报错原因

ER执行的时间超过了CPU规格限制,ER主动断开连接,ER虚拟机被中止,系统会生成错误日志。

2023 0306 16:39:39.611431 115939 JSThread-3() E @tag(JSError) @loc(src/js-instance-inl.h:366)]: <uid: debugger::I::79de2290-d3a3-4f89-81db-6c3ba779b8b2;event: fetch;host: ;path: /;auth: market.wapa.taobao.com;unique_id: ;pip: 127.0.0.1:46174;fetch_uuid: b5f59f33-8f9b-487d-be32-56e3c368f3f0;start_ts: 1678091979098;req: http;milestone: *-*---;><N/A><>: category: Fatal Error; caller: JSInstance; sub-reason: cpu time; description: N/A; message: the virtual machine has been forcebly terminated for user id 'debugger::I::79de2290-d3a3-4f89-81db-6c3ba779b8b2' due to its violation of resource constraints of system!

解决方法

您需要调大CPU时间规格,例如从50 ms调整为100 ms。

没有可用的proxy地址

报错信息

unhandled error(13485,13477)@: Error: io error@: no available fetch proxy address now\nstacktrace:\nN/A\n

报错原因1

您在cache.put中put的是以https开头的URL,由于cacheAPI不支持https,您需要将https改成http

报错原因2

fetch请求的是一个非CDN的域名,但是您设置了cdnProxy:true,您需要将fetch的域名也接入CDN/DCDN,或者删除cdnProxy:true配置。

连接断开

报错信息

Error: unhandled error(13486,13505)@: Broken connection, unexpected EOF

报错原因

ER在接收上游服务返回的数据时,上游服务主动断开连接。

  • 本页导读 (1)
文档反馈