learninglocker
learninglocker copied to clipboard
deploy.sh script fails in fresh install of Ubuntu Server 20.04.1
What version were you using?
Open Source
What steps can we follow to reproduce the behaviour?
- Install Ubuntu Server 20.04.1, log into it
- Start learning locker install by executing as root: wget -qO deployll.sh https://raw.githubusercontent.com/LearningLocker/deploy/master/deployll.sh && bash deployll.sh
What is the actual behaviour?
# wget -qO deployll.sh https://raw.githubusercontent.com/LearningLocker/deploy/master/deployll.sh && bash deployll.sh
deployll.sh: line 269: netstat: command not found
[LL] We require a path to install to and a path to symlink to. The reason for this is that the script can be re-run in order to update
cleanly. The path we'll ask you for is a base path for the releases to be installed to so if you select the default of:
/usr/local/learninglocker/releases
then we will create a sub-directory under here for every release and symlink the latest install to the final install path (which
the nginx config points at. This is so that roll-backs can be done easier and we can perform a complete install before finally
switching the nginx config over which'll minimise downtime on upgrades
[LL] What base directory do you want to install to? (Press 'enter' for the default of /usr/local/learninglocker/releases)
[LL] Directory '/usr/local/learninglocker/releases' doesn't exist - should we create it? [y|n] (Press enter for default of 'y')
[LL] What path should the release be symlinked to? (Press enter for the default of /usr/local/learninglocker/current)
[LL] I need a user to install the code under - what user would you like me to use? (press enter for the default of 'learninglocker')
[LL] User 'learninglocker' doesn't exist - do you want me to create them? [y|n] (enter for default of 'y')
[LL] Creating user 'learninglocker'....done!
[LL] MongoDB isn't installed - do you want to install it? [y|n] (press 'enter' for default of 'y')
[LL] Redis isn't installed - do you want to install it? [y|n] (press 'enter' for default of 'y')
[LL] Learning Locker ideally works best with ClamAV (anti virus software) installed but it is not an absolute requirement. Do you want to install it? [y|n] (press 'enter' for the default of 'y')
[LL] Installing node version: 10.x
deployll.sh: line 740: nodejs: command not found
[LL] Something went wrong in installing/updating nodejs. This is likely a fault in your apt config. Can't continue
#
Script fails since it cannot find nodejs executable
What is the expected behavior?
Installation continues since nodejs is installed correctly.
Is there any additional information that will help us replicate/understand the problem?
Culprit is the deployll.sh script, please see from line 740:
if [[ `nodejs --version | cut -d'.' -f 1` != $NODE_VERSION_STRING ]]; then
output "Something went wrong in installing/updating nodejs. This is likely a fault in your apt config. Can't continue"
exit 0
fi
INSTALLED_NODE_VERSION=`nodejs --version`
if [[ $INSTALLED_NODE_VERSION == "" ]]; then
INSTALLED_NODE_VERSION=`node --version`
if [[ $INSTALLED_NODE_VERSION == "" ]]; then
output "ERROR :: node doesn't seem to be installed - exiting"
exit 1
fi
fi
First if-statement assumes nodejs executable to be named nodejs - latest installed version v10.23.0 has only executable node.
I am having this same issue when trying to deploy LL from the script to Ubuntu 20.04.01. Would be interested in what the fix would be.
On ubuntu 20.x node js is recoginzed by node --version
instead of nodejs --version
Once you get past this, there is also a problem compiling grpc:
../deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc: In member function ‘virtual uint32_t grpc_core::chttp2::TransportFlowControl::MaybeSendUpdate(bool)’:
../deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc:188:74: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
188 | const uint32_t target_announced_window = (const uint32_t)target_window();
| ^
cc1plus: all warnings being treated as errors
Once you get past this, there is also a problem compiling grpc:
../deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc: In member function ‘virtual uint32_t grpc_core::chttp2::TransportFlowControl::MaybeSendUpdate(bool)’: ../deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc:188:74: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers] 188 | const uint32_t target_announced_window = (const uint32_t)target_window(); | ^ cc1plus: all warnings being treated as errors
did you resolve this?
nope. We abandoned this project completely. As far as I can tell, this project is unmaintained.
nope. We abandoned this project completely. As far as I can tell, this project is unmaintained.
I am sorry. Anyway, thank you 😅
@fMoro1999 I agree with the rest of the comments that this repo is an abandoned dumpster fire of code, but here's a Dockerfile snippet with which I managed to build v6.4.0 of LearningLocker as cleanly as possible. It follows the current state of the deploy script to base everything off of Node v10, which of course is EOL in just a few weeks. I seems like they only maintain their enterprise edition now; you can see from the deploy script and elsewhere that their internal code is probably on Node v12 and updated dependencies, and with extra fixes, too. The build should be easily translatable to Focal; essentially, you need to undo the -Werror flag for the C++ compiler that gyp is using; the set of warnings which might get emitted depends on the compiler version. The Dockerfile below is for a Debian Buster node v10 image, which has g++ v8.
So, the trick here is all in the CXXFLAGS...
FROM node:10.24.0-buster AS NodeBuildEnv
ARG RELEASE=https://github.com/LearningLocker/learninglocker/archive/refs/tags/v6.4.0.tar.gz
ARG RELEASESHA256=ac1b86b57a69d1c8cbfad896e2d3387537287f88367b49dcf7ba1879a5a69cc5
SHELL [ "/bin/bash", "-c" ]
WORKDIR /usr/src
RUN chown node:node -R /usr/src
USER node
RUN curl -L -o /tmp/source.tar.gz "${RELEASE}" && \
<<<"${RELEASESHA256} /tmp/source.tar.gz" sha256sum -c && \
tar --strip-components=1 -xvf /tmp/source.tar.gz && \
env \
CXXFLAGS="-Wno-error=cast-function-type -Wno-error=ignored-qualifiers -Wno-error=stringop-truncation" \
npm_config_build_from_source="true" \
yarn --ignore-engines --frozen-lockfile install && \
touch .env && \
yarn build-all && \
yarn cache clean
@yetanotherbug thank you! For now I just installed Ubuntu 18.04 and I confirm that the script worked fine.
Anyway, I will give it a try 😉
Hello everyone 😉😉😉😉😉 !!! it is running successfully now !!! here is or story : First we install Ubuntu 20 on virtual machine then we got problem deploy.sh file ! we change "nodejs" to "node" (sudo nano) in terminal.
then we got many issue but when we switched back to the Ubuntu 16 at the end got mongo DB problem which solved by changing the .env file 👍
usr/local/learninglocker/current/xapi$ vi .env
from MONGO_URL=mongodb://localhost:27017/learninglocker_v2?replicaSet=rs0 to MONGO_URL=mongodb://localhost:27017/learninglocker_v2
now it works every thing !!!