当前位置: 动力学知识库 > 问答 > 编程问答 >

Google App Engine Node.js Application Unhealthy

问题描述:

I am attempting to test a fairly straightforward node.js app on google app engine. As seen below, all it is intended to do is listen to a change in a Firebase database, and subsequently send a GCM message to a user:

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);

});

However, every time I attempt to deploy to the app engine, the process runs smoothly until Updating module [default].../, running for several minutes, whereby the error appears:

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).

I am fairly new to node.js as well as appengine, but I am simply attempting to test to ensure all components work together.

Why would this error exist?

网友答案:

This almost always means you have a crash during app startup when running in App Engine. We're not very good at surfacing these kinds of crashes today during deployment (working on that). To see what's going on:

  1. Go to the developers console
  2. Click on cloud logging

  1. Look for a crash.log or stderr:

That's where you'll usually find the problem. Hope this helps!

分享给朋友:
您可能感兴趣的文章:
随机阅读: