我最近在尝试部署我的firebase函数时遇到此错误.但是,自上次成功部署以来,我没有更改任何依赖项...
? functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
i functions: packaged functions (57.25 KB) for uploading
? functions: functions folder uploaded successfully
i functions: updating Node.js 6 function firestoreEmail(us-central1)...
i functions: updating Node.js 6 function apiMain(us-central1)...
? functions[apiMain(us-central1)]: Successful update operation.
? functions[firestoreEmail(us-central1)]: Deployment error.
Build failed: exit status 1
npm ERR! Linux 4.4.0-133-generic
npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "--global-style" "--production" "--fetch-retries=5" "--fetch-retry-factor=2" "--fetch-retry-mintimeout=1000" "install" "/workspace"
npm ERR! node v6.14.0
npm ERR! npm …Run Code Online (Sandbox Code Playgroud) 我们基于Firestore DB的模型自然发展。现在,我们想将所有现有文档更新为新的(隐式)架构。
是否有任何工具支持这一点或最佳实践是什么?我希望有一个与Rails ActiveRecord迁移相当的概念。
我们的应用程序自 3 月 22 日起投入生产。它利用 Firebase 可调用函数。函数的执行一直完美无缺,直到 3 月 28 日突然,我们开始观察到许多失败的执行在云函数日志中收到以下调试消息Function execution took 60000 ms, finished with status: 'error'。
虽然同一函数的某些执行失败,但其他函数却照常运行,平均完成时间为 250 毫秒。
在检查云平台基础设施状态时,没有任何迹象表明任何中断或任何其他问题。
例如我们有一个非常简单的函数:
exports.getAccommodations = functions
.region('asia-east1')
.https.onCall(async (data, context) => {
functions.logger.warn(`V3 STARTED`);
// load some collection from firestore here and return it
});
Run Code Online (Sandbox Code Playgroud)
请注意,该函数的第一行正在创建一个日志警告条目。我们能够观察到以下情况:
换句话说,看起来执行失败,甚至懒得执行函数体。我们在失败案例中看到的都是Function Execution started后面跟着的Function execution took 60000 ms, finished with status: 'error'。
这些是我们的日志,证实了我们的观察:
当过滤失败案例时:(resource.type="cloud_function" ) OR (resource.type="cloud_run_revision" ) textPayload="Function execution took …