Error: Cannot find module '../build/Release/bson'

518 views
Skip to first unread message

MaJoo

unread,
Jul 21, 2017, 6:25:18 AM7/21/17
to Node-RED

Hello Node-red Fan´s,

My node-red has been running clean and stable for many months.

After apt-get upgrade, a current version of node. js has been installed.
My node-red ran in the background.

After that my node-red crashed with a memory overflow and did not start.

Here the log:
Node-red [30862]: {[ERROR: Cannot find module '.. /build/Release/bson '] Code: ' MODULE_NOT_FOUND '}
Node-red [30862]: JS-Bson: Failed to load C++ bson extension, using pure js version

Also a new installation of node-red did not work.
NPM install Bson also did not help.


Node-V
V 4.8.4



Node red. JS-V
module. JS: 327
throw err;
^

Error: Cannot find module '/usr/lib/node_modules/red.js '
at function. module. _resolveFilename (module. JS: 325:15)
at function. module. _load (module. JS: 276:25)
at function. module. RunMain (module. JS: 441:10)
At startup (node. JS: 140:18)
At node. JS: 1043:3


I don't know any more advice on how to get it back up and running.


Best regards

Majoo

Dave C-J

unread,
Jul 21, 2017, 8:07:59 AM7/21/17
to node...@googlegroups.com
What platform and OS is this on ? What upgraded the node.js ?
--
Sent from phone.

MaJoo

unread,
Jul 21, 2017, 8:30:52 AM7/21/17
to Node-RED

Platform: Odroid XU4 with Debian 8

Debian updated with apt-get update and then apt-get upgrade.

Start-Date: 2017-07-20  00:57:07
Commandline: apt-get upgrade
Upgrade: libirs-export91:armhf (9.9.5.dfsg-9+deb8u11, 9.9.5.dfsg-9+deb8u12), evince-gtk:armhf (3.14.1-2+deb8u1, 3.14.1-2+deb8u2), libdns-export100:armhf (9.9.5.dfsg-9+deb8u11, 9.9.5.dfsg-9+deb8u12), apache2-bin:armhf (2.4.10-10+deb8u9, 2.4.10-10+deb8u10), libmagickcore-6.q16-2:armhf (6.8.9.9-5+deb8u9, 6.8.9.9-5+deb8u10), xserver-xorg-core:armhf (1.16.4-1, 1.16.4-1+deb8u1), imagemagick-6.q16:armhf (6.8.9.9-5+deb8u9, 6.8.9.9-5+deb8u10), libevview3-3:armhf (3.14.1-2+deb8u1, 3.14.1-2+deb8u2), libmagickwand-6.q16-2:armhf (6.8.9.9-5+deb8u9, 6.8.9.9-5+deb8u10), libisccc90:armhf (9.9.5.dfsg-9+deb8u11, 9.9.5.dfsg-9+deb8u12), xserver-common:armhf (1.16.4-1, 1.16.4-1+deb8u1), libisc-export95:armhf (9.9.5.dfsg-9+deb8u11, 9.9.5.dfsg-9+deb8u12), libisc95:armhf (9.9.5.dfsg-9+deb8u11, 9.9.5.dfsg-9+deb8u12), libbind9-90:armhf (9.9.5.dfsg-9+deb8u11, 9.9.5.dfsg-9+deb8u12), libdns100:armhf (9.9.5.dfsg-9+deb8u11, 9.9.5.dfsg-9+deb8u12), libsmbclient:armhf (4.2.14+dfsg-0+deb8u6, 4.2.14+dfsg-0+deb8u7), liblwres90:armhf (9.9.5.dfsg-9+deb8u11, 9.9.5.dfsg-9+deb8u12), libisccfg90:armhf (9.9.5.dfsg-9+deb8u11, 9.9.5.dfsg-9+deb8u12), evince-common:armhf (3.14.1-2+deb8u1, 3.14.1-2+deb8u2), imagemagick-common:armhf (6.8.9.9-5+deb8u9, 6.8.9.9-5+deb8u10), nodejs:armhf (4.8.3-1nodesource1~jessie1, 4.8.4-2nodesource1~jessie1), samba-libs:armhf (4.2.14+dfsg-0+deb8u6, 4.2.14+dfsg-0+deb8u7), bind9-host:armhf (9.9.5.dfsg-9+deb8u11, 9.9.5.dfsg-9+deb8u12), apache2-utils:armhf (2.4.10-10+deb8u9, 2.4.10-10+deb8u10), apache2-data:armhf (2.4.10-10+deb8u9, 2.4.10-10+deb8u10), libisccfg-export90:armhf (9.9.5.dfsg-9+deb8u11, 9.9.5.dfsg-9+deb8u12), apache2-doc:armhf (2.4.10-10+deb8u9, 2.4.10-10+deb8u10), apache2:armhf (2.4.10-10+deb8u9, 2.4.10-10+deb8u10), libevdocument3-4:armhf (3.14.1-2+deb8u1, 3.14.1-2+deb8u2), libwbclient0:armhf (4.2.14+dfsg-0+deb8u6, 4.2.14+dfsg-0+deb8u7), imagemagick:armhf (6.8.9.9-5+deb8u9, 6.8.9.9-5+deb8u10)
End-Date: 2017-07-20  00:59:35

MaJoo

unread,
Jul 21, 2017, 8:35:50 AM7/21/17
to Node-RED

Error: Cannot find module '/usr/lib/node_modules/red.js ' <--
  red.js does not live there but in /usr/lib/node_modules/node-red

Where can I find the modules. js?

Dave C-J

unread,
Jul 21, 2017, 8:42:12 AM7/21/17
to node...@googlegroups.com
There isn't one. You just need to run node-red .
Do you happen to know what version of node was there previously ? 
--
Sent from phone.

MaJoo

unread,
Jul 21, 2017, 9:08:35 AM7/21/17
to Node-RED

i found this in ...apt/term.log and must translate it to english:

Preparation for unpacking. .. /nodejs_4.8.4-2nodesource1 ~ jessi1_armhf... discovered old A-client, removing... unpack Nodejs (4.8.4-2nodesource1 ~ jessie1) About (4.8.3-1nodesource1 ~ jessie1)...

Dave C-J

unread,
Jul 21, 2017, 9:44:08 AM7/21/17
to node...@googlegroups.com
So it looks like it was on v4 already so should be ok. Looking at the original the message is just a warning that it is going to use a JavaScript library so should be fine   What does just running the.   node-red    command give?
--
Sent from phone.

MaJoo

unread,
Jul 21, 2017, 10:46:23 AM7/21/17
to Node-RED
logging trace:

Jul 21 16:41:28 TEST-MVT Node-RED[25597]: Welcome to Node-RED
Jul 21 16:41:28 TEST-MVT Node-RED[25597]: ===================
Jul 21 16:41:28 TEST-MVT Node-RED[25597]: 21 Jul 16:41:28 - [info] Node-RED version: v0.17.4
Jul 21 16:41:28 TEST-MVT Node-RED[25597]: 21 Jul 16:41:28 - [info] Node.js  version: v4.8.4
Jul 21 16:41:28 TEST-MVT Node-RED[25597]: 21 Jul 16:41:28 - [info] Linux 3.10.105+ arm LE
Jul 21 16:41:28 TEST-MVT Node-RED[25597]: 21 Jul 16:41:28 - [info] Loading palette nodes
Jul 21 16:41:30 TEST-MVT Node-RED[25597]: { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
Jul 21 16:41:30 TEST-MVT Node-RED[25597]: js-bson: Failed to load c++ bson extension, using pure JS version
Jul 21 16:41:30 TEST-MVT Node-RED[25597]: 21 Jul 16:41:30 - [warn] [mosca in] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument
Jul 21 16:41:32 TEST-MVT Node-RED[25597]: 21 Jul 16:41:32 - [info] Dashboard version 2.4.3 started at /ui
Jul 21 16:41:32 TEST-MVT Node-RED[25597]: 21 Jul 16:41:32 - [warn] ------------------------------------------------------
Jul 21 16:41:32 TEST-MVT Node-RED[25597]: 21 Jul 16:41:32 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
Jul 21 16:41:32 TEST-MVT Node-RED[25597]: 21 Jul 16:41:32 - [warn] ------------------------------------------------------
Jul 21 16:41:32 TEST-MVT Node-RED[25597]: 21 Jul 16:41:32 - [info] Settings file  : /root/.node-red/settings.js
Jul 21 16:41:32 TEST-MVT Node-RED[25597]: 21 Jul 16:41:32 - [info] User directory : /root/.node-red
Jul 21 16:41:32 TEST-MVT Node-RED[25597]: 21 Jul 16:41:32 - [info] Flows file     : /root/.node-red/flows_TEST-MVT.json
Jul 21 16:41:32 TEST-MVT Node-RED[25597]: 21 Jul 16:41:32 - [info] Server now running at https://127.0.0.1:1880/
Jul 21 16:41:32 TEST-MVT Node-RED[25597]: 21 Jul 16:41:32 - [debug] loaded flow revision: a68d7b34c357878c7b41f69b5de53f99
Jul 21 16:41:32 TEST-MVT Node-RED[25597]: 21 Jul 16:41:32 - [debug] red/runtime/nodes/credentials.load : no user key present
Jul 21 16:41:32 TEST-MVT Node-RED[25597]: 21 Jul 16:41:32 - [debug] red/runtime/nodes/credentials.load : using default key
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [info] Starting flows
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : global
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 80f4123a.94b4c
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 9132d5a5.47044
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 17b3ec95.becb93
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 3a483c15.f2fb24
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : dd30fc18.41cf7
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 4350f6cc.940128
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : d7d62b8.f223fd8
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 7b5b9216.f27cbc
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : d10aeada.bd16d8
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : ee2c1a33.0d4318
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 4ad22d98.ff7ea4
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 2747ae4e.668d42
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 309f6bba.cf80c4
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 9546b3b3.c78f
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 2e264c9c.568364
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 972be476.a01d18
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 4941a3f0.273694
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 8da05da0.31ac9
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 423fe229.0ac904
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 5ecebfc7.354d5
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : d647bb0c.435cb8
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 10e80ce7.8f7933
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : 4c0db0.0a32625
Jul 21 16:41:38 TEST-MVT Node-RED[25597]: 21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : f81862a1.316c9
Jul 21 16:42:01 TEST-MVT CRON[25860]: (root) CMD (rm /home/wsensmvt/.cache/chromium/Default/Cache/*)
Jul 21 16:42:23 TEST-MVT kernel: [15517.864547] [c3] PWM_0 : set_pwm_duty [65]
Jul 21 16:42:26 TEST-MVT kernel: [15520.888061] [c3] PWM_0 : set_pwm_duty [60]
Jul 21 16:42:56 TEST-MVT kernel: [15551.089800] [c3] PWM_0 : set_pwm_duty [65]
Jul 21 16:42:59 TEST-MVT kernel: [15554.113213] [c3] PWM_0 : set_pwm_duty [60]
Jul 21 16:43:01 TEST-MVT CRON[26238]: (root) CMD (rm /home/wsensmvt/.cache/chromium/Default/Cache/*)
Jul 21 16:43:20 TEST-MVT Node-RED[25597]: <--- Last few GCs --->
Jul 21 16:43:20 TEST-MVT Node-RED[25597]: 105242 ms: Mark-sweep 534.6 (621.6) -> 483.3 (622.6) MB, 3289.8 / 0 ms [allocation failure] [GC in old space requested].
Jul 21 16:43:20 TEST-MVT Node-RED[25597]: 108427 ms: Mark-sweep 502.3 (622.6) -> 481.8 (623.6) MB, 3185.1 / 0 ms [allocation failure] [GC in old space requested].
Jul 21 16:43:20 TEST-MVT Node-RED[25597]: 111165 ms: Mark-sweep 501.0 (623.6) -> 481.5 (622.6) MB, 2737.6 / 0 ms [last resort gc].
Jul 21 16:43:20 TEST-MVT Node-RED[25597]: 113825 ms: Mark-sweep 481.5 (622.6) -> 481.2 (621.6) MB, 2660.0 / 0 ms [last resort gc].
Jul 21 16:43:20 TEST-MVT Node-RED[25597]: <--- JS stacktrace --->
Jul 21 16:43:20 TEST-MVT Node-RED[25597]: ==== JS stack trace =========================================
Jul 21 16:43:20 TEST-MVT Node-RED[25597]: Security context: 0x3b4258f9 <JS Object>
Jul 21 16:43:20 TEST-MVT Node-RED[25597]: 1: createContext [vm.js:~27] [pc=0xa25b6ebc] (this=0x5a5b20cd <an Object with map 0x29518bc5>,sandbox=0xb21d4629 <an Object with map 0x34c145fd>)
Jul 21 16:43:20 TEST-MVT Node-RED[25597]: 2: new constructor(aka FunctionNode) [/usr/lib/node_modules/node-red/nodes/core/core/80-function.js:190] [pc=0x5bb36600] (this=0xb21d777d <a FunctionNode with map 0x34c143ed>,n=0xb21d788d <an Object with map 0x57940f71>)
Jul 21 16:43:20 TEST-MVT Node-RED[25597]: 4: createNode(aka crea...
Jul 21 16:43:20 TEST-MVT Node-RED[25597]: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Jul 21 16:43:20 TEST-MVT systemd[1]: nodered.service: main process exited, code=killed, status=6/ABRT
Jul 21 16:43:20 TEST-MVT systemd[1]: Unit nodered.service entered failed state.
Jul 21 16:43:20 TEST-MVT systemd[1]: nodered.service holdoff time over, scheduling restart.
Jul 21 16:43:20 TEST-MVT systemd[1]: Stopping Node-RED graphical event wiring tool....
Jul 21 16:43:20 TEST-MVT systemd[1]: Starting Node-RED graphical event wiring tool....
Jul 21 16:43:20 TEST-MVT systemd[1]: Started Node-RED graphical event wiring tool..

MaJoo

unread,
Jul 21, 2017, 10:51:27 AM7/21/17
to Node-RED

21 Jul 16:41:38 - [debug] red/nodes/flows.start : starting flow : f81862a1.316c9

It looks like node-red only runs up to this flow and the memory runs full.

Dave C-J

unread,
Jul 21, 2017, 11:59:48 AM7/21/17
to node...@googlegroups.com
So something in that flow is blowing the memory. It looks like one of the function nodes. 
Worst case start a clean flow.   Node-red newflow.json    The open existing in an editor and import it back into the editor.  Then delete the function node before deploying 
--
Sent from phone.

MaJoo

unread,
Jul 21, 2017, 12:17:24 PM7/21/17
to Node-RED


Node-Red runs with an empty flows_TEST MVT.json, so the error should be in my JSON.

I just wonder why everything is running for over 1.5 years and having passed an event.

In the JSON stuck over 1.5 years of development, which now threaten to fail.
This is a very bitter setback.

I could cry.

Dave C-J

unread,
Jul 21, 2017, 12:25:09 PM7/21/17
to node...@googlegroups.com
Well it may just be trying to handle more or larger chunks of data
--
Sent from phone.

MaJoo

unread,
Jul 21, 2017, 12:33:50 PM7/21/17
to Node-RED


I thank you for your help and your precious time.

I'm going to try to save as much as possible, but for that I need to know which function is causing the error.

steve rickus

unread,
Jul 21, 2017, 12:49:00 PM7/21/17
to Node-RED
There are at least 2 things that changed that could affect your instance. You say that a new version of nodejs was installed -- usually that means that the cache needs to be cleaned and any binary modules rebuilt (at least that's the suggestions I remember seeing... not had to do it myself so I can't tell you how to do that).

The other suspect is the bson module itself -- is this related to MongoDB? If your install was using a native version prior to the apt-upgrade process, then it's reasonable that the pure native js module would run slower and consume more memory. Again, i've not used Mongo or the bson module, but I would look for a way to recompile that module and avoid using the pure js version, if that makes sense.

A quick search on stack overflow turned up some suggestions to reinstall node-gyp and build-essentials, and then do this:

I suggest going into node_modules/mongodb/node_modules/bson directory and from there use
node-gyp rebuild

That solved the problem for me.


Mark Setrem

unread,
Jul 21, 2017, 12:52:04 PM7/21/17
to Node-RED
if it's that much of a setback for you why not revert to the backup you took before you did the upgrade?

MaJoo

unread,
Jul 21, 2017, 1:27:28 PM7/21/17
to Node-RED


I've never had a problem after an apt-get upgrade so I'm amazed that it happened now.

I have a backup of course, but there the newer parts have not been incorporated.
Since I have been testing for the newer parts to program several months.
 
I'm not a programmer, I'm learning to try out.


I have no mongodb Modul installed, only for mysql.

And now I´m searching the bson
Directory.

I tried it with node-Gyp rebuild but get the following messages:

gyp: binding.gyp not found (cwd: /root/.node-red/node_modules/node-red-contrib-mqtt-broker) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)
gyp ERR! System Linux 3.10.105+
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /root/.node-red/node_modules/node-red-contrib-mqtt-broker
gyp ERR! node -v v4.8.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

Julian Knight

unread,
Jul 22, 2017, 10:56:44 AM7/22/17
to Node-RED
As long as you have a package.json in your .node-red folder with all of your required modules in it, you can just delete the node_modules folder and then do "npm install" from the .node-red folder which will rebuild everything for you.

Clearly something has gone awry with your installation. I would reinstall the modules before throwing away your flows.

MaJoo

unread,
Jul 25, 2017, 8:37:48 AM7/25/17
to Node-RED
The error
Node-red [30862]: {[ERROR: Cannot find module '../build/Release/bson '] Code: ' MODULE_NOT_FOUND '}
Node-red [30862]: JS-Bson: Failed to load C++ Bson extension, using pure JS version
was caused by the module
Node-red-contrib-mqtt-Dynamic 1.0.9
Can't install via NPM, I get many errors.
I don't need this package anymore:-)

I was able to identify and remove it with the help of the node-red version 0.17.5, through disabled tabs.

When checking the functions, I removed all the German special characters in the descriptions.

---------------------------------------------------------------------------------------

With NVM I tested the Nodejs versions 4.8.3, 4.8.4, 6.11.0 and 6.11.1,
Unfortunately, the memory usage is severely limited via bash.
This was noticeable in the Nodejs versions 4.8.3 and 6.11.0 node-Red ran up to a point (until RAM in use 260MB) and at Nodejs 4.8.4 and 6.11.1 the memory in use went up directly.

I found in the apt archive on my odroid
Nodejs_ 4.8.3-1nodesource1 ~ JESSIE1_ARMHF. deb
Nodejs_ 6.10.2-1nodesource1 ~ JESSIE1_ARMHF. deb

Both I tried with node-red 0.17.5 and there was no memory problem with node-red.
But the work in the browser has been greatly decelerated by lagging when using Nodejs_ 4.8.3 and Nodejs_ 6.10.2. (Very many nodes per tab, flow. JSON = 1174KB)

As soon as I use 4.8.4 or 6.11.1, node-red runs the memory in use directly up until SYSTEMD node-red restarts.

Nodejs writes in the change log the vulnerabilities were eliminated because parts removed, the real problem they want to take care of later.

Currently my flow. JSON with Nodejs 4.8.3 and node-red 0.16.2 is very stable.


I am still looking for nodejs_ 6.11.0-Xnodesource1 ~ JESSIE1_ARMHF. Deb.


Sorry for my bad english^^



Have a nice day

Majoo

MaJoo

unread,
Jul 25, 2017, 9:40:14 AM7/25/17
to Node-RED

I want to add a curve, it shows the RAM in use of node-red......



Until Thursday everything went nicely with 4.8.3 then came 4.8.4, until Monday then my attempts to get node-red to the running again, which then ended nicely.


habt einen schönen Tag

MaJoo
nodejs-problem.png
node-js-daily.png

MaJoo

unread,
Jul 25, 2017, 9:42:33 AM7/25/17
to Node-RED


Reply all
Reply to author
Forward
0 new messages