Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy.sh script fails in fresh install of Ubuntu Server 20.04.1 #1564

Open
agrohn opened this issue Nov 16, 2020 · 9 comments
Open

deploy.sh script fails in fresh install of Ubuntu Server 20.04.1 #1564

agrohn opened this issue Nov 16, 2020 · 9 comments

Comments

@agrohn
Copy link

agrohn commented Nov 16, 2020

What version were you using?

Open Source

What steps can we follow to reproduce the behaviour?

  1. Install Ubuntu Server 20.04.1, log into it
  2. 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.

@justin-castleman
Copy link

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.

@krgaurav1992
Copy link

krgaurav1992 commented Jan 29, 2021

On ubuntu 20.x node js is recoginzed by node --version instead of nodejs --version

@dgm
Copy link

dgm commented Feb 11, 2021

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

@fMoro1999
Copy link

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?

@dgm
Copy link

dgm commented Mar 11, 2021

nope. We abandoned this project completely. As far as I can tell, this project is unmaintained.

@fMoro1999
Copy link

nope. We abandoned this project completely. As far as I can tell, this project is unmaintained.

I am sorry. Anyway, thank you 😅

@ghost
Copy link

ghost commented Mar 19, 2021

@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

@fMoro1999
Copy link

@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 😉

@Farbod29
Copy link

Farbod29 commented May 27, 2021

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 !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants