尝试部署Firebase功能,找不到默认服务帐户

时间:2020-04-02 03:54:31

标签: node.js firebase authentication firebase-authentication google-cloud-functions

我正在尝试将以下简单功能上传到我的Firebase控制台

const functions = require('firebase-functions');

exports.helloWorld = functions.https.onRequest((request, response) => {
 response.send("Hello from Firebase!");
});

但是,它失败并显示以下错误:

HTTP Error: 400, Default service account 'myfirebase-projecte@appspot.gserviceaccount.com' doesn't exist. Please recreate this account (for example by disabling and enabling the Cloud Functions API), or specify a different account.

目前,我在Firebase和Google Cloud Platforms之间无法解决此错误,对此感到困惑。

2 个答案:

答案 0 :(得分:0)

Firebase使用Google Cloud Platform(GCP)运行Cloud Functions。此错误消息告诉您GCP设置有问题。因此,请尝试错误消息的内容:转到已将Firebase项目链接到here的Google Cloud项目,然后关闭然后再打开Cloud Functions API。如果这不起作用,则可能要确保从中进行部署的Firebase CLI已正确登录(运行firebase login以进行检查)并且可以访问该项目-有时可能会导致问题。

答案 1 :(得分:0)

你好,兔子洞!我想到了。好像我不小心删除了我的默认服务帐户(非常感谢,在30天内),我能够按照这些非常具体和非常有用的说明https://cloud.google.com/iam/docs/creating-managing-service-accounts#undeleting进行恢复,因为无法使用控制台的界面重新激活。< / p>

基本上,您必须查找删除发生的时间,从此事件中获取帐户的ID,然后使用Google Cloud终端使用gcloud beta iam service-accounts undelete [ACCOUNT_ID]命令对其进行还原。 ew!

相关问题