Seth Berrier's picture

Greetings!

This might just belong over in the bug tracker bug I figured I should start here.  I'm trying to build some of the 14.0 appliances and have been successful with a few (core, LAMP) but I'm running into problems with etherpad.  TL;DR the install script for node.js seems to be broken (yes, I did do the git pull in common).  My attempt to fix it is below but etherpad-lite eventually complains that it's not the right version of node.js


It does okay until it starts running the nodejs-install common script.  Then I get this:

fab-chroot build/root.patched --script /turnkey/fab/common/conf/nodejs-install
+ SRC=/usr/local/src
+ dl http://nodejs.org/dist/latest/SHASUMS.txt /usr/local/src
+ '[' http://127.0.0.1:8124 ']'
+ PROXY='--proxy http://127.0.0.1:8124'
+ cd /usr/local/src
+ curl -L -f -O --proxy http://127.0.0.1:8124 http://nodejs.org/dist/latest/SHASUMS.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (22) The requested URL returned error: 404 Not Found
/usr/share/fab/product.mk:476: recipe for target 'build/stamps/root.patched' failed
make: *** [build/stamps/root.patched] Error 22

I've tried exploring things a little bit.  A quick examination of 'nodejs.org/dist/latest' shows that in fact SHASUMS.txt does not exist.  There is a file called SHASUMS256.txt so I tried messing with that, edited the nodejs-install script to get it to grab the sha256 file, little mangling of the regex to get the latest tarball (there's two now, .gz and .xz so I had to pick one), hoping that would be enough.

#!/bin/bash -ex

SRC=/usr/local/src

dl() {
    [ "$FAB_HTTP_PROXY" ] && PROXY="--proxy $FAB_HTTP_PROXY"
    cd $2; curl -L -f -O $PROXY $1; cd -
}

dl http://nodejs.org/dist/latest/SHASUMS256.txt $SRC

TARBALL_RE="linux-x${FAB_ARCH: -2:2}.*gz"
TARBALL=$(grep $TARBALL_RE $SRC/SHASUMS256.txt | cut -d " " -f 3)
dl http://nodejs.org/dist/latest/${TARBALL} $SRC

grep $TARBALL $SRC/SHASUMS256.txt > $SRC/$TARBALL.sha1
cd $SRC
sha256sum -c $TARBALL.sha1
rm SHASUMS256.txt $TARBALL.sha1

tar -zxf $SRC/$TARBALL -C $SRC
rm $SRC/$TARBALL
ln -s $SRC/node-v* $SRC/node

for f in $(ls $SRC/node/bin); do
    ln -s $SRC/node/bin/$f /usr/local/bin/$f
done

# npm completion
npm completion > /etc/skel/.bashrc.d/npm
chmod +x /etc/skel/.bashrc.d/npm
cp /etc/skel/.bashrc.d/npm /root/.bashrc.d/npm

This gets it past that problem but, not surprisingly, etherpad is still unhappy.  I eventually get this error when it tries to retrieve and install etherpad-lite and am not sure how to proceed:

+ [ http://127.0.0.1:8124 ]
+ export HTTP_PROXY=http://127.0.0.1:8124
+ dirname /opt/etherpad-lite
+ cd /opt
+ git clone https://github.com/ether/etherpad-lite.git
Cloning into 'etherpad-lite'...
remote: Counting objects: 26994, done.
remote: Total 26994 (delta 0), reused 0 (delta 0), pack-reused 26993
Receiving objects: 100% (26994/26994), 19.04 MiB | 3.76 MiB/s, done.
Resolving deltas: 100% (19087/19087), done.
Checking connectivity... done.
+ cd /opt/etherpad-lite
+ ./bin/installDeps.sh
You're running a wrong version of node, or io.js is not installed. You're using v4.1.0, we need v0.10.x, v0.11.x or v0.12.x
/usr/share/fab/product.mk:476: recipe for target 'build/stamps/root.patched' failed
make: *** [build/stamps/root.patched] Error 1

Basically, node.js is not installed right (or is not the right version).  Those version numbers are so drastically different I'm guessing something is fundamentally effed up here but I don't know anything about node.js or etherpad-lite's internals so I'm at a loss.  The spreadsheet indicates that the 14.0 etherpad appliance has made it through QA already (I think) so I was suprised to run into this.  I'm also guessing that node.js is a key part of other appliances so this probably needs some attention from someone that knows more than me!

Thanks!

Seth B.

Forum: 
Seth Berrier's picture

Ooo!  I think I found something!  I explored the 'dist' folder of node.js a little closer and found that the directory 'latest' now seems to be version 4 and the one etherpad-lite wants is going to be either 'latest-v0.10.x' or 'latest-v0.12.x'.  I'm trying the 0.10 version first and it's already happier!  It's now building the iso filesystem in the make script.  So, what I posted above for the nodejs-install script is NOT what you want.  I'll try both 0.10 and 0.12 and see if they both work then post an updated nodejs-install script here.

Seth B.

Seth Berrier's picture

Okay, I built against the 0.12.x version of node.js and that works fine (etherpad 14.0 appliance builds, installs and seems to run correctly).  If there are other appliances that depend on node.js then someone would want to verify that they also support this version.  Here's a diff that shows what needs to change in the nodejs-install script under 'common/conf':

10c10
< dl http://nodejs.org/dist/latest/SHASUMS.txt $SRC
---
> dl http://nodejs.org/dist/latest-v0.12.x/SHASUMS.txt $SRC
14c14
< dl http://nodejs.org/dist/latest/${TARBALL} $SRC
---
> dl http://nodejs.org/dist/latest-v0.12.x/${TARBALL} $SRC

If you want version 0.10.x then use .10 instead of .12. Everything else still works.

Jeremy Davis's picture

Thanks heaps for the bug report, the detective work and the solution. We must have built the v14.0 image just before this problem surfaced as I managed to build it successfully.

It looks like your research and assistance will make it easy to fix so thanks for that. In the meantime if you want to try out the image that we built then please feel free:

http://www.turnkeylinux.org/download?file=turnkey-etherpad-14.0-jessie-a...

Add new comment