无
![linnian](https://img-cdn-tc.dcloud.net.cn/account/identicon/9ef7090442c004bb6f1c78310f98cbd2.png)
- 发布:2020-10-28 22:42
- 更新:2021-02-08 09:59
- 阅读:698
产品分类: uniCloud/App
操作步骤:
预期结果:
无
无
实际结果:
无
无
bug描述:
云函数错误提示如下,时有时无的发生 .
502:{"errorMessage":"Process exited unexpectedly before completing request (duration: 22ms, maxMemoryUsage: 45.15MB)"}
![DCloud_uniCloud_WYQ](http://img-cdn-tc.dcloud.net.cn/uploads/avatar/001/20/08/83_avatar_mid.jpg?v=0)
重新部署一下云函数再试试还会不会偶发上面的问题
-
linnian (作者)
云函数没有打印报错信息(应该是正常返回了,但是code不是0),分不太清,等再出现时定位下
还发现了一个错误,也是有时会出现
Error: socket hang up
at createHangUpError (_http_client.js:331:15)
at TLSSocket.socketOnEnd (_http_client.js:423:23)
at emitNone (events.js:111:20)
at TLSSocket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1056:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)2020-10-29 13:59
-
-
![1***@163.com](https://img-cdn-tc.dcloud.net.cn/account/identicon/a4fb99e5a3b24a6777a0be7d03ebce30.png)
我也是,我用的云函数url化,调用时候有时候就会502:{"errorMessage":"Process exited unexpectedly before completing request,我是3.1.2 alpha版本
-
-
回复 DCloud_uniCloud_WYQ: 我也遇到这个问题
[pay_baidu/ac140d3c1616042554825556474/1579ms/ERROR] errCode: FunctionCommonError | errMsg: 502:{"errorMessage":"Process exited unexpectedly before completing request (duration: 3ms, maxMemoryUsage: 41.96MB)"}
Error: errCode: FunctionCommonError | errMsg: 502:{"errorMessage":"Process exited unexpectedly before completing request (duration: 3ms, maxMemoryUsage: 41.96MB)"}
at e.$scope.function.invoke.then.catch.e (/tmp/function/@dcloudio/serverless/lib/aliyun/uni-cloud.js:1:48840)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
请求响应状态: fail
云函数 调用了 另一个 连接 mysql 的云函数插件 var connection = mysql.createConnection({
https://ext.dcloud.net.cn/plugin?id=1925
云函数连接Mysql数据库示例2021-03-18 12:47
-
-
-
-
-
回复 DCloud_uniCloud_WYQ: 可能跟 这个问题有关,
我也遇到这个问题:
“Cannot enqueue Query after invoking quit”
请问 怎么改 插件的 代码 参考:解决方法: https://forums.aws.amazon.com/thread.jspa?threadID=223230
const query = function(sql, values) { return new Promise((resolve, reject) => { connection.query(sql, values, (error, results, fields) => { if (error) { reject(error) } else { resolve(results) } }) }) }
//This is your handler. exports.handler=function(event, context) { //This is declared inside the handler: it is guaranteed to never be reused!. var connection=function_that_gets_your_connection();
//Do things with your connection.
var query_string='SELECT something FROM nothing WHERE value=?';
connection.query(query_string, [beware], function(res, err){
//Check for errors, disconnect and exit with failure.
if(err){
console.log("Query failed", err);
connection.end(function(err){
context.fail(0);
});
}
//Disconnect and exit with success.
else{
connection.end(function(err){
if(err){
console.log("Warning: disconnection failed"; err);
}
context.succeed(res);
});
}
});
}
diamont1001@163.com
2020-08-01
query 这个方法有点问题:
另外,我遇到了一个问题,50%的机率会报这个错“Cannot enqueue Query after invoking quit”,解决方法: https://forums.aws.amazon.com/thread.jspa?threadID=223230
2021-03-19 21:53
linnian (作者)
额,好像旧版也有问题了,难道是因为新增的clientdb导致的?
2020-10-28 23:31