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

Problem with Amazon linux 2 images #392

Open
throrin19 opened this issue Sep 1, 2023 · 8 comments
Open

Problem with Amazon linux 2 images #392

throrin19 opened this issue Sep 1, 2023 · 8 comments

Comments

@throrin19
Copy link

Hello,

To avoid problems in my application, I launch all my test using public.ecr.aws/sam/build-nodejs18.x:latest.

The problem is the versions of gcc++ and glibc available in it :

  • glibc is only available on version 2.26-63
  • gcc++ is only available on version 7.3.1-15

The problem is, I can't install this library in this image. I have an error on postInstall and compilation :

npm ERR! code 1
npm ERR! path /builds/data/myproject/node_modules/isolated-vm
npm ERR! command failed
npm ERR! command sh -c prebuild-install || (node-gyp rebuild --release -j 4 && node-gyp clean)
npm ERR! make: Entering directory `/builds/data/myproject/node_modules/isolated-vm/build'
npm ERR!   CXX(target) Release/obj.target/nortti/src/external_copy/serializer_nortti.o
npm ERR!   CXX(target) Release/obj.target/nortti/src/isolate/allocator_nortti.o
npm ERR! rm -f Release/obj.target/nortti.a Release/obj.target/nortti.a.ar-file-list; mkdir -p `dirname Release/obj.target/nortti.a`
npm ERR! ar crs Release/obj.target/nortti.a @Release/obj.target/nortti.a.ar-file-list
npm ERR!   COPY Release/nortti.a
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/external_copy/external_copy.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/external_copy/serializer.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/external_copy/string.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/environment.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/cpu_profile_manager.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/executor.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/holder.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/inspector.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/platform_delegate.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/scheduler.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/stack_trace.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/isolate/three_phase_task.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/lib/thread_pool.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/lib/timer.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/callback.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/context_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/evaluation.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/external_copy_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/isolate.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/isolate_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/lib_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/module_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/native_module_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/reference_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/script_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/session_handle.o
npm ERR!   CXX(target) Release/obj.target/isolated_vm/src/module/transferable.o
npm ERR!   SOLINK_MODULE(target) Release/obj.target/isolated_vm.node
npm ERR! make: Leaving directory `/builds/data/myproject/node_modules/isolated-vm/build'
npm ERR! prebuild-install warn install /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /builds/data/myproject/node_modules/isolated-vm/out/isolated_vm.node)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.7.16 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v18.17.1/node-v18.17.1-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.17.1/node-v18.17.1-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v18.17.1/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.17.1/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/var/lang/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/builds/data/myproject/node_modules/isolated-vm/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/var/lang/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/root/.cache/node-gyp/18.17.1/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/18.17.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/var/lang/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/18.17.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/builds/data/myproject/node_modules/isolated-vm',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build', '--jobs', 4 ]
npm ERR! ../src/isolate/environment.cc:58:0: warning: "_GNU_SOURCE" redefined
npm ERR!  #define _GNU_SOURCE
npm ERR!  
npm ERR! <command-line>:0:0: note: this is the location of the previous definition
npm ERR! ../src/module/lib_handle.cc: In member function ‘v8::Local<v8::Value> ivm::LibHandle::PrivateSymbol(v8::MaybeLocal<v8::String>)’:
npm ERR! ../src/module/lib_handle.cc:58:49: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
npm ERR!   return *reinterpret_cast<Local<Value>*>(&symbol);
npm ERR!                                                  ^
npm ERR! ../src/module/lib_handle.cc:58:49: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
npm ERR! /usr/bin/ld: cannot find -lcrypto
npm ERR! /usr/bin/ld: cannot find -lssl
npm ERR! collect2: error: ld returned 1 exit status
npm ERR! make: *** [Release/obj.target/isolated_vm.node] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/var/lang/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.15.0-1028-aws
npm ERR! gyp ERR! command "/var/lang/bin/node" "/var/lang/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" "-j" "4"
npm ERR! gyp ERR! cwd /builds/data/myproject/node_modules/isolated-vm
npm ERR! gyp ERR! node -v v18.17.1
npm ERR! gyp ERR! node-gyp -v v9.3.1
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-09-01T09_10_[40](https://git.devops.aquassay.net/data/myproject/-/jobs/37301#L40)_6[43](https://git.devops.aquassay.net/data/myproject/-/jobs/37301#L43)Z-debug-0.log
@diazod
Copy link

diazod commented Sep 11, 2023

Using the library inside a AWS Lambda triggers the same issue, hope this gets addressed as there aren't any other options out there

@throrin19
Copy link
Author

I fix the problem with installing this packages :

yum groupinstall buildsys-build
yum install -y glibc-static openssl-devel

But, after that, in my CI/CD I have this weird error :

Error: Module did not self-register: '/myproject/path/node_modules/isolated-vm/out/isolated_vm.node'.

@AlaaL
Copy link

AlaaL commented Sep 27, 2023

did you solve this issue ?

@throrin19
Copy link
Author

Non, I have already the error of Error: Module did not self-register: '/myproject/path/node_modules/isolated-vm/out/isolated_vm.node'.

@aalimovs
Copy link

No luck with 4.6.0.

Try using public.ecr.aws/sam/build-nodejs18.x:latest, with yum install -y openssl-devel and locking to 4.5.0.

@debdutdeb
Copy link

We've been having similar issues for us, and the quickest fix was this - RocketChat/Rocket.Chat#30612 (comment)
RocketChat/Rocket.Chat#30612 (comment)

@NITHISH-1609
Copy link

Any fixes for this? None of the above worked for me!

@aalimovs
Copy link

Haven't tried it yet, but AWS Lambda added support for Amazon Linux 2023, which theoretically should do the trick for v4.6.0 and higher.

https://aws.amazon.com/about-aws/whats-new/2023/11/aws-lambda-amazon-linux-2023/

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

No branches or pull requests

6 participants