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

version `GLIBC_2.25' not found (required by /lib/x86_64-linux-gnu/libuuid.so.1) #1959

Closed
1 task done
shunz19 opened this issue Dec 31, 2021 · 9 comments
Closed
1 task done

Comments

@shunz19
Copy link

shunz19 commented Dec 31, 2021

Issue

I am having trouble to make the library to work for a week now, I am able to install it but it keeps giving an error saying that GLIBC_2.25 is not found. I've also tried building it from source with no luck.

internal/modules/cjs/loader.js:1144
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /snap/core/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /lib/x86_64-linux-gnu/libuuid.so.1)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (/home/chrosmos_ex/chrosmos/node_modules/canvas/lib/bindings.js:3:18)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Steps to Reproduce

const fs = require('fs')
const path = require('path')
const Canvas = require("canvas")

const canvas = Canvas.createCanvas(200, 200)
const ctx = canvas.getContext('2d')

ctx.globalAlpha = 0.2

ctx.strokeRect(0, 0, 200, 200)
ctx.lineTo(0, 100)
ctx.lineTo(200, 100)
ctx.stroke()

ctx.beginPath()
ctx.lineTo(100, 0)
ctx.lineTo(100, 200)
ctx.stroke()

ctx.globalAlpha = 1
ctx.font = 'normal 40px Impact, serif'

ctx.rotate(0.5)
ctx.translate(20, -40)

ctx.lineWidth = 1
ctx.strokeStyle = '#ddd'
ctx.strokeText('Wahoo', 50, 100)

ctx.fillStyle = '#000'
ctx.fillText('Wahoo', 49, 99)

const m = ctx.measureText('Wahoo')

ctx.strokeStyle = '#f00'

ctx.strokeRect(
  49 + m.actualBoundingBoxLeft,
  99 - m.actualBoundingBoxAscent,
  m.actualBoundingBoxRight - m.actualBoundingBoxLeft,
  m.actualBoundingBoxAscent + m.actualBoundingBoxDescent
)

canvas.createPNGStream().pipe(fs.createWriteStream(path.join(__dirname, 'text.png')))

Your Environment

Ubuntu 18.04
Node v14.18.2
npm 6.14.15
ldd (Ubuntu GLIBC 2.27-3ubuntu1.4) 2.27

@zbjornson
Copy link
Collaborator

Did you built from source or use prebuilds?

If you built from source, are you trying to run Canvas on the same computer that you built it on, or are you transferring an installation?

@shunz19
Copy link
Author

shunz19 commented Dec 31, 2021

Did you built from source or use prebuilds?

If you built from source, are you trying to run Canvas on the same computer that you built it on, or are you transferring an installation?

I believe i have tried both. I am using it on the virtual machine on google cloud running an ubuntu 18.04, nowhere else

Edit:
I am currently trying to figure out how to have glibc 2.25 on my machine since it have 2.27

I have tried building glibc 2.25 with:

mkdir ~/glibc-install; cd ~/glibc-install
wget http://ftp.gnu.org/gnu/glibc/glibc-2.25.tar.gz
tar -zxvf glibc-2.25.tar.gz
cd glibc-2.25
mkdir build
cd build
../configure --prefix=/home/abc/glibc-2.25
make -j4
make install

But stuck on make -j4 because it's giving out this error:

/tmp/ccWOwMHU.s: Assembler messages:
/tmp/ccWOwMHU.s: Error: `loc1@GLIBC_2.2.5' can't be versioned to common symbol 'loc1'
/tmp/ccWOwMHU.s: Error: `loc2@GLIBC_2.2.5' can't be versioned to common symbol 'loc2'
/tmp/ccWOwMHU.s: Error: `locs@GLIBC_2.2.5' can't be versioned to common symbol 'locs'
../o-iterator.mk:9: recipe for target '/home/abc/glibc-install/glibc-2.25/build/misc/regexp.os' failed
make[2]: *** [/home/abc/glibc-install/glibc-2.25/build/misc/regexp.os] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/abc/glibc-install/glibc-2.25/misc'
Makefile:215: recipe for target 'misc/subdir_lib' failed
make[1]: *** [misc/subdir_lib] Error 2
make[1]: Leaving directory '/home/abc/glibc-install/glibc-2.25'
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 2

@shunz19
Copy link
Author

shunz19 commented Dec 31, 2021

Is there a way to make the library use 2.27 instead of 2.25?

@zbjornson
Copy link
Collaborator

I can't reproduce this with a brand-new Ubuntu 18.04 VM on GCP. (I was hoping to since we a have a lot of similar glibc issues open.) See below:

zachb@instance-17:~$ ldd --version | head -n1
ldd (Ubuntu GLIBC 2.27-3ubuntu1.4) 2.27
zachb@instance-17:~$ uname -a
Linux instance-17 5.4.0-1058-gcp #62~18.04.1-Ubuntu SMP Mon Nov 15 07:49:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
zachb@instance-17:~$ node -v
v14.18.2
zachb@instance-17:~$ npm -v
6.14.15
zachb@instance-17:~$ npm install canvas
zachb@instance-17:~$ node -p "require('canvas')"
{
  Canvas: [Function: Canvas] { _registerFont: [Function: _registerFont] },
  # ...

This is using prebuilds. What version of Canvas are you trying to use?

Re: your last edits, changing system glibc versions is not safe.

@shunz19
Copy link
Author

shunz19 commented Dec 31, 2021

I have tried three of them.
I think I have corrupted the glib. because this also showed up when i tried installing the headless gl

prebuild-install WARN install /snap/core/current/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by /home/abc/a/node_modules/gl/build/Release/webgl.node)

I'm gonna try to reinstall the glibc. I really don't want to create a new vm machine and transfer everything there.
Thank you for providing support.

@shunz19
Copy link
Author

shunz19 commented Dec 31, 2021

Hi one last help please, I think I might have changed the environment path of my nodejs, like shouldn't it be using /lib/x86_64-linux-gnu/libm.so.6: instead of /snap/core/current/lib/x86_64-linux-gnu/libm.so.6?

@shunz19
Copy link
Author

shunz19 commented Dec 31, 2021

May i know how did you install the nodejs? I think glibc errors is occouring when nodejs is installed on snap?

@zbjornson
Copy link
Collaborator

This is starting to make sense. I think you're using snaps instead of apt (or a manual install, which I'm doing), and the core snap probably has some older version of glibc or some other library loading issue is happening. I know close to nothing about working with snaps unfortunately, but hopefully that points you in the right direction.

@shunz19
Copy link
Author

shunz19 commented Dec 31, 2021

It works. TLDR: DON'T INSTALL NODEJS WITH SNAP.
Thank you for helping me figure this out!

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

2 participants