在云功能上部署具有错误代码13和消息“内部"的功能错误. [英] Deploying Function Error on Cloud Function with error code 13 and Message "INTERNAL"
问题描述
我正在为我的App部署一个Firestore触发器onCreate,但是每次我要部署时,它始终会出错
I'm deploying a Firestore trigger onCreate for my App, but everytime I want to deploy, it always Error
控制台始终显示代码13和消息内部"
the console always showing Code 13 and Message "INTERNAL"
这就是控制台上出现的内容
this is what comes up on Console
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog",
"status":{"code":13,"message":"INTERNAL"},
"authenticationInfo":{"principalEmail":"[My_EMAIL]"},
"requestMetadata":{"requestAttributes":{},"destinationAttributes":{}},
"serviceName":"cloudfunctions.googleapis.com",
"methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction",
"resourceName":"projects/etalase/locations/us-central1/functions/onNewMessage"}
这是我在index.js上的代码
this is my code on index.js
exports.onNewMessage = functions.firestore
.document('/messages/{groupChatId}/{groupChatId}/{messageFeedItem}')
.onCreate(async (snapshot, context) => {
const doc = snapshot.data();
console.log('------Message Created-----');
console.log(doc);
const idForm = doc.userID;
const idTo = doc.sellerID;
console.log('Message from : ', idForm);
console.log('Message to : ', idTo);
});
我希望它会部署,并且每次在{messageFeedItem}上创建一条新消息时,它将触发控制台,但即使我也无法部署
I expect this will deploy and every time a new message created on {messageFeedItem}, it will trigger the console, but even I can't deploy it
谢谢
推荐答案
现在,我可以通过更改目录来部署该功能
So right now I can deploy the function by changing the directory
'messages/{groupChatId}/{groupChatId}/{messageFeedItem}'
'messages/{groupChatId}/{groupChatId}/{messageFeedItem}'
进入
'messages/{groupChatId}/{groupChatId2}/{messageFeedItem}'
'messages/{groupChatId}/{groupChatId2}/{messageFeedItem}'
我推测您不能与通配符同名
my speculation is you can't have same name to the wildcard
这篇关于在云功能上部署具有错误代码13和消息“内部"的功能错误.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!