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

node module sharp fails install on CentOS 6 #9943

Closed
reetp opened this issue Feb 28, 2018 · 26 comments
Closed

node module sharp fails install on CentOS 6 #9943

reetp opened this issue Feb 28, 2018 · 26 comments
Assignees

Comments

@reetp
Copy link

reetp commented Feb 28, 2018

Description:

After installation of rocket.chat 0.62.0 on CentOS 6 the installation failed to run. This is due to the 'sharp' module requiring a higher version of glibc than I have installed (required glibc 2.14 - installed glibc 2.12)

Server Setup Information:

  • Version of Rocket.Chat Server: 0.62.0
  • Operating System: CentOS 6
  • Deployment Method(snap/docker/tar/etc): tarball into rpm
  • Number of Running Instances: 1
  • Node Version: 8.94
  • npm Version: 5.6.0

Steps to Reproduce:

Install rpm (or source manually)

run Rocket.Chat

Expected behavior:

Rocket Chat has been properly tested and runs without breaking disastrously on main stream distros.

Actual behavior:

Exception in callback of async function: Error: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /opt/Rocket.Chat/programs/server/npm/node_modules/sharp/build/Release/sharp.node)

Attempted resolution

First was to try and build sharp on my build box

Error:
sharp: Use with glibc version 2.12 requires manual installation of libvips >= 8.6.1 - please see http://sharp.pixelplumbing.com/page/install

Downloaded vips to try a manual build.

The page says:

For 32-bit Intel CPUs and older Linux-based operating systems such as Centos 6, it is recommended to install a system-wide installation of libvips from source:

https://jcupitt.github.io/libvips/install.html#building-libvips-from-a-source-tarball

So downloaded/extracted and ran ./configure and got the following errors:

configure: error: Package requirements (glib-2.0 >= 2.6 gmodule-2.0 gobject-2.0) were not met:

No package 'glib-2.0' found
No package 'gmodule-2.0' found
No package 'gobject-2.0' found

Installed:

glib2-devel
expat-devel

libtiff-devel libjpeg-turbo-devel libgsf-devel libpng-devel poppler-devel librsvg2-devel poppler-glib-devel libexif-devel giflib-devel libwebp-devel cmake openjpeg2-devel

Then ran ./configure again but seems that some of the packages are not high enough versions to build

PDF import with poppler-glib: no (requires poppler-glib 0.16.0 or later)
SVG import with librsvg-2.0: no (requires librsvg-2.0 2.34.0 or later)

OK, so grab poppler and build that. Except it needs a version of cmake higher than installed.

So grab that too and try to build poppler, but it break as well:

Scanning dependencies of target poppler
[ 0%] Building CXX object CMakeFiles/poppler.dir/goo/gfile.cc.o
cc1plus: error: unrecognized command line option "-Wpedantic"
cc1plus: error: unrecognized command line option "-Wzero-as-null-pointer-constant"
make[2]: *** [CMakeFiles/poppler.dir/goo/gfile.cc.o] Error 1
make[1]: *** [CMakeFiles/poppler.dir/all] Error 2
make: *** [all] Error 2

That seems to indicate a higher version of gcc is required. Brick wall firmly implanted in face.

Hmmmmm...... This is a rabbit hole quite frankly.

So it seems that there is virtually zero chance of compiling any of the required modules now, leaving a broken installation once again, and the end of install on RHEL/CentOS 6 (still supported until Nov 2020....)

Some refs for this issue with problematic building.....

#9368
#9829
#9574

The QA round here for testing releases is really lacking. I don't want to be hard on Open Source devs - I do some stuff myself and know how thankless it can be.

However, there have been numerous bugs where some basic testing of major changes would have revealed issues that could at least go in release notes.

I can only see this getting worse and worse in the desperate scramble to be the latest and greatest when most users want solid and stable with carefully thought out and well tested changes.

Seems it is time to look for another chat client as I can't change my server base for some while yet.

Damn - just when I finally thought I'd get the internal bot back with #8933 :-(

@esolix
Copy link

esolix commented Mar 5, 2018

You need to rebuild the sharp library before running npm install, that will solve it

@reetp
Copy link
Author

reetp commented Mar 5, 2018

Thanks, but it doesn't:

sudo npm install -g node-gyp
cd programs/server/npm/node_modules/sharp
node-gyp configure
node-gyp rebuild

../src/common.h:33:2: error: #error GCC version 4.6+ is required for C++11 features - see sharp.pixelplumbing.com/page/install#prerequisites

CentOS 6 does not have a high enough version of GCC. So it is basically obsoleted for Rocket.Chat

@reetp
Copy link
Author

reetp commented Mar 6, 2018

Finally found that this was broken due to this:
#9711

"It now makes use of a nodejs module to handle the resizing called sharp. Personally not intimately familiar with it.. but from what I can tell it's written in rust."

@geekgonecrazy
Copy link
Contributor

@rodrigok looks like this effects Centos6

Supposedly they have precompiled modules so you shouldn't be having to build.from source. Obviously that's not the case

@geekgonecrazy
Copy link
Contributor

@reetp is this a 32bit install or 64bit?

@reetp
Copy link
Author

reetp commented Mar 7, 2018

Hi Aaron,

64 bit

Happy to try and debug as required but you can see the hoops I jumped through above

@geekgonecrazy
Copy link
Contributor

@reetp indeed! I'm not familiar enough with the package to know much. @rodrigok might be able to help us hunt it down.

I'd hate to be stick with Centos 7 because of this. Especially since the module has precompiled binaries

@reetp
Copy link
Author

reetp commented Mar 8, 2018

@geekgonecrazy Thanks for looking :-)
Yup. I know the way ahead is 7, but there are still lots on 6 whilst it is effectively supported by RHEL. Clearly from bugs there are a number of others with the same issues.
At SME we've struggled getting people off 5 even though it was EOL a few years back... ! Some people just don't want or like a lot of change, and don't like bleeding edge technology. Some can't change if they are locked into support with say RH.
As it stands I can't see any way of compiling sharp on 6, though I am no pro when it comes to rolling your own.
The easiest route is possibly asking the sharp people to compile one for 6. Be far easier for them I'd guess.

@geekgonecrazy geekgonecrazy added this to the 0.63.0 milestone Mar 9, 2018
@geekgonecrazy
Copy link
Contributor

@RocketChat/core can we please get some eyes on this? Worked fine on Centos 6 before 0.62.0 and sharp.

@sampaiodiego
Copy link
Member

should we still support graphics magick on scenarios like this?

@geekgonecrazy
Copy link
Contributor

That's what I'm wondering. That or we need to figure out how to force the precompiled binaries.

This also effects armhf snap builds, and I believe I've heard of a few having issues getting working on osx dev machine.

@rodrigok
Copy link
Member

@reetp I was able to run RC in CentOS, I did a docker file here https://github.com/RocketChat/Docker.Base.Image/blob/centos6/tests/centos6/Dockerfile but I wasn't able to install chrome or make the tests run using firefox, that way we can't have an automation to test each release and I'm considering drop our official support for CentOS 6 unless you can help me to get the tests running.

Thanks

@reetp
Copy link
Author

reetp commented Mar 15, 2018

@rodrigok Thanks for looking !

I'm currently away on business so can't do much until I get back this weekend. I'll have a look as soon as I am back.

@reetp
Copy link
Author

reetp commented Mar 17, 2018

Tried to run this on my CentOS 6 build server but still get gcc not high enough version.

node-gyp rebuild

make: Entering directory `/home/john/git/rocketRPMbuilder/bundle/programs/server/npm/node_modules/sharp/build'
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../src/common.cc:24:
../../nan/nan.h:47:3: error: #error This version of node/NAN/v8 requires a C++11 compiler
In file included from ../src/common.cc:27:
../src/common.h:33:2: error: #error GCC version 4.6+ is required for C++11 features - see sharp.pixelplumbing.com/page/install#prerequisites

gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)

@rodrigok
Copy link
Member

@reetp can we talk in chat? Please ping me at https://open.rocket.chat/direct/rodrigo.nascimento

@reetp
Copy link
Author

reetp commented Mar 29, 2018

Have done so but no response from you :-)

@Rohlik
Copy link
Contributor

Rohlik commented Apr 13, 2018

Probably duplicated with #9829

@engelgabriel engelgabriel modified the milestones: 0.63.0, 0.65.0 May 5, 2018
@Inwizards1
Copy link

I have a Question can i install Rocket.chat on centos 6. right now i'm installing on centos 6 but i'm facing some issue. i have attach error png could you please help me.
chat server

@reetp
Copy link
Author

reetp commented Jul 3, 2018

As far as I am aware this has not been resolved by the developers. Regrettably I don't think it will be.

I did try and speak to @rodrigok but never had a response.

The only way I got it running on CentOS 6 was using docker.

@Hudell Hudell removed this from the 0.65.0 milestone Jul 3, 2018
@Hudell Hudell self-assigned this Jul 3, 2018
@tassoevan
Copy link
Contributor

tassoevan commented Jul 3, 2018

@Hudell I think the issue reported by @Inwizards1 is related to this: meteor/meteor#9541 (comment)

@Inwizards1
Copy link

@reetp thanks for your suggestion could you explain me how to use docker on centos 6 please. provide any doc plz.

@reetp
Copy link
Author

reetp commented Jul 4, 2018

It's OT for this bug really. You need to go read the documentation thoroughly.
In simple terms... install docker-io, get docker-compose from git - highest version is:
docker-compose version 1.5.2, build 7240ff3
Higher versions won't work.
Rough docker-compose.yml when using apache reverse proxy (you need a version of mod_proxy built for apache 2.2 or you could possibly use SCL and apache 2.4)

rocketchat:
    image: rocketchat/rocket.chat:latest
    container_name: rocketchat
    environment:
        - MONGO_URL=mongodb://127.0.0.1:27017/rocketchat
        - ROOT_URL=https://chat.yourdomain.com
        - MAIL_URL=smtp://127.0.0.1:25
        - Accounts_UseDNSDomainCheck=True
    ports:
      - 3000:3000
    net: "host"
    # Specify an absolute path mapping if required
    volumes:
    - /opt/uploads/:/opt/uploads/
    - /opt/hubot-scripts/src/scripts/:/opt/hubot-scripts/src/scripts/
    restart: on-failure:2
    # Might need the UID/GID rather than name
    # user: dockerroot:dockerroot
    user: 123:123
    mem_limit: 256MB

@tassoevan
Copy link
Contributor

I did some experiments and the worst barrier is the version of glibc required by the libvips. Since it's a fundamental package in the whole OS, sharp and Rocket.Chat itself become unsupported.
The only thing we can do here is replace sharp by a slower alternative and this can be costly. Even sharp and libvips maintainers are asking its users to upgrade to CentOS 7...

@rodrigok
Copy link
Member

rodrigok commented Jul 4, 2018

I was able to make the RC in CentOS 6 working some time ago using this docker image for development RocketChat/Docker.Base.Image#14

@qvarting
Copy link

@reetp thanks a lot for your info regarding this and the fibers issue. It helped us out a lot.
I also recognize your frustration. 😄

Cheers!

@geekgonecrazy
Copy link
Contributor

I believe we have 3-4 other issues discussing this now :). Closing this one. Please reopen if you think this one is still relevant

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