2017-01-19 1 views
0

Après la migration de mon application passe-partout Watson IoTP vers Diego, elle ne démarre plus. Je vois cela dans le journal:L'application passe-partout IoTP ne fonctionne pas après la migration de Diego

[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"} 

Comment puis-je résoudre ce problème?

Répondre

3

Le problème est que la façon dont les applications trouvent le port auquel se connecter a changé avec Diego. La variable d'environnement VCAP_APP_PORT n'est plus renseignée par défaut. Pour le réparer, vous devez créer un repo git pour votre application (onglet Présentation -> Livraison continue -> Ajouter GIT). Utilisez jazzhub pour modifier le bluemix-settings.js fichier pour changer

uiPort: process.env.VCAP_APP_PORT

à

uiPort: process.env.PORT

déployer ces changements et l'application devrait commencer.

+0

merci @alexandrakayy, qui l'a fixé pour moi –

0

J'ai rencontré un problème similaire avec une application npm express et l'ai corrigée sans avoir à modifier le fichier bluemix-settings.js.

Simple supprimer toutes les références à process.env.VCAP_APP_HOST (n'est plus une référence dans Diego) et modifier process.env.VCAP_APP_PORT à process.env.PORT.

par exemple,

var host = 'localhost'; 
var port = (process.env.PORT || 1337); 
app.listen(port, host); 
console.log('App started on port ' + port); 

Vous pouvez vérifier si votre application est en cours d'exécution Diego en tapant:

cf has-diego-enabled APPNAME 

après avoir installé l'outil cli diego

cf install-plugin Diego-Enabler -r CF-Community 

J'ai aussi Contrôles de santé handicapés:

cf set-health-check APPNAME none