小程序
小游戏
企业微信
微信支付
扫描小程序码分享
云函数通过触发器调用,查询云数据库,偶发性出现聚合失败的错误,本来想捅过延时函数接收到错误后过一会再调用,结果延时函数也调用失败。感觉在晚间整点特别容易出现,且当次运行成功耗时也非常久,整个数据库也才一千多条数据,不应该这么慢。
RID1:055f6f7d-5107-4dd4-9de4-1b8014fed41f
RID2:4fed978f-a810-4b1a-9470-6967267d9e3f
3 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
一个主要内容是collection.aggregate:fail getaddrinfo ENOTFOUND release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com,另一个是Error: openapi.cloudbase.addDelayedFunctionTask:fail -501001 resource system error
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
你好,请补充以下信息:
1、环境ID;
2、云函数名称,清晰的报错截图,对应的rid;
3、截图提供相关代码
// 错误catch结果
[{"errno":"ENOTFOUND","code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com","host":"release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com","port":80,"errCode":-1,"errMsg":"collection.aggregate:fail getaddrinfo ENOTFOUND release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com:80"}]
// 延时函数调用结果(没有catch)
(node:8) UnhandledPromiseRejectionWarning: Error: openapi.cloudbase.addDelayedFunctionTask:fail -501001 resource system error. getaddrinfo ENOTFOUND release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com:80
at toSDKError (/var/user/node_modules/wx-server-sdk/index.js:8064:19)
at Object.returnAsFinalCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:8035:12)
at callWXOpenAPI (/var/user/node_modules/wx-server-sdk/index.js:2425:27)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:8) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Your current request database.aggregateDocuments is longer than 3s, it may be due to the network or your query performance | [t_1643983200709_17698-17ec508e4eb_1]
REPORT RequestId:055f6f7d-5107-4dd4-9de4-1b8014fed41f Duration:3010ms Memory:256MB MemUsage:30.709496MB
END
图中的错误信息看不清。。
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
一个主要内容是collection.aggregate:fail getaddrinfo ENOTFOUND release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com,另一个是Error: openapi.cloudbase.addDelayedFunctionTask:fail -501001 resource system error
回复2:requestid:055f6f7d-5107-4dd4-9de4-1b8014fed41f
你好,请补充以下信息:
1、环境ID;
2、云函数名称,清晰的报错截图,对应的rid;
3、截图提供相关代码
云函数名称:schedule
rid:055f6f7d-5107-4dd4-9de4-1b8014fed41f
错误和代码见截图
// 错误catch结果
[{"errno":"ENOTFOUND","code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com","host":"release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com","port":80,"errCode":-1,"errMsg":"collection.aggregate:fail getaddrinfo ENOTFOUND release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com:80"}]
// 延时函数调用结果(没有catch)
(node:8) UnhandledPromiseRejectionWarning: Error: openapi.cloudbase.addDelayedFunctionTask:fail -501001 resource system error. getaddrinfo ENOTFOUND release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com release-5gcdly38e2503f19.internal.ap-shanghai.tcb-api.tencentcloudapi.com:80
at toSDKError (/var/user/node_modules/wx-server-sdk/index.js:8064:19)
at Object.returnAsFinalCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:8035:12)
at callWXOpenAPI (/var/user/node_modules/wx-server-sdk/index.js:2425:27)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:8) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Your current request database.aggregateDocuments is longer than 3s, it may be due to the network or your query performance | [t_1643983200709_17698-17ec508e4eb_1]
REPORT RequestId:055f6f7d-5107-4dd4-9de4-1b8014fed41f Duration:3010ms Memory:256MB MemUsage:30.709496MB
END
图中的错误信息看不清。。
1、环境ID;
2、云函数名称,清晰的报错截图,对应的rid;
3、截图提供相关代码