我正在尝试部署Firebase函数index.js文件。如果我尝试部署单个功能,例如(firebase deploy --only functions:phaseStart),它会很好地工作。但是,如果我部署整个功能文件夹,例如(firebase deploy --only functions),则会出现错误。我只是在昨天部署了此功能,但这些都没有发生。 index.js文件有问题吗?还是我部署了那么多功能?
下面是错误代码。
+ functions: Finished running predeploy script.
i functions: ensuring necessary APIs are enabled...
+ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
i functions: packaged functions (46.47 KB) for uploading
+ functions: functions folder uploaded successfully
i functions: updating Node.js 8 function roomRemoved(asia-northeast1)...
i functions: updating Node.js 8 function gameStart(asia-northeast1)...
i functions: updating Node.js 8 function phaseStart(asia-northeast1)...
i functions: updating Node.js 8 function nightAction(asia-northeast1)...
i functions: updating Node.js 8 function vote(asia-northeast1)...
i functions: updating Node.js 8 function userCreated(asia-northeast1)...
i functions: updating Node.js 8 function userDeleted(asia-northeast1)...
! functions[userDeleted(asia-northeast1)]: Deployment error.
undefined
! functions[phaseStart(asia-northeast1)]: Deployment error.
undefined
! functions[vote(asia-northeast1)]: Deployment error.
undefined
! functions[gameStart(asia-northeast1)]: Deployment error.
undefined
! functions[roomRemoved(asia-northeast1)]: Deployment error.
undefined
! functions[nightAction(asia-northeast1)]: Deployment error.
undefined
+ functions[userCreated(asia-northeast1)]: Successful update operation.
Functions deploy had errors with the following functions:
gameStart
nightAction
phaseStart
roomRemoved
userDeleted
vote
To try redeploying those functions, run:
firebase deploy --only functions:gameStart,functions:nightAction,functions:phaseStart,functions:roomRemoved,functions:userDeleted,functions:vote
To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
我还在firebase控制台上找到了审核日志。
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":13,"message":"INTERNAL"},"authenticationInfo":{"principalEmail":"blabla"},"requestMetadata":{"requestAttributes":{},"destinationAttributes":{}},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/blabla/locations/asia-northeast1/functions/gameStart"}
这是我的职责之一。
exports.userDeleted = functions
.region('asia-northeast1')
.auth.user().onDelete(async user => {
return db.collection('uid_list').doc(user.uid).delete().catch(e => {
console.error(e.code)
console.log(e.message)
})
})