云函数本地调试正常,云端测试失败,搞不清哪里的问题?
发布于 6 年前 作者 leikang 1640 次浏览 来自 官方Issues

云函数代码主要是更新数据库,本地测试正常,数据库更新正常

for (const index in res.result) {

record = res.result[index]

const ress = await db.collection('xxxx').where({ 'index': record.index }).update({

data: record
})
}

云端测试就报错,实在搞不清哪里的问题:

{“errorCode”:1,“errorMessage”:“user code exception caught”,“stackTrace”:"errCode: -501001 resource system error | errMsg: envname field not exsit in url; "}

Error: errCode: -501001 resource system error | errMsg: envname field not exsit in url;

at new CloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6389:28)

at Object.returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6441:16)

at Object.checkError (/var/user/node_modules/wx-server-sdk/index.js:1672:23)

at Query.<anonymous> (/var/user/node_modules/wx-server-sdk/index.js:1773:41)

at step (/var/user/node_modules/tslib/tslib.js:136:27)

at Object.next (/var/user/node_modules/tslib/tslib.js:117:57)

at fulfilled (/var/user/node_modules/tslib/tslib.js:107:62)

at <anonymous>

at process._tickCallback (internal/process/next_tick.js:188:7)

3 回复

昨晚已解决,官方更新了包,重新部署就OK了

Request ID

2f1458d9-010c-11ea-ae55-525400e24e59

END RequestId: 2f1458d9-010c-11ea-ae55-525400e24e59

Report RequestId: 2f1458d9-010c-11ea-ae55-525400e24e59 Duration:883ms Memory:256MB MaxMemoryUsed:48.222656MB

是这个吗

麻烦提供下报错函数的日志中的RequestId

回到顶部