首页 > 解决方案 > 尝试部署 Firebase 功能,未找到默认服务帐户

问题描述

我正在尝试将以下简单功能上传到我的 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 以及可以修复此错误的地方感到困惑。

标签: node.jsfirebaseauthenticationfirebase-authenticationgoogle-cloud-functions

解决方案


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

基本上,您必须找到删除发生的时间,从此事件中获取帐户的 ID,然后使用 Google Cloud 终端使用gcloud beta iam service-accounts undelete [ACCOUNT_ID]命令恢复它。呸!


推荐阅读