Google App Engine Node.js应用程序不健康
我试图在谷歌应用程序引擎上testing一个相当直接的node.js应用程序。 如下所示,它所要做的就是听取Firebase数据库中的更改,然后将GCM消息发送给用户:
var Firebase = require("firebase"); var gcm = require('node-gcm'); // Create a reference to the push notification queue var ref = new Firebase("firebaseDB"); var message = new gcm.Message(); var regTokens = ['A user GCM reg token']; // Set up the sender with you API key var sender = new gcm.Sender('GCM sender ID'); message.addData('syncNewData', 'Hello Member!'); ref.on("value", function(snapshot) { // Now the sender can be used to send messages sender.send(message, { registrationTokens: regTokens }, function (err, response) { if(err) console.error(err); else console.log(response); }); console.log(snapshot.val()); }, function (errorObject) { console.log("The read failed: " + errorObject.code); });
但是,每次尝试部署到应用程序引擎时,该过程都将平稳运行,直到Updating module [default].../
,运行几分钟,从而出现错误:
ERROR: (gcloud.preview.app.deploy) Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).
我对node.js以及appengine相当陌生,但我只是试图testing以确保所有组件一起工作。
为什么会出现这个错误?
这几乎总是意味着在App Engine中运行应用程序启动期间发生崩溃。 今天在部署(正在进行)中,我们并不擅长处理这些崩溃。 要看看发生了什么事情:
- 转到开发者控制台
- 点击云日志logging
- 查找
crash.log
或stderr
:
这就是你通常会发现问题的地方。 希望这可以帮助!
- gcloud预览应用程序部署返回400与消息应用程序引擎服务帐户没有足够的项目权限。 需要开发者或所有者
- 自定义运行时node.js – 在Google App Engine中看不到我的自定义日志
- 无法使用Google App Engine上的nodejs应用程序更新虚拟机
- Google App Engine – Node.js – 未从请求处理程序发送的出站https请求
- Http请求不会路由到Https NodeJs
- Google应用引擎上的服务器端JavaScript
- 如何通过Google Clouddebugging在Docker容器中运行的Nodejs应用程序
- gcloud App Engine与Docker和Babel的灵活的陌生性
- Node.js教程触发所有App引擎VM实例