首页 > 解决方案 > 将我的功能部署到 Google Cloud 时出现问题

问题描述

我在将函数部署到 Google Cloud 时遇到问题:

Firebase CLI 中的显示方式和消息:

    + 功能:完成运行预部署脚本。
    i 功能:确保启用必要的 API ...
    + 功能:启用所有必要的 API
    i 函数:为上传准备函数目录...
    i 函数:用于上传的打包函数 (85.85 KB)
    + 功能:功能文件夹上传成功
    i 功能:项目中的当前功能:Backup (us-central1)、DashBoard (us-central1)、dialogflowFirebaseFulfillment (us-central1)
    i 功能:项目中上传功能:DashBoard (us-central1)、Backup (us-central1)
    i 函数:更新 Node.js 10 (Beta) 函数 DashBoard (us-central1) ...
    i 功能:更新 Node.js 10 (Beta) 功能备份 (us-central1) ...
    !功能 [仪表板(us-central1)]:部署错误。
    无法初始化区域(操作 ID:f22869a1fe22aba0):在项目 testechatbot-2020 中配置 GCS 存储桶 gcf-sources-366403583884-us-central1 时出错。原因:所属项目的计费帐户在状态缺席时被禁用
    !功能 [Backup (us-central1)]:部署错误。
    无法初始化区域(操作 ID:2e3bfdf4820819aa):在项目 testechatbot-2020 中配置 GCS 存储桶 gcf-sources-366403583884-us-central1 时出错。原因:所属项目的计费帐户在状态缺席时被禁用

Firebase 控制台上的显示方式和消息:

    备份
    
    {"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":7,"message":"初始化区域失败(操作 ID:e0e457da63bedd16):错误在项目 testechatbot-2020 中配置 GCS 存储桶 gcf-sources-366403583884-us-central1 时。
    
    仪表板
    {"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":7,"message":"初始化区域失败(操作 ID:243073b0e1959dc3):错误在项目 testechatbot-2020 中配置 GCS 存储桶 gcf-sources-366403583884-us-central1 时。

标签: firebasegoogle-cloud-platformgoogle-cloud-functions

解决方案


我是 Stack Overflow 的新手,所以我无法将问题标记为重复或评论,所以我在这里再次回答:

Node.js 8 Firebase 云功能目前正在逐步淘汰,因为 Node.js 8 最近被 Node.js 基金会标记为“生命终结”。

Node.js 8 函数的部署将在 2021 年 2 月 15 日之后停止,已部署的 Node.js 函数的执行将在 2021 年 3 月 15 日之后停止。

如果您最近切换到 Node.js 10 Firebase 云功能,则这些功能需要 Blaze 即用即付计费方案和 Firebase CLI 版本 ≥ 8.1.0。使用 Spark 免费层,您无法部署 Node.js 10 Firebase 云功能。

错误消息“原因:拥有项目的计费帐户在状态不存在的情况下被禁用”提供了一些信息来说明此问题的原因。

来源(我对重复问题的回答)。


推荐阅读