关于谷歌应用引擎:Firebase Cloud Functions 部署错误

Firebase Cloud Functions deploy error

我正在尝试从 firebase CLI 部署我的项目,但我的功能存在问题。这很奇怪,因为四个星期前我没有遇到任何问题。我没有更改任何 Firebase 云功能设置。当我尝试运行 firebase deploy firebase deploy --only functions 时。我得到同样的错误: There was an issue deploying your functions. Verify that your project has a Google App Engine instance setup at https://console.cloud.google.com/appengine and try again. If this issue persists, please contact support.

Error: HTTP Error: 500, Internal error encountered.

我的云功能在无需设置 Google App Engine 之前运行良好,我似乎在文档中找不到任何提及需要 Google App Engine 的内容。


我做了以下解决了我的问题

npm i -g firebase-tools

访问了 URL https://console.cloud.google.com/appengine,因为它在响应中


尝试将 firebase-tools 更新到最新版本。这为我解决了这个问题。

1
npm install -g firebase-tools

对我来说,这是云资源位置的问题。

因此,只需将 firestore 添加到您的项目并选择一个位置(即欧洲西部)。

解释:

firebase init 之后出现错误:

Error: Cloud resource location is not set for this project but the
operation you are attempting to perform in Cloud Firestore requires
it. Please see this documentation for more details:
https://firebase.google.com/docs/projects/locations

所以转到 https://console.firebase.google.com/project,选择您的项目,然后单击数据库并添加 firestore(或实时数据库,如果您愿意)。这也将允许您上传函数。


如果您的系统遇到问题当天有服务中断,请查看 Google Cloud 状态信息中心。

https://status.cloud.google.com/


如果您的函数使用 Cloud Datastore,您需要创建 Cloud Firestore 数据库。

转到 Firebase dashboard -> Database
然后创建新数据库。


如果您的函数使用 Cloud Datastore,那么可以,您需要创建一个 App Engine 项目(您实际上并不需要部署 GAE 应用程序)。来自对 App Engine 应用程序的依赖:

If you are using a Google Cloud library to access Cloud Datastore,
your Cloud project requires an active App Engine application. Open the
App Engine dashboard and confirm your Cloud project has an active
App Engine app. Create an App Engine app if needed. The app must not
be disabled.