小程序
小游戏
企业微信
微信支付
扫描小程序码分享
1图是云函数手动云端测试后,2图是过了一会
3 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
代码是怎么写的?wx.cloud.init前面加个await试下呢?
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
最后人工给处理了。代码没什么问题,是账号问题
写一个最简单的云函数来复现,
本回答由AI生成,可能已过期、失效或不适用于当前情形,请谨慎参考
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
代码是怎么写的?wx.cloud.init前面加个await试下呢?
最后人工给处理了。代码没什么问题,是账号问题
写一个最简单的云函数来复现,
[CloudManager] callFunction开始 - name: createRoom, data: {nickname: "高山流水", avatarUrl: "", maxPlayers: 8}
[CloudManager] 准备调用云函数: createRoom
[CloudManager] 原始参数类型: object
[CloudManager] 处理后参数类型: object
[CloudManager] 参数内容: {"nickname":"高山流水","avatarUrl":"","maxPlayers":8}
[CloudManager] wx.cloud.callFunction配置: {name: "createRoom", data: {…}}
cloudManager.js? [sm]:30 [CloudManager] 云函数 createRoom 调用失败: Error: cloud.callFunction:fail Error: errCode: -501000 | errMsg: [100003] env not exists (2fa64500-4be6-4a92-b4b0-c3ac12c97f92) 更多错误信息请访问:https://docs.cloudbase.net/error-code/basic/INVALID_ENV (callId: 1771298316028-0.4913279719434047) (trace: 11:18:36 start->11:18:36 system error (Error: errCode: -501000 | errMsg: [100003] env not exists (2fa64500-4be6-4a92-b4b0-c3ac12c97f92) 更多错误信息请访问:https://docs.cloudbase.net/error-code/basic/INVALID_ENV), abort)
at N (<anonymous>:1:255194)
at <anonymous>:1:293136(env: Windows,mg,2.01.2510280; lib: 3.14.2)
fail @ cloudManager.js? [sm]:30
(anonymous) @ VM1126:1
Q @ VM1126:1
(anonymous) @ VM1126:1
(anonymous) @ VM1126:1
j @ VM1126:1
(anonymous) @ VM1126:1
Promise.catch (async)
(anonymous) @ VM1126:1
(anonymous) @ VM1126:1
o.<computed> @ VM1126:1
(anonymous) @ cloudManager.js? [sm]:22
callFunction @ cloudManager.js? [sm]:5
(anonymous) @ cloudManager.js? [sm]:42
(anonymous) @ _ts_generator.js:1
(anonymous) @ _ts_generator.js:1
asyncGeneratorStep @ _async_to_generator.js:1
c @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
createRoom @ cloudManager.js? [sm]:47
(anonymous) @ gameRoomManager.js? [sm]:23
(anonymous) @ _ts_generator.js:1
(anonymous) @ _ts_generator.js:1
asyncGeneratorStep @ _async_to_generator.js:1
c @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
_createRoom @ gameRoomManager.js? [sm]:58
createRoom @ gameRoomManager.js? [sm]:7
value @ game.js? [sm]:1111
action @ buttonManager.js? [sm]:89
handleTouch @ eventManager.js? [sm]:96
value @ game.js? [sm]:1310
(anonymous) @ game.js? [sm]:341
(anonymous) @ EventManager.js? [sm]:97
value @ EventManager.js? [sm]:96
value @ EventManager.js? [sm]:23
callbackTouch @ gamePage.html:350
(anonymous) @ gamePage.html:302
Show 9 more frames
cloudManager.js? [sm]:31 [CloudManager] 错误码: -1(env: Windows,mg,2.01.2510280; lib: 3.14.2)
fail @ cloudManager.js? [sm]:31
(anonymous) @ VM1126:1
Q @ VM1126:1
(anonymous) @ VM1126:1
(anonymous) @ VM1126:1
j @ VM1126:1
(anonymous) @ VM1126:1
Promise.catch (async)
(anonymous) @ VM1126:1
(anonymous) @ VM1126:1
o.<computed> @ VM1126:1
(anonymous) @ cloudManager.js? [sm]:22
callFunction @ cloudManager.js? [sm]:5
(anonymous) @ cloudManager.js? [sm]:42
(anonymous) @ _ts_generator.js:1
(anonymous) @ _ts_generator.js:1
asyncGeneratorStep @ _async_to_generator.js:1
c @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
createRoom @ cloudManager.js? [sm]:47
(anonymous) @ gameRoomManager.js? [sm]:23
(anonymous) @ _ts_generator.js:1
(anonymous) @ _ts_generator.js:1
asyncGeneratorStep @ _async_to_generator.js:1
c @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
_createRoom @ gameRoomManager.js? [sm]:58
createRoom @ gameRoomManager.js? [sm]:7
value @ game.js? [sm]:1111
action @ buttonManager.js? [sm]:89
handleTouch @ eventManager.js? [sm]:96
value @ game.js? [sm]:1310
(anonymous) @ game.js? [sm]:341
(anonymous) @ EventManager.js? [sm]:97
value @ EventManager.js? [sm]:96
value @ EventManager.js? [sm]:23
callbackTouch @ gamePage.html:350
(anonymous) @ gamePage.html:302
Show 9 more frames
cloudManager.js? [sm]:32 [CloudManager] 错误信息: cloud.callFunction:fail Error: errCode: -501000 | errMsg: [100003] env not exists (2fa64500-4be6-4a92-b4b0-c3ac12c97f92) 更多错误信息请访问:https://docs.cloudbase.net/error-code/basic/INVALID_ENV (callId: 1771298316028-0.4913279719434047) (trace: 11:18:36 start->11:18:36 system error (Error: errCode: -501000 | errMsg: [100003] env not exists (2fa64500-4be6-4a92-b4b0-c3ac12c97f92) 更多错误信息请访问:https://docs.cloudbase.net/error-code/basic/INVALID_ENV), abort)(env: Windows,mg,2.01.2510280; lib: 3.14.2)
fail @ cloudManager.js? [sm]:32
(anonymous) @ VM1126:1
Q @ VM1126:1
(anonymous) @ VM1126:1
(anonymous) @ VM1126:1
j @ VM1126:1
(anonymous) @ VM1126:1
Promise.catch (async)
(anonymous) @ VM1126:1
(anonymous) @ VM1126:1
o.<computed> @ VM1126:1
(anonymous) @ cloudManager.js? [sm]:22
callFunction @ cloudManager.js? [sm]:5
(anonymous) @ cloudManager.js? [sm]:42
(anonymous) @ _ts_generator.js:1
(anonymous) @ _ts_generator.js:1
asyncGeneratorStep @ _async_to_generator.js:1
c @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
createRoom @ cloudManager.js? [sm]:47
(anonymous) @ gameRoomManager.js? [sm]:23
(anonymous) @ _ts_generator.js:1
(anonymous) @ _ts_generator.js:1
asyncGeneratorStep @ _async_to_generator.js:1
c @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
_createRoom @ gameRoomManager.js? [sm]:58
createRoom @ gameRoomManager.js? [sm]:7
value @ game.js? [sm]:1111
action @ buttonManager.js? [sm]:89
handleTouch @ eventManager.js? [sm]:96
value @ game.js? [sm]:1310
(anonymous) @ game.js? [sm]:341
(anonymous) @ EventManager.js? [sm]:97
value @ EventManager.js? [sm]:96
value @ EventManager.js? [sm]:23
callbackTouch @ gamePage.html:350
(anonymous) @ gamePage.html:302
Show 9 more frames
cloudManager.js? [sm]:33 [CloudManager] 完整错误对象: {"errCode":-1,"errMsg":"cloud.callFunction:fail Error: errCode: -501000 | errMsg: [100003] env not exists (2fa64500-4be6-4a92-b4b0-c3ac12c97f92) 更多错误信息请访问:https://docs.cloudbase.net/error-code/basic/INVALID_ENV (callId: 1771298316028-0.4913279719434047) (trace: 11:18:36 start->11:18:36 system error (Error: errCode: -501000 | errMsg: [100003] env not exists (2fa64500-4be6-4a92-b4b0-c3ac12c97f92) 更多错误信息请访问:https://docs.cloudbase.net/error-code/basic/INVALID_ENV), abort)"}(env: Windows,mg,2.01.2510280; lib: 3.14.2)
fail @ cloudManager.js? [sm]:33
(anonymous) @ VM1126:1
Q @ VM1126:1
(anonymous) @ VM1126:1
(anonymous) @ VM1126:1
j @ VM1126:1
(anonymous) @ VM1126:1
Promise.catch (async)
(anonymous) @ VM1126:1
(anonymous) @ VM1126:1
o.<computed> @ VM1126:1
(anonymous) @ cloudManager.js? [sm]:22
callFunction @ cloudManager.js? [sm]:5
(anonymous) @ cloudManager.js? [sm]:42
(anonymous) @ _ts_generator.js:1
(anonymous) @ _ts_generator.js:1
asyncGeneratorStep @ _async_to_generator.js:1
c @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
createRoom @ cloudManager.js? [sm]:47
(anonymous) @ gameRoomManager.js? [sm]:23
(anonymous) @ _ts_generator.js:1
(anonymous) @ _ts_generator.js:1
asyncGeneratorStep @ _async_to_generator.js:1
c @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
(anonymous) @ _async_to_generator.js:1
_createRoom @ gameRoomManager.js? [sm]:58
createRoom @ gameRoomManager.js? [sm]:7
value @ game.js? [sm]:1111
action @ buttonManager.js? [sm]:89
handleTouch @ eventManager.js? [sm]:96
value @ game.js? [sm]:1310
(anonymous) @ game.js? [sm]:341
(anonymous) @ EventManager.js? [sm]:97
value @ EventManager.js? [sm]:96
value @ EventManager.js? [sm]:23
callbackTouch @ gamePage.html:350
(anonymous) @ gamePage.html:302
Show 9 more frames
gameRoomManager.js? [sm]:55 创建房间失败: Error: cloud.callFunction:fail Error: errCode: -501000 | errMsg: [100003] env not exists (2fa64500-4be6-4a92-b4b0-c3ac12c97f92) 更多错误信息请访问:https://docs.cloudbase.net/error-code/basic/INVALID_ENV (callId: 1771298316028-0.4913279719434047) (trace: 11:18:36 start->11:18:36 system error (Error: errCode: -501000 | errMsg: [100003] env not exists (2fa64500-4be6-4a92-b4b0-c3ac12c97f92) 更多错误信息请访问:https://docs.cloudbase.net/error-code/basic/INVALID_ENV), abort)
at N (<anonymous>:1:255194)
at <anonymous>:1:293136(env: Windows,mg,2.01.2510280; lib: 3.14.2)
完整日志:
返回结果
{"success":true,"roomId":"629718","roomData":{"_id":"629718","roomCode":"629718","creator":"oYvJc5bMpbIKdyoeRHGVs5AsO1zU","creatorInfo":{"nickname":"高山流水","avatarUrl":"","openid":"oYvJc5bMpbIKdyoeRHGVs5AsO1zU"},"players":[{"openid":"oYvJc5bMpbIKdyoeRHGVs5AsO1zU","nickname":"高山流水","avatarUrl":"","isReady":false,"isHost":true,"isSeen":false,"isFold":false,"isShowed":false,"isOnline":true,"card":"","cardInfo":null,"seat":1,"score":0,"wins":0,"losses":0,"joinTime":{"offset":0},"lastActiveTime":{"offset":0}}],"bottomCard":"","bottomCardInfo":null,"deck":["♥K","♣J","♠A","♣6","♣4","♥J","♠7","♦4","♣K","♥5","♣A","♥10","♠9","♦8","♥6","♦5","♣3","♥8","♠3","♣2","♣7","♦10","♥Q","♠10","♠K","♥A","♠8","♦3","♦2","♠4","♠5","♠2","♣8","♠Q","♥9","♠J","♦K","♥7","♦Q","♣9","♦J","♣Q","♣5","♦9","♦6","♥4","♥3","♥2","♣10","♦A","♦7","♠6"],"discardPile":[],"currentDeckCount":52,"status":"waiting","gameType":"standard","currentRound":1,"maxRounds":10,"maxPlayers":8,"minPlayers":2,"currentPlayerCount":1,"settings":{"autoStart":false,"roundLimit":10,"timeLimit":60,"allowSpectator":true,"privateRoom":false,"password":null,"allowChat":true},"gameHistory":[],"createdAt":{"offset":0},"updatedAt":{"offset":0},"startedAt":null,"endedAt":null,"hostScene":"roomScene","hostSceneUpdatedAt":{"offset":0},"expiresAt":{"offset":86400000},"statistics":{"totalActions":0,"totalChats":0,"peakPlayers":1}},"playerId":"oYvJc5bMpbIKdyoeRHGVs5AsO1zU"}
日志
Init Report RequestId: 3065eaf5-d97f-4ca0-a8ec-47758f2ef75d Coldstart: 547ms (InitRuntime: 13ms InitFunction: 534ms) Memory: 256MB MemUsage: 24.97MB
START RequestId: 3065eaf5-d97f-4ca0-a8ec-47758f2ef75d
Event RequestId: 3065eaf5-d97f-4ca0-a8ec-47758f2ef75d
Response RequestId: 3065eaf5-d97f-4ca0-a8ec-47758f2ef75d RetMsg: {"success":true,"roomId":"629718","roomData":{"_id":"629718","roomCode":"629718","creator":"oYvJc5bMpbIKdyoeRHGVs5AsO1zU","creatorInfo":{"nickname":"高山流水","avatarUrl":"","openid":"oYvJc5bMpbIKdyoeRHGVs5AsO1zU"},"players":[{"openid":"oYvJc5bMpbIKdyoeRHGVs5AsO1zU","nickname":"高山流水","avatarUrl":"","isReady":false,"isHost":true,"isSeen":false,"isFold":false,"isShowed":false,"isOnline":true,"card":"","cardInfo":null,"seat":1,"score":0,"wins":0,"losses":0,"joinTime":{"offset":0},"lastActiveTime":{"offset":0}}],"bottomCard":"","bottomCardInfo":null,"deck":["♥K","♣J","♠A","♣6","♣4","♥J","♠7","♦4","♣K","♥5","♣A","♥10","♠9","♦8","♥6","♦5","♣3","♥8","♠3","♣2","♣7","♦10","♥Q","♠10","♠K","♥A","♠8","♦3","♦2","♠4","♠5","♠2","♣8","♠Q","♥9","♠J","♦K","♥7","♦Q","♣9","♦J","♣Q","♣5","♦9","♦6","♥4","♥3","♥2","♣10","♦A","♦7","♠6"],"discardPile":[],"currentDeckCount":52,"status":"waiting","gameType":"standard","currentRound":1,"maxRounds":10,"maxPlayers":8,"minPlayers":2,"currentPlayerCount":1,"settings":{"autoStart":false,"roundLimit":10,"timeLimit":60,"allowSpectator":true,"privateRoom":false,"password":null,"allowChat":true},"gameHistory":[],"createdAt":{"offset":0},"updatedAt":{"offset":0},"startedAt":null,"endedAt":null,"hostScene":"roomScene","hostSceneUpdatedAt":{"offset":0},"expiresAt":{"offset":86400000},"statistics":{"totalActions":0,"totalChats":0,"peakPlayers":1}},"playerId":"oYvJc5bMpbIKdyoeRHGVs5AsO1zU"}
END RequestId: 3065eaf5-d97f-4ca0-a8ec-47758f2ef75d
Report RequestId: 3065eaf5-d97f-4ca0-a8ec-47758f2ef75d Duration: 236ms Memory: 256MB MemUsage: 25.156250MB