apt-get install bb-node-red-installer fail

I’m still having issues with installing the node-red & bonescript stuff.

I have a BBW that has been running my IOT application 24/7 with great success for about the last four or five months. Its running:

cat /etc/dogtag
BeagleBoard.org Debian Image 2015-11-12

uname -a
Linux alarmbone 4.1.18-ti-r49 #1 SMP PREEMPT Fri Feb 26 00:12:54 UTC 2016 armv7l GNU/Linux

It was installed from a 2GB console image but I’ve apt-get installed enough X stuff to get ssh -X gedit to work (although I rarely actually use it this way). Its been kept current with apt get update and apt-get upgrade a couple of times a month although its basically dedicated to running this app and its development/testing/debugging.

I also have a BBG that I’m setting up for a friend that has a nicely working bonescript and node-red starting from an lxqt 2016-04-03 image. While playing with this I though of a simple idea to add some mqtt functionality to my IOT application using node-red. My BBW is already running the mosquito mqtt broker and I’ve used it as such while testing node-red on the BBG and RPi2 So now I thought I’d install node-red to my BBW console image but the installation fails.

I’ve never had these kinds of problems with apt-get install failures on other Ubuntu & Debian systems.

apt-get install bb-node-red-installer

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
bb-node-red-installer
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,140 B of archives.
After this operation, 49.2 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://repos.rcn-ee.com/debian/ jessie/main bb-node-red-installer all 0.13.4-0rcnee1~bpo80+20160321+1 [4,140 B]
Fetched 4,140 B in 0s (32.3 kB/s)
Selecting previously unselected package bb-node-red-installer.
(Reading database … 80178 files and directories currently installed.)
Preparing to unpack …/bb-node-red-installer_0.13.4-0rcnee1~bpo80+20160321+1_all.deb …
Unpacking bb-node-red-installer (0.13.4-0rcnee1~bpo80+20160321+1) …
Setting up bb-node-red-installer (0.13.4-0rcnee1~bpo80+20160321+1) …
bb-node-red-installer:npm: [1.4.21]
bb-node-red-installer:node: [v0.10.42]
bb-node-red-installer:Installing: systemd-0.2.6 (for node-red)
systemd@0.2.6 /usr/local/lib/node_modules/systemd
bb-node-red-installer:Installing: node-red-0.13.4 (for node-red)

bcrypt@0.8.5 install /usr/local/lib/node_modules/node-red/node_modules/bcrypt
node-gyp rebuild

make: Entering directory ‘/usr/local/lib/node_modules/node-red/node_modules/bcrypt/build’
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
Killed
dpkg: error processing package bb-node-red-installer (–configure):
subprocess installed post-installation script returned error exit status 137
Errors were encountered while processing:
bb-node-red-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)

Am I doomed in my attempt to keep an “old” Jessie system reasonably up to date as things evolve?

I’ve never had these kinds of problems with apt-get install failures on other Ubuntu & Debian systems.

I’ve seen several, and in fact when udev was new, and incorporated into Ubuntu. You could apt-get install several “applications” that fell flat on their faces. Xen, and iSCSI tools were two such cases I can remember. I also distinctly remember a gcc bug creeping into Debian stable when Sarge was still in testing. Yes, these were all a long time ago. Anyway the short point of it all is that no one, and nothing created by humans is perfect.

Am I doomed in my attempt to keep an “old” Jessie system reasonably up to date as things evolve?

You know I thought you had something working before. So I’ve been wondering why didn’t you stick with that ?

Remember, this "bb-node-red-installer" is not a normal debian package..

it's internally calling "nodejs npm install node-red@xyz_version" as root..

So a "big" no-no in the debian/ubuntu world.

But we did it because users requested it..

"2015-11-12" was before we upgraded to nodejs 0.12.x, so by default it has
nodejs 0.10.x*

anywho, i tried to replicate what you did last time, but it worked for me.

We don't have enough developers as-is right now and i know it works on the
latest snapshots..

Regards,

So the question appears to become can this system be upgraded to node-js 0.12.x?

If it can’t, I can test my idea on the RPi2 or BBG and only put a new image on the BBW to run it where it “belongs” if it pans out.
Physical accessibility of the BBW is less than convenient now that the hardware aspects of the project are complete and its been mounted in its permanent home, so if there is an apt-get or git pull type of solution I’d much prefer to give it a try first.

So the question appears to become can this system be upgraded to node-js
0.12.x?

Yeap, as root:

wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -

apt-get update
apt-get install apt-transport-https

echo 'deb https://deb.nodesource.com/node_0.12 jessie main' >
/etc/apt/sources.list.d/nodesource.list
echo 'deb-src https://deb.nodesource.com/node_0.12 jessie main' >>
/etc/apt/sources.list.d/nodesource.list

apt-get update
apt-get install nodejs

If it can't, I can test my idea on the RPi2 or BBG and only put a new
image on the BBW to run it where it "belongs" if it pans out.
Physical accessibility of the BBW is less than convenient now that the
hardware aspects of the project are complete and its been mounted in its
permanent home, so if there is an apt-get or git pull type of solution I'd
much prefer to give it a try first.

Regards,

I’ve had really good results with this: https://github.com/mark-webster/node-debian.git. But the last build I attempted on Wheezy, on a RevC BBB failed. The error was also rather cryptic, so I was unable to find a cure right off. The same version compiled just fine manually though . . .

The one nice thing about nodesource...

Swap the "node_0.12" for any of these:

node_4.x
node_5.x
node_6.x

and then just, apt-get update ; apt-get upgrade...

Regards,

Thanks for the suggestion but it still didn’t work:

Setting up bb-node-red-installer (0.13.4-0rcnee1~bpo80+20160321+1) …
bb-node-red-installer:npm: [2.15.0]
bb-node-red-installer:node: [v0.12.13]
bb-node-red-installer:Installing: systemd-0.2.6 (for node-red)
npm WARN engine systemd@0.2.6: wanted: {“node”:">=0.6.11 <0.11.0"} (current: {“node”:“0.12.13”,“npm”:“2.15.0”})
systemd@0.2.6 /usr/local/lib/node_modules/systemd
bb-node-red-installer:Installing: node-red-0.13.4 (for node-red)

bcrypt@0.8.5 install /usr/local/lib/node_modules/node-red/node_modules/bcrypt
node-gyp rebuild

Killed
dpkg: error processing package bb-node-red-installer (–configure):
subprocess installed post-installation script returned error exit status 137
Errors were encountered while processing:
bb-node-red-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)

I do appreciate your effort.

I'll double check this on sunday, at work my flash drive only goes back too
2016-03-20, but i have all the snapshots on a nas at home..

Regards,

If I’m the only one with this issue don’t worry about it, please move on to more important things.

I did test my idea using node-red on the BBG. The mqtt stuff worked nicely with the BBW as the broker, but my read of how the exec node worked from the info pane description was wishful thinking. I was wanting one message for each output line on stdout from the application launched by the exec node as it runs (its a status monitoring application that prints one line for each IOT system variable status change, its a client that talks to a server running on the BBW). What I got was one output message with all the stdout when I killed the program (deamon) as if I’d piped it to a file and then cat the file.

I may play around with piping the output to a file and using the tail node to generate the messages, but it was just a neat idea that could have been a “real use” of node-red for me. I probably should have tried this before trying to upgrade the node-red on the BBW system which ultimately was a distraction. But at least now I know if I need node-red on the BBW I’ll need to start with a fresh image.

Thanks again!

Playing around with tail -f, it turned out the unwanted node-red behavior was because I forgot to call fflush().

This didn’t matter for the usage it was originally written for. After a quick recompile of the client after adding fflush() I can make very good use of this as a rapid prototype as it is by using the BBG as a middleman, but its probably better I modify the original BBW IOT application to use libmosquito to send message to the broker as my monitoring client exposes all the state variables, many of which are of no use to a client and were only included for test/debug purposes in the client.

But my first “real use” of node-red has to be scored a success and it delivered a lot of functionality for minimal effort.

Down the road I’ll decide if its easier to mod the IOT app to use libmosquito or swap in a new SD card (physical access issues with the BBW).

Thanks again for all the help!

Playing around with tail -f, it turned out the unwanted node-red behavior
was because I forgot to call fflush().

This didn't matter for the usage it was originally written for. After a
quick recompile of the client after adding fflush() I can make very good
use of this as a rapid prototype as it is by using the BBG as a middleman,
but its probably better I modify the original BBW IOT application to use
libmosquito to send message to the broker as my monitoring client exposes
all the state variables, many of which are of no use to a client and were
only included for test/debug purposes in the client.

But my first "real use" of node-red has to be scored a success and it
delivered a lot of functionality for minimal effort.

Down the road I'll decide if its easier to mod the IOT app to use
libmosquito or swap in a new SD card (physical access issues with the BBW).

Thanks again for all the help!

Still works here:

root@beaglebone:~# apt-get install npm bb-node-red-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libmagic1
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not
upgraded.
Need to get 358 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://repos.rcn-ee.com/debian/ jessie/main bb-node-red-installer all
0.13.4-0rcnee1~bpo80+20160321+1 [4140 B]
Get:2 http://ftp.us.debian.org/debian/ jessie/main npm all 1.4.21+ds-2 [354
kB]
Fetched 358 kB in 0s (737 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 22326 files and directories currently installed.)
Preparing to unpack
.../bb-node-red-installer_0.13.4-0rcnee1~bpo80+20160321+1_all.deb ...
Unpacking bb-node-red-installer (0.13.4-0rcnee1~bpo80+20160321+1) over
(0.13.4-0rcnee1~bpo80+20160321+1) ...
Preparing to unpack .../npm_1.4.21+ds-2_all.deb ...
Unpacking npm (1.4.21+ds-2) over (1.4.21+ds-2) ...
Setting up bb-node-red-installer (0.13.4-0rcnee1~bpo80+20160321+1) ...
bb-node-red-installer:npm: [1.4.21]
bb-node-red-installer:node: [v0.10.42]
bb-node-red-installer:Installing: systemd-0.2.6 (for node-red)
systemd@0.2.6 /usr/local/lib/node_modules/systemd
bb-node-red-installer:Installing: node-red-0.13.4 (for node-red)

bcrypt@0.8.5 install

/usr/local/lib/node_modules/node-red/node_modules/bcrypt

node-gyp rebuild

make: Entering directory
'/usr/local/lib/node_modules/node-red/node_modules/bcrypt/build'
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
  COPY Release/bcrypt_lib.node
make: Leaving directory
'/usr/local/lib/node_modules/node-red/node_modules/bcrypt/build'

Maybe this is a clue, to get node-red installed on Ubuntu 16.04 I had to install nodejs-legacy, so I tried installing it on my BBW.

This is what I get:

~# apt-get install nodejs-legacy
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
nodejs-legacy : Depends: nodejs (>= 0.6.19~dfsg1-3~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I can’t figure out exactly what package is held, or how to un-hold it.

I do remember getting some kind of “package will be held back message” manduring an upgrade several months ago.