Error: Internal Serverless Error - Please send this error code to support at hello@serverless.com - 361504b0-97ea-11ea-b8d5-*****
at processTencentAPIResponse (/usr/local/lib/node_modules/serverless/node_modules/@serverless/platform-client-china/src/api.js:65:11)
at Object.get (/usr/local/lib/node_modules/serverless/node_modules/@serverless/platform-client-china/src/api.js:171:14)
at process._tickCallback (internal/process/next_tick.js:68:7)
今天升级到Framework Core: 1.71.1、Plugin: 3.6.12 之后,这里抛出错误就会结束 deploy 进程。在 dashboard 可以看到部分 scf 组件出现 status error, 错误 message 是 : There's a problem with your files and they could not be loaded by this Component. Original error: Response code 404 (Not Found)
Error: {"Error":{"Code":"RequestLimitExceeded","Message":"Your current request times equals to 21 in a second, which exceeds the frequency limit 20 for a second. Please reduce the frequency of calls."},"RequestId":"592b3ce1-e56a-4fa6-ab71-***"}
at Scf.getFunction (/var/user/node_modules/tencent-component-toolkit/src/baas/scf/index.js:155:15)
at process._tickCallback (internal/process/next_tick.js:68:7)
182s › base-on-serverless › {"Error":{"Code":"RequestLimitExceeded","Message":"Your current request times equals to 21 in a second, which exceeds the frequency limit 20 for a second. Please reduce the frequency of calls."},"RequestId":"592b3ce1-e56a-4fa6-ab71-****"}
sls deploy --all 时,如果有4到5个组件( 1个db,n个scf ),platform-client-china ( @serverless/platform-client-china ) 就开始随缘抛出错误。
这个出错的概率跟组件数量正相关,我这边测试的情况是组件数量达到7个之后,100% 报错。
Framework Core: 1.70.1、Plugin: 3.6.11 的时候,这里抛出错误之后会一直 deploy 个没完,但是最终还是可以把所有组件都部署上去的。
今天升级到Framework Core: 1.71.1、Plugin: 3.6.12 之后,这里抛出错误就会结束 deploy 进程。在 dashboard 可以看到部分 scf 组件出现 status error, 错误 message 是 : There's a problem with your files and they could not be loaded by this Component. Original error: Response code 404 (Not Found)
修改 /usr/local/lib/node_modules/serverless/node_modules/@serverless/platform-client-china/src/api.js 中的 processTencentAPIResponse 方法, 增加 1s 的延迟后, 可以临时解决这个报错。
但是如果此时继续增加组件,报错仍旧会出现,此时只能继续增加延时来解决这个问题。
目前,部署1个db组件, 10个scf组件时,需要在 processTencentAPIResponse 中 sleep 至少 5s 才能解决 platform-client-china 抛出 Internal Serverless Error 的问题。但是此时又会随缘出现 RequestLimitExceeded 报错:
tencent-component-toolkit 这个组件似乎在云端,本地找不到 /var/user/node_modules/tencent-component-toolkit/src/baas/scf/index.js 这个文件。此时,通过增加 sleep 的方式来解决这个报错的方法都行不通了。
个人猜测问题的原因主要是云API调用频率限制。