Search code examples
ibm-cloudnode-redwatson-iotdiego

IoTP boilerplate application not working after Diego migration


After migrating my Watson IoTP boilerplate application to Diego, it not longer starts. I see this in the log:

[APP/0]      OUT Welcome to Node-RED
[APP/0]      OUT ===================
[APP/0]      OUT 18 Jan 15:43:16 - [info] Node-RED version: v0.15.3
[APP/0]      OUT 18 Jan 15:43:16 - [info] Node.js  version: v4.6.2
[APP/0]      OUT 18 Jan 15:43:16 - [info] Linux 4.4.0-45-generic x64 LE
[APP/0]      OUT 18 Jan 15:43:16 - [info] Loading palette nodes
[APP/0]      OUT 18 Jan 15:43:18 - [warn] [ibm hdfs in] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
[APP/0]      OUT 18 Jan 15:43:18 - [warn] [ibm hdfs] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
[APP/0]      OUT 18 Jan 15:43:18 - [warn] [ibmpush] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
[APP/0]      OUT 18 Jan 15:43:20 - [info] Settings file  : /home/vcap/app/bluemix-settings.js
[APP/0]      OUT 18 Jan 15:43:20 - [info] Server now running at http://127.0.0.1:`**1880**`/red/
[APP/0]      OUT 18 Jan 15:43:20 - [info] Starting flows
[APP/0]      OUT 18 Jan 15:43:20 - [info] Started flows
[CELL/0]     ERR Timed out after 1m0s: health check never passed.
[CELL/0]     OUT Exit status 0
[CELL/0]     OUT Destroying container
[API/8]      OUT App instance exited with guid ca3f2bbd-ac6e-42ec-8a61-1ff704274c3e payload: {"instance"=>"", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 1 error(s) occurred:\n\n* Exited with status 4\n* 2 error(s) occurred:\n\n* cancelled\n* process did not exit", "crash_count"=>2, "crash_timestamp"=>1484754267594231230, "version"=>"0361fa77-694c-4e8f-991e-0c52dd0c4c87"}

How can I fix this ?


Solution

  • The problem is that the way apps find the port to bind to has changed with Diego. The VCAP_APP_PORT environment variable is no longer populated by default. To fix it, you need to create a git repo for your app (Overview tab -> Continuous Delivery -> Add GIT). Use jazzhub to edit the bluemix-settings.js file to change

    uiPort: process.env.VCAP_APP_PORT

    to

    uiPort: process.env.PORT

    Deploy those changes and the app should start.