The following the log dump from my cf push :
2014-09-09T15:47:35.92+0530 [App/0] ERR 2014-09-09T15:47:35.97+0530 [DEA] OUT Instance (index 0) failed to start accepting connections 2014-09-09T15:47:55.71+0530 [DEA] OUT Starting app instance (index 0) with guid 20dba222-e0e6-453c-96a9-429940bc7002 2014-09-09T15:47:57.59+0530 [API] OUT App instance exited with guid 20dba222-e0e6-453c-96a9-429940bc7002 payload: {"cc_partition"=>"default", "droplet"=>"20dba222-e0e6-453c-96a9-429940bc7002", "version"=>"832505e6-a95d-4696-910e-a8d4a74a7005", "instance"=>"4ff487a75a674aa79b234cc1bd8f9a3d", "index"=>0, "reason"=>"CRASHED", "exit_status"=>0, "exit_description"=>"app instance exited", "crash_timestamp"=>1410257878} 2014-09-09T
This is how my manifest.yml file looks like :
applications:
- name: nodetestSDB
memory: 128M
command: node app.js
services:
- mongodbnode
This is how my package.json file looks like :
{
"name": "nodetest2",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"express": "~4.8.6",
"body-parser": "~1.6.6",
"cookie-parser": "~1.3.2",
"morgan": "~1.2.3",
"serve-favicon": "~2.0.1",
"debug": "~1.0.4",
"jade": "~1.5.0",
"mongodb": "*",
"monk": "*"
}
}
The environment variable in app.js :
if (process.env.VCAP_SERVICES) {
var env = JSON.parse(process.env.VCAP_SERVICES);
if (env['mongodb-2.2']) {
var mongo = env['mongodb-2.2'][0]['credentials'];
}
var db = monk(mongo.url);
}