Hi all,
While I cf push my app.js, following error will occur and then failed.
After searching the forum, it seems I might encounter the same problem as described here.
I've tried the solution as provided by Richard to resolve this:
cf delete myappname
cf delete-route mybluemix.net -n myappname
cf push myappname -p . --no-route
Unfortunately, I still got the same failure result. I also tried cf logs while pushing my app, but just got nothing. My app.js runs perfectly on my local environment, so I'm wondering if I make something wrong while pushing.
This is my manifest.yml
disk: 1024M
name: myappname
command: node app.js
path: .
domain: mybluemix.net
memory: 512M
instances: 1
My app.js (the code is simplied and still can reproduce the same issue)
var ibmbluemix = require('ibmbluemix'), ibmpush = require('ibmpush'), ibmdata = require('ibmdata');
//configuration for application var appConfig = { applicationId: "......", applicationRoute: "......", applicationSecret: "......" };
var INTERVAL = 5000;
//initialize mbaas-config module ibmbluemix.initialize(appConfig); IBMData.initializeService(); var push = IBMPush.initializeService();
setInterval(logConsole, INTERVAL);
function logConsole(){ console.log("show up every " + INTERVAL/1000 + " seconds."); }
Any comments would be highly appreciated. Thanks!
Can you provide the output from the cf logs JudeSquadTracker --recent
as mentioned in the TIPS section on the command line. This will provide some information as to why the app is not starting.
Hi Andrew, I actually did, but there was no log at all:
D:\Works\Android_DEV\RockStarWS\SquadTracker\NodeJS>cf logs JudeSquadTracker --recent Connected, dumping recent logs for app JudeSquadTracker in org judehung@tw.ibm.c om / space dev as judehung@tw.ibm.com...
D:\Works\Android_DEV\RockStarWS\SquadTracker\NodeJS>
Did you run that straight after the failure to push? The log stream is only held for a period of time so if you ran the cf logs command sometime after the cf push command you might not see any output. I would run the cf push command again (with the --no-route option still) and then run the cf logs command with the --recent option.
Hi Andrew, Yes, I did execute "cf logs JudeSquadTracker --recent" right after the cf push command terminated, and there was no log.
Moreover, I also opened another terminal to cf login and then cf logs while cf push my app. There was still no log.
I am not sure why you are not seeing the logs. I just verified that the log stream is working in general, so it is not a problem there. If you have just pushed app JudeSquadTracker
in that org/space and it failed to start, then the cf logs command with the --recent option should show something as the app was staged but failed to start.
Can I confirm you are running on the production Bluemix server (ace.ng.bluemix.net)?
Answer by judehung (15) | Oct 16, 2014 at 07:12 AM
Finally found the root cause why my push command always failed: I was using an old version of cf cli (cf version 6.0.2-96d242f). After updating the cf cli to the latest version (cf version 6.6.0-dbf6f21-2014-09-23T20:52:55+00:00), everything works perfectly.
Thanks everyone for all the support and quick response!
Answer by ChrisBailey (456) | Oct 16, 2014 at 06:18 AM
In order to mark an instance as running, is must start to respond on VCAP_APP_PORT or have the no-route attribute set in the manifest.yml or the --no-route option on the cf push command.
Hi Chris,
I update my manifest.yml with one more attribute:
no-route: true
Then rerun cf push command with --no-route option, but I still got the same failure result.
Hi Chris, The root cause of all these troubles is due to my old version cf cli. After updating the cf cli to the latest version, both push and logs works perfectly. Thanks for all the support and quick response!
Routes deleted for my NODEJS app ? 3 Answers
What controls the builder configuration when editing the Configure Pipeline for DevOps Services? 1 Answer
How to deploy a web app based on grunt 2 Answers
Integration between nodejs (bluemix) and IBM BPM (hosted on cloud) 1 Answer
Getting an "Unauthorized" response on my public html files only after scaling to multiple containers 2 Answers