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

After Installing 0.62.* the chat server stops working with "Cannot find module './lib/less-node'" #10140

Closed
guidowojke opened this issue Mar 14, 2018 · 6 comments

Comments

@guidowojke
Copy link

Description:

After following the installation instructions on
http://rocketchat.github.io/docs/installation/manual-installation/ubuntu/#install
with a chat version greater or equals version 0.62.0 the server did not start.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.62.2 (also on 0.62.1 and 0.62.0)
  • Operating System: Ubuntu 16.04.3 LTS
  • Deployment Method(snap/docker/tar/etc): manual
  • Number of Running Instances: 1
  • DB Replicaset Oplog: MONGO_OPLOG_URL=mongodb://${oplogusername}:${oplogpassword}@{dbhost}:27017/local?replicaSet=rs0&authSource=admin
  • Node Version: v8.9.4
  • mongoDB Version (chat): MongoDB shell version v3.4.10
  • mongoDB Version (db): MongoDB shell version v3.4.10 / db version v3.4.10

Steps to Reproduce:

  1. curl -L https://cdn-download.rocket.chat/build/rocket.chat-0.62.2.tgz -o rocket.chat.tgz
  2. tar zxf rocket.chat.tgz
  3. mv bundle Rocket.Chat-0.62.2
  4. ln -s Rocket.Chat-0.62.2 Rocket.Chat
  5. cd Rocket.Chat/programs/server
  6. npm install
  7. starting the rocketchat with a forever script that calls main.js in Rocket.Chat folder

Expected behavior:

Chat server can start. Older versions < 0.62.0 are running fine.

Actual behavior:

The following error occurs during the startup and the chat server did not run (full log in relevant logs section).

Exception in callback of async function: Error: Cannot find module './lib/less-node'
    at makeMissingError (packages/modules-runtime.js:231:12)

Relevant logs:

rocketchat.log:

Will load cache for users
4980 records load from users
Will load cache for rocketchat_room
2698 records load from rocketchat_room
Will load cache for rocketchat_subscription
10980 records load from rocketchat_subscription
Will load cache for rocketchat_settings
616 records load from rocketchat_settings
Exception in callback of async function: Error: Cannot find module './lib/less-node'
    at makeMissingError (packages/modules-runtime.js:231:12)
    at require (packages/modules-runtime.js:241:19)
    at index.js (packages/modules.js:22235:18)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at server.js (packages/rocketchat:theme/server/server.js:1:85)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at /opt/rocketchat/Rocket.Chat-0.62.2/programs/server/packages/rocketchat_theme.js:327:1
    at /opt/rocketchat/Rocket.Chat-0.62.2/programs/server/packages/rocketchat_theme.js:333:3
    at /opt/rocketchat/Rocket.Chat-0.62.2/programs/server/boot.js:411:36
    at Array.forEach (<anonymous>)
    at /opt/rocketchat/Rocket.Chat-0.62.2/programs/server/boot.js:220:19
    at /opt/rocketchat/Rocket.Chat-0.62.2/programs/server/boot.js:471:5
    at Function.run (/opt/rocketchat/Rocket.Chat-0.62.2/programs/server/profile.js:510:12)
    at /opt/rocketchat/Rocket.Chat-0.62.2/programs/server/boot.js:470:11
Updating process.env.MAIL_URL
Starting Email Intercepter...
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Facebook
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Facebook_id
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Facebook_secret
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Facebook_callback_url
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Google
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Google_id
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Google_secret
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Google_callback_url
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Github
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Github_id
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Github_secret
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Github_callback_url
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Linkedin
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Linkedin_id
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Linkedin_secret
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Linkedin_callback_url
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Meteor
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Meteor_id
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Meteor_secret
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Meteor_callback_url
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Twitter
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Twitter_id
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Twitter_secret
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Twitter_callback_url
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Proxy_host
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Proxy_services
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Dolphin_URL
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Dolphin
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Dolphin_id
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Dolphin_secret
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Dolphin_login_style
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Dolphin_button_label_text
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Dolphin_button_label_color
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Dolphin_button_color
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_GitHub_Enterprise
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_GitHub_Enterprise_id
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_GitHub_Enterprise_secret
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_GitHub_Enterprise_callback_url
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Gitlab
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Gitlab_id
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Gitlab_secret
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Gitlab_callback_url
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Wordpress
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Wordpress_id
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Wordpress_secret
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Wordpress_callback_url
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Drupal
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Drupal_id
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Drupal_secret
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Drupal_callback_url
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Tokenpass
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Tokenpass_id
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Tokenpass_secret
�[34mrocketchat:lib ➔ oauth_updated�[39m Accounts_OAuth_Tokenpass_callback_url
@rodrigok
Copy link
Member

@guidowojke I wasn't able to reproduce your issue, can you remove all files related to Rocket.Chat and try again from scratch?

@mic7000
Copy link

mic7000 commented Mar 26, 2018

@rodrigok I just received exactly the same issue on a CentOS 6.4 32-bit box.

@reetp
Copy link

reetp commented Mar 27, 2018

@mic7000 I think you should be on the latest version of CentOS 6 - current version is 6.9

You may experience other issues regardless:

#9943

@24601
Copy link

24601 commented Mar 31, 2018

Am also experiencing this on a Debian Stretch box.

UPDATE: See comment below with our current experimentation on finding workarounds for this and related issues.

318 records load from users
Will load cache for rocketchat_room
212 records load from rocketchat_room
Will load cache for rocketchat_subscription
3534 records load from rocketchat_subscription
Will load cache for rocketchat_settings
635 records load from rocketchat_settings

Updating process.env.MAIL_URL
Starting Email Intercepter...
Exception in callback of async function: Error: Cannot find module './lib/less-node'
    at makeMissingError (packages/modules-runtime.js:231:12)
    at require (packages/modules-runtime.js:241:19)
    at index.js (packages/modules.js:22756:18)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at server.js (packages/rocketchat:theme/server/server.js:1:85)
    at fileEvaluate (packages/modules-runtime.js:343:9)
    at require (packages/modules-runtime.js:238:16)
    at /app/bundle/programs/server/packages/rocketchat_theme.js:327:1
    at /app/bundle/programs/server/packages/rocketchat_theme.js:333:3
    at /app/bundle/programs/server/boot.js:411:36
    at Array.forEach (<anonymous>)
    at /app/bundle/programs/server/boot.js:220:19
    at /app/bundle/programs/server/boot.js:471:5
    at Function.run (/app/bundle/programs/server/profile.js:510:12)
    at /app/bundle/programs/server/boot.js:470:11```

@24601
Copy link

24601 commented Mar 31, 2018

We are experimenting with building our own custom Docker image to run k8s and this was our workaround to get the current develop branch to build and run as a Docker image.

This, for us, fixes the less not found issue (and once you fix the less not found issue you may have the same thing with cas, and this includes a fix for that).

There are "fixes" (uh, more like workarounds) for other obnoxious build/packaging related items, so keep that in mind. Namely that node v8.10+ is broken and sharp native libs don't get rebuilt for real with npm rebuild.

Yes, there are somethings we are doing here that are kind of odd, there are changes we should make for production, this is an experimental Dockerfile, so use it at your own risk and no need to point out the shortcomings, just trying to focus on how to get a build pipeline up and running from the current develop branch/0.63.0 rcs to k8s.

Doing the build in the Dockerfile was something we eventually succumbed to as meteor npm rebuild really just wasn't rebuilding libs and having all kinds of shitty problems with that. This process is making me hate Meteor even more than I already did. I hope one day Rocket.Chat can leave Meteor behind, it seems to be at the core of all the problems I have with Rocket.Chat, and a build takes 30 minutes on a quad core i7 with 16GB RAM. Oy.

FROM node:8.9.4-stretch
RUN apt-get update
RUN apt-get install build-essential -y
RUN apt-get install git -y
RUN apt-get install python -y
RUN apt-get install apt-transport-https -y
RUN useradd -ms /bin/bash rocketchat || true
ENV METEOR_ALLOW_SUPERUSER true

RUN curl https://install.meteor.com/ | sh
ENV RC_VERSION 0.63.0-develop
#RUN npm update -g npm
MAINTAINER buildmaster@rocket.chat
RUN mkdir build
ADD . /build/
WORKDIR /build
RUN rm -fr node_modules
RUN meteor npm install
RUN meteor npm rebuild
RUN chmod +x ./ct-build.sh
RUN ./ct-build.sh

WORKDIR /app/bundle
RUN rm -fr programs/server/npm/node_modules/sharp
WORKDIR programs/server/npm
RUN npm install sharp less cas

RUN cd /app/bundle/programs/server \
 && npm install \
 && npm cache clear --force \
 && meteor npm install \
 && meteor npm rebuild 
#USER rocketchat

VOLUME /app/uploads

WORKDIR /app/bundle

# needs a mongoinstance - defaults to container linking with alias 'mongo'
ENV DEPLOY_METHOD=docker \
    NODE_ENV=production \
    MONGO_URL=mongodb://mongo:27017/rocketchat \
    HOME=/tmp \
    PORT=3000 \
    ROOT_URL=http://localhost:3000 \
    Accounts_AvatarStorePath=/app/uploads


WORKDIR /app/bundle
EXPOSE 3000

CMD ["node", "main.js"]

@theorenck theorenck modified the milestones: 0.64.0, 0.65.0 Apr 20, 2018
@theorenck theorenck modified the milestones: 0.65.0, Short-term Jul 31, 2018
@geekgonecrazy
Copy link
Contributor

Should no longer be an issue. Many have installed on centos since with no issue. Please feel free to reopen if you still have this particular issue

@theorenck theorenck removed this from the Short-term milestone Dec 12, 2018
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

7 participants