为什么我的node-red应用程序在ibm-cloud中返回404路由错误?

时间:2018-04-16 00:26:44

标签: ibm-cloud node-red

我在bluemix中的node-red应用程序正在运行,但现在它不允许我访问该路由。它以前工作过,我没有修改它。 我收到了这个错误:

404 Not Found: Requested route ('route.mybluemix.net') does not exist.

最近的日志是:

   2018-04-16T09:37:46.60-0300 [CELL/0] OUT Creating container
   2018-04-16T09:37:47.42-0300 [CELL/0] OUT Successfully created container
   2018-04-16T09:37:54.32-0300 [CELL/0] OUT Starting health monitoring of container
   2018-04-16T09:37:55.41-0300 [APP/PROC/WEB/0] OUT > node-red-bluemix@0.8.0 start /home/vcap/app
   2018-04-16T09:37:55.41-0300 [APP/PROC/WEB/0] OUT > node --max-old-space-size=180 index.js --settings ./bluemix-settings.js -v
   2018-04-16T09:37:55.62-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:55 - Starting Node-RED on IBM Cloud bootstrap
   2018-04-16T09:37:55.62-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:55 - Loading bluemix-settings.js
   2018-04-16T09:37:55.72-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:55 - Using Cloudant service: /^NodeRed.cloudantNoSQLDB/ : NodeRed
   2018-04-16T09:37:56.08-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:56 - Loading application settings
   2018-04-16T09:37:56.22-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:56 - Using runtime settings for adminAuth
   2018-04-16T09:37:56.77-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:56 - [info] 
   2018-04-16T09:37:56.77-0300 [APP/PROC/WEB/0] OUT Welcome to Node-RED
   2018-04-16T09:37:56.77-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:56 - [info] Linux 4.4.0-109-generic x64 LE
   2018-04-16T09:37:56.77-0300 [APP/PROC/WEB/0] OUT ===================
   2018-04-16T09:37:56.77-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:56 - [info] Node-RED version: v0.18.2
   2018-04-16T09:37:56.77-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:56 - [info] Node.js  version: v6.12.3
   2018-04-16T09:37:57.25-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:57 - [info] Loading palette nodes
   2018-04-16T09:37:59.99-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:59 - [warn] Missing node modules:
   2018-04-16T09:37:59.99-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:59 - [warn]  - node-red-contrib-telegrambot (2.7.3): telegram bot, telegram receiver, telegram command, telegram callback_query, telegram sender, telegram reply
   2018-04-16T09:37:59.99-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:59 - [warn]  - node-red-contrib-play-audio (2.2.4): play audio
   2018-04-16T09:37:59.99-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:59 - [warn]  - node-red-contrib-browser-utils (0.0.5): fileinject, microphone, camera
   2018-04-16T09:38:00.00-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:38:00 - [info] Installing module: node-red-contrib-play-audio, version: 2.2.4
   2018-04-16T09:37:59.99-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:37:59 - [info] Installing module: node-red-contrib-telegrambot, version: 2.7.3
   2018-04-16T09:38:00.21-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:38:00 - [info] Installing module: node-red-contrib-browser-utils, version: 0.0.5
   2018-04-16T09:38:00.30-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:38:00 - [info] Settings file  : /home/vcap/app/bluemix-settings.js
   2018-04-16T09:38:00.30-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:38:00 - [info] HTTP Static    : /home/vcap/app/public
   2018-04-16T09:38:00.44-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:38:00 - [info] Server now running at http://127.0.0.1:8080/red/
   2018-04-16T09:38:00.60-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:38:00 - [info] Waiting for missing types to be registered:
   2018-04-16T09:38:00.60-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:38:00 - [info]  - telegram bot
   2018-04-16T09:38:00.60-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:38:00 - [info]  - telegram receiver
   2018-04-16T09:38:00.60-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:38:00 - [info]  - telegram sender
   2018-04-16T09:38:00.60-0300 [APP/PROC/WEB/0] OUT 16 Apr 12:38:00 - [info]  - microphone
   2018-04-16T09:38:00.92-0300 [CELL/0] OUT Container became healthy
   2018-04-16T09:38:03.47-0300 [APP/PROC/WEB/0] ERR Killed
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! Linux 4.4.0-109-generic
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! argv "/home/vcap/app/vendor/node/bin/node" "/home/vcap/app/vendor/node/bin/npm" "start"
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! node v6.12.3
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! npm  v3.10.10
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! code ELIFECYCLE
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! node-red-bluemix@0.8.0 start: `node --max-old-space-size=180 index.js --settings ./bluemix-settings.js -v`
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! Exit status 137
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! 
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! Failed at the node-red-bluemix@0.8.0 start script 'node --max-old-space-size=180 index.js --settings ./bluemix-settings.js -v'.
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! Make sure you have the latest version of node.js and npm installed.
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! If you do, this is most likely a problem with the node-red-bluemix package,
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! not with npm itself.
   2018-04-16T09:38:03.49-0300 [APP/PROC/WEB/0] ERR npm ERR! Tell the author that this fails on your system:
   2018-04-16T09:38:03.50-0300 [APP/PROC/WEB/0] ERR npm ERR!     node --max-old-space-size=180 index.js --settings ./bluemix-settings.js -v
   2018-04-16T09:38:03.50-0300 [APP/PROC/WEB/0] ERR npm ERR! You can get information on how to open an issue for this project with:
   2018-04-16T09:38:03.50-0300 [APP/PROC/WEB/0] ERR npm ERR!     npm bugs node-red-bluemix
   2018-04-16T09:38:03.50-0300 [APP/PROC/WEB/0] ERR npm ERR! Or if that isn't available, you can get their info via:
   2018-04-16T09:38:03.50-0300 [APP/PROC/WEB/0] ERR npm ERR!     npm owner ls node-red-bluemix
   2018-04-16T09:38:03.50-0300 [APP/PROC/WEB/0] ERR npm ERR! There is likely additional logging output above.
   2018-04-16T09:38:03.53-0300 [APP/PROC/WEB/0] ERR npm ERR! Please include the following file with any support request:
   2018-04-16T09:38:03.53-0300 [APP/PROC/WEB/0] ERR npm ERR!     /home/vcap/app/npm-debug.log
   2018-04-16T09:38:03.61-0300 [APP/PROC/WEB/0] OUT Exit status 1 (out of memory)

在我没有遇到所有这些错误之前,我没有修改过我的节点。

1 个答案:

答案 0 :(得分:1)

当Node-RED在IBM Cloud中重新启动时,它必须检查它是否仍然通过调色板管理器添加了所有额外节点。这是因为这些节点没有被添加到存储的应用程序映像中,因此在重新停顿时会丢失。

如果发现任何缺失,Node-RED将动态重新安装它们。你可以在日志中看到它开始三次重新安装。这就是问题所在。

通过并行安装这些节点,应用程序很可能会耗尽内存并被杀死。对于Lite帐户,您只能使用256Mb - 这并不多。

您有两种可能的解决方法:

  • 启用持续交付功能(最后我查看,在应用程序IBM Cloud仪表板页面的右下角)。这将为您提供一个git存储库,您可以编辑源代码。编辑package.json文件以在dependencies部分下包含这些附加节点模块。这将确保节点作为应用程序映像的一部分安装,并且无需在重新启动时重新安装。

  • 升级到标准帐户,您可以将应用程序免费升级到512Mb内存。

由于Lite帐户是以256Mb内存限制引入的,因此我们更频繁地看到这种情况。我们将不得不查看重新安装代码,以了解如何按顺序而不是并行地进行安装。它需要更长的时间,但应尽量减少内存使用量。