在微信开发工具的模拟器中,我使用wx.cloud.callContainer去调用通过VS code云托管插件部署在本地的测试接口,可以成功返回对应信息,但是很快控制台就会报错。
这个是通过VS code云托管插件部署在本地的服务
这个是在微信开发者工具中,连接到本地部署调试的docker上后的页面,以及相关调用代码
调用代码:
. wxml中:
点击测试
app . js中:
App({
onLaunch() {
// 使用callContainer前一定要init一下,全局执行一次即可
wx.cloud.init()
},
. js中:
// 测试
async testting(e) {
// 下面的请求可以在页面任意一处使用
const result = await wx.cloud.callContainer({
"config": {
"env": "prod-8g35ccg********"
},
"path": "/",
"header": {
"X-WX-SERVICE": "werun-java",
"content-type": "application/json"
},
"method": "GET",
"data": ""
})
console.log(result)
},
这个是调用后,控制台输出的信息,包括调用成功的返回值,以及那个莫名其妙的报错
调用成功
{data: "[oqF7T5KpZCUngU7Yzg*****......de: 200, header: {…}, errMsg: "cloud.callContainer:ok", callID: "1691213901*****"}
callID: "1691213901*****"
data: "[oqF7T5KpZCUngU7Yzg******......]"
errMsg: "cloud.callContainer:ok"
header: {x-wx-local-debug: "1", content-type: "text/plain;charset=UTF-8", content-length: "30", date: "Sat, 05 Aug 2023 05:38:21 GMT", connection: "close"}
statusCode: 200
__proto__: Object
大约五秒左右,控制台会紧接着弹出报错
Error: MiniProgramError
"get container service endpoints errors: Error: cloud:fail -405015 exceed max client request count,
avoid infinite loop in your code and retry after 60s.
error: exceed max client request count, avoid infinite loop in your code
Error: cloud:fail -405015 exceed max client request count, avoid infinite loop in your code and retry after 60s.
error: exceed max client request count, avoid infinite loop in your code
Error: cloud:fail -405015 exceed max client request count, avoid infinite loop in your code and retry after 60s.
error: exceed max client request count, avoid infinite loop in your code"
at Object.errorReport (WAServiceMainContext.js?t=wechat&s=1691207522945&v=2.32.3:1)
at Function.thirdErrorReport (WAServiceMainContext.js?t=wechat&s=1691207522945&v=2.32.3:1)
at Object.thirdErrorReport (WAServiceMainContext.js?t=wechat&s=1691207522945&v=2.32.3:1)
(env: macOS,mp,1.06.2307250; lib: 2.32.3)
电脑系统是最新版macos,芯片是M1 max arm64(应该吧)
这个问题看起来像是短时间内多次调用出现的?
令人感到费解,只是通过按钮调起这段代码,怎么可能会执行多次,造成这个问题,希望能在此被大佬点拨开悟
--------------------------------------------------------2023.08.06.00:07---------------------------------------------------------------------
这段时间是家里路由器的定时重启时间,然而重启路由器之后,这个问题消失了,目前为止还没有再次出现,希望明天乃至以后也是如此,请管理员关闭帖子(如果有这个功能)
官方都没人回复的吗
同问,一样的错误,莫名其妙