首页 > 解决方案 > Google Firebase Functions 部署失败 - 我该怎么办?

问题描述

错误信息:

Error: There was an error deploying functions

firebease-debug.log 包含以下内容:

 [debug] [2021-11-16T12:12:16.165Z] Error: Failed to upsert schedule function lab2 in region europe-west3

功能代码:

exports.lab2 =
    functions
        .region('europe-west3')
        .pubsub.schedule('*/10 * * * *')
        .onRun(lab);

我能做些什么?谷歌支持导致stackoverflow,所以我把它贴在这里。有没有更好的方法来处理 Google Cloud 问题?

标签: google-cloud-platformgoogle-cloud-functions

解决方案


当您在 Firebase Functions 中使用计划函数时,会创建一个 App Engine 实例,该实例是 Cloud Scheduler 工作所必需的。你可以在这里阅读。在设置过程中,系统会提示您选择项目的默认 Google Cloud Platform (GCP) 资源位置(如果在设置其他服务时尚未选择它)。

您收到该错误是因为您指定的默认 GCP 资源位置与您计划的 Cloud Function 的区域之间存在差异。如果您单击 Firebase 中项目概述旁边的齿轮,您可以看到您的资源所在的位置。将默认 GCP 资源位置设置为与调度程序功能区域相同,即可解决此问题。


推荐阅读