signalfx/splunk-otel-js

@splunk/otel fails to install on centos7

michi88 opened this issue · 4 comments

Example docker command that fails:

docker run --rm -it centos:7 /bin/bash -c 'curl -sL https://rpm.nodesource.com/setup_14.x | bash - && yum install -y nodejs gcc-c++ make && npm install @splunk/otel'
$ docker run --rm -it centos:7 /bin/bash -c 'curl -sL https://rpm.nodesource.com/setup_14.x | bash - && yum install -y nodejs gcc-c++ make && npm install @splunk/otel'

## Installing the NodeSource Node.js 14.x repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release || rpm -q --whatprovides fedora-release
+ uname -m

## Confirming "el7-x86_64" is supported...

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_14.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.NOfofFSFX8' 'https://rpm.nodesource.com/pub_14.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Installing release setup RPM...

+ rpm -i --nosignature --force '/tmp/tmp.NOfofFSFX8'

## Cleaning up...

+ rm -f '/tmp/tmp.NOfofFSFX8'

## Checking for existing installations...

+ rpm -qa 'node|npm' | grep -v nodesource

## Run `sudo yum install -y nodejs` to install Node.js 14.x and npm.
## You may run dnf if yum is not available:
     sudo dnf install -y nodejs
## You may also need development tools to build native addons:
     sudo yum install gcc-c++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
     sudo yum install yarn

Loaded plugins: fastestmirror, ovl
Determining fastest mirrors
 * base: centos.wielun.net
 * extras: centos.wielun.net
 * updates: centos.wielun.net
base                                                                                                                                                                                                                                                                                                                             | 3.6 kB  00:00:00
extras                                                                                                                                                                                                                                                                                                                           | 2.9 kB  00:00:00
nodesource                                                                                                                                                                                                                                                                                                                       | 2.5 kB  00:00:00
updates                                                                                                                                                                                                                                                                                                                          | 2.9 kB  00:00:00
(1/5): nodesource/x86_64/primary_db                                                                                                                                                                                                                                                                                              |  58 kB  00:00:00
(2/5): base/7/x86_64/group_gz                                                                                                                                                                                                                                                                                                    | 153 kB  00:00:00
(3/5): extras/7/x86_64/primary_db                                                                                                                                                                                                                                                                                                | 250 kB  00:00:00
(4/5): base/7/x86_64/primary_db                                                                                                                                                                                                                                                                                                  | 6.1 MB  00:00:04
(5/5): updates/7/x86_64/primary_db                                                                                                                                                                                                                                                                                               |  17 MB  00:00:16
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.x86_64 0:4.8.5-44.el7 will be installed
--> Processing Dependency: libstdc++-devel = 4.8.5-44.el7 for package: gcc-c++-4.8.5-44.el7.x86_64
--> Processing Dependency: gcc = 4.8.5-44.el7 for package: gcc-c++-4.8.5-44.el7.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-c++-4.8.5-44.el7.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-c++-4.8.5-44.el7.x86_64
---> Package make.x86_64 1:3.82-24.el7 will be installed
---> Package nodejs.x86_64 2:14.20.0-1nodesource will be installed
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-44.el7 will be installed
--> Processing Dependency: libgomp = 4.8.5-44.el7 for package: gcc-4.8.5-44.el7.x86_64
--> Processing Dependency: cpp = 4.8.5-44.el7 for package: gcc-4.8.5-44.el7.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-44.el7.x86_64
--> Processing Dependency: libgomp.so.1()(64bit) for package: gcc-4.8.5-44.el7.x86_64
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package libstdc++-devel.x86_64 0:4.8.5-44.el7 will be installed
---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-44.el7 will be installed
---> Package glibc-devel.x86_64 0:2.17-326.el7_9 will be installed
--> Processing Dependency: glibc-headers = 2.17-326.el7_9 for package: glibc-devel-2.17-326.el7_9.x86_64
--> Processing Dependency: glibc = 2.17-326.el7_9 for package: glibc-devel-2.17-326.el7_9.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-326.el7_9.x86_64
---> Package libgomp.x86_64 0:4.8.5-44.el7 will be installed
--> Running transaction check
---> Package glibc.x86_64 0:2.17-317.el7 will be updated
--> Processing Dependency: glibc = 2.17-317.el7 for package: glibc-common-2.17-317.el7.x86_64
---> Package glibc.x86_64 0:2.17-326.el7_9 will be an update
---> Package glibc-headers.x86_64 0:2.17-326.el7_9 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-326.el7_9.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-326.el7_9.x86_64
--> Running transaction check
---> Package glibc-common.x86_64 0:2.17-317.el7 will be updated
---> Package glibc-common.x86_64 0:2.17-326.el7_9 will be an update
---> Package kernel-headers.x86_64 0:3.10.0-1160.76.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================================================================================================================================================================================================
 Package                                                                               Arch                                                                         Version                                                                                      Repository                                                                        Size
========================================================================================================================================================================================================================================================================================================================================================
Installing:
 gcc-c++                                                                               x86_64                                                                       4.8.5-44.el7                                                                                 base                                                                             7.2 M
 make                                                                                  x86_64                                                                       1:3.82-24.el7                                                                                base                                                                             421 k
 nodejs                                                                                x86_64                                                                       2:14.20.0-1nodesource                                                                        nodesource                                                                        33 M
Installing for dependencies:
 cpp                                                                                   x86_64                                                                       4.8.5-44.el7                                                                                 base                                                                             5.9 M
 gcc                                                                                   x86_64                                                                       4.8.5-44.el7                                                                                 base                                                                              16 M
 glibc-devel                                                                           x86_64                                                                       2.17-326.el7_9                                                                               updates                                                                          1.1 M
 glibc-headers                                                                         x86_64                                                                       2.17-326.el7_9                                                                               updates                                                                          691 k
 kernel-headers                                                                        x86_64                                                                       3.10.0-1160.76.1.el7                                                                         updates                                                                          9.1 M
 libgomp                                                                               x86_64                                                                       4.8.5-44.el7                                                                                 base                                                                             159 k
 libmpc                                                                                x86_64                                                                       1.0.1-3.el7                                                                                  base                                                                              51 k
 libstdc++-devel                                                                       x86_64                                                                       4.8.5-44.el7                                                                                 base                                                                             1.5 M
 mpfr                                                                                  x86_64                                                                       3.1.1-4.el7                                                                                  base                                                                             203 k
Updating for dependencies:
 glibc                                                                                 x86_64                                                                       2.17-326.el7_9                                                                               updates                                                                          3.6 M
 glibc-common                                                                          x86_64                                                                       2.17-326.el7_9                                                                               updates                                                                           12 M

Transaction Summary
========================================================================================================================================================================================================================================================================================================================================================
Install  3 Packages (+9 Dependent packages)
Upgrade             ( 2 Dependent packages)

Total download size: 90 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
warning: /var/cache/yum/x86_64/7/updates/packages/glibc-2.17-326.el7_9.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY                     16% [=======================-                                                                                                                           ] 3.2 MB/s |  15 MB  00:00:23 ETA
Public key for glibc-2.17-326.el7_9.x86_64.rpm is not installed
(1/14): glibc-2.17-326.el7_9.x86_64.rpm                                                                                                                                                                                                                                                                                          | 3.6 MB  00:00:03
Public key for cpp-4.8.5-44.el7.x86_64.rpm is not installed                                                                                                   24% [===================================-                                                                                                               ] 3.8 MB/s |  22 MB  00:00:17 ETA
(2/14): cpp-4.8.5-44.el7.x86_64.rpm                                                                                                                                                                                                                                                                                              | 5.9 MB  00:00:04
(3/14): glibc-devel-2.17-326.el7_9.x86_64.rpm                                                                                                                                                                                                                                                                                    | 1.1 MB  00:00:01
(4/14): glibc-headers-2.17-326.el7_9.x86_64.rpm                                                                                                                                                                                                                                                                                  | 691 kB  00:00:00
(5/14): libgomp-4.8.5-44.el7.x86_64.rpm                                                                                                                                                                                                                                                                                          | 159 kB  00:00:00
(6/14): libmpc-1.0.1-3.el7.x86_64.rpm                                                                                                                                                                                                                                                                                            |  51 kB  00:00:00
(7/14): libstdc++-devel-4.8.5-44.el7.x86_64.rpm                                                                                                                                                                                                                                                                                  | 1.5 MB  00:00:00
(8/14): make-3.82-24.el7.x86_64.rpm                                                                                                                                                                                                                                                                                              | 421 kB  00:00:00
(9/14): mpfr-3.1.1-4.el7.x86_64.rpm                                                                                                                                                                                                                                                                                              | 203 kB  00:00:00
warning: /var/cache/yum/x86_64/7/nodesource/packages/nodejs-14.20.0-1nodesource.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 34fa74dd: NOKEY            69% [=====================================================================================================-                                             ] 8.6 MB/s |  63 MB  00:00:03 ETA
Public key for nodejs-14.20.0-1nodesource.x86_64.rpm is not installed
(10/14): nodejs-14.20.0-1nodesource.x86_64.rpm                                                                                                                                                                                                                                                                                   |  33 MB  00:00:01
(11/14): gcc-c++-4.8.5-44.el7.x86_64.rpm                                                                                                                                                                                                                                                                                         | 7.2 MB  00:00:12
(12/14): glibc-common-2.17-326.el7_9.x86_64.rpm                                                                                                                                                                                                                                                                                  |  12 MB  00:00:12
(13/14): kernel-headers-3.10.0-1160.76.1.el7.x86_64.rpm                                                                                                                                                                                                                                                                          | 9.1 MB  00:00:09
(14/14): gcc-4.8.5-44.el7.x86_64.rpm                                                                                                                                                                                                                                                                                             |  16 MB  00:00:15
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                                                                                                                                   5.9 MB/s |  90 MB  00:00:15
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-9.2009.0.el7.centos.x86_64 (@CentOS)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Retrieving key from file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
Importing GPG key 0x34FA74DD:
 Userid     : "NodeSource <gpg-rpm@nodesource.com>"
 Fingerprint: 2e55 207a 95d9 944b 0cc9 3261 5ddb e8d4 34fa 74dd
 Package    : nodesource-release-el7-1.noarch (installed)
 From       : /etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Updating   : glibc-2.17-326.el7_9.x86_64                                                                                                                                                                                                                                                                                                         1/16
  Updating   : glibc-common-2.17-326.el7_9.x86_64                                                                                                                                                                                                                                                                                                  2/16
  Installing : mpfr-3.1.1-4.el7.x86_64                                                                                                                                                                                                                                                                                                             3/16
  Installing : libmpc-1.0.1-3.el7.x86_64                                                                                                                                                                                                                                                                                                           4/16
  Installing : cpp-4.8.5-44.el7.x86_64                                                                                                                                                                                                                                                                                                             5/16
  Installing : libgomp-4.8.5-44.el7.x86_64                                                                                                                                                                                                                                                                                                         6/16
  Installing : libstdc++-devel-4.8.5-44.el7.x86_64                                                                                                                                                                                                                                                                                                 7/16
  Installing : kernel-headers-3.10.0-1160.76.1.el7.x86_64                                                                                                                                                                                                                                                                                          8/16
  Installing : glibc-headers-2.17-326.el7_9.x86_64                                                                                                                                                                                                                                                                                                 9/16
  Installing : glibc-devel-2.17-326.el7_9.x86_64                                                                                                                                                                                                                                                                                                  10/16
  Installing : gcc-4.8.5-44.el7.x86_64                                                                                                                                                                                                                                                                                                            11/16
  Installing : gcc-c++-4.8.5-44.el7.x86_64                                                                                                                                                                                                                                                                                                        12/16
  Installing : 2:nodejs-14.20.0-1nodesource.x86_64                                                                                                                                                                                                                                                                                                13/16
  Installing : 1:make-3.82-24.el7.x86_64                                                                                                                                                                                                                                                                                                          14/16
  Cleanup    : glibc-2.17-317.el7.x86_64                                                                                                                                                                                                                                                                                                          15/16
  Cleanup    : glibc-common-2.17-317.el7.x86_64                                                                                                                                                                                                                                                                                                   16/16
  Verifying  : gcc-c++-4.8.5-44.el7.x86_64                                                                                                                                                                                                                                                                                                         1/16
  Verifying  : glibc-common-2.17-326.el7_9.x86_64                                                                                                                                                                                                                                                                                                  2/16
  Verifying  : kernel-headers-3.10.0-1160.76.1.el7.x86_64                                                                                                                                                                                                                                                                                          3/16
  Verifying  : gcc-4.8.5-44.el7.x86_64                                                                                                                                                                                                                                                                                                             4/16
  Verifying  : glibc-2.17-326.el7_9.x86_64                                                                                                                                                                                                                                                                                                         5/16
  Verifying  : mpfr-3.1.1-4.el7.x86_64                                                                                                                                                                                                                                                                                                             6/16
  Verifying  : glibc-devel-2.17-326.el7_9.x86_64                                                                                                                                                                                                                                                                                                   7/16
  Verifying  : cpp-4.8.5-44.el7.x86_64                                                                                                                                                                                                                                                                                                             8/16
  Verifying  : glibc-headers-2.17-326.el7_9.x86_64                                                                                                                                                                                                                                                                                                 9/16
  Verifying  : 2:nodejs-14.20.0-1nodesource.x86_64                                                                                                                                                                                                                                                                                                10/16
  Verifying  : libstdc++-devel-4.8.5-44.el7.x86_64                                                                                                                                                                                                                                                                                                11/16
  Verifying  : libmpc-1.0.1-3.el7.x86_64                                                                                                                                                                                                                                                                                                          12/16
  Verifying  : 1:make-3.82-24.el7.x86_64                                                                                                                                                                                                                                                                                                          13/16
  Verifying  : libgomp-4.8.5-44.el7.x86_64                                                                                                                                                                                                                                                                                                        14/16
  Verifying  : glibc-common-2.17-317.el7.x86_64                                                                                                                                                                                                                                                                                                   15/16
  Verifying  : glibc-2.17-317.el7.x86_64                                                                                                                                                                                                                                                                                                          16/16

Installed:
  gcc-c++.x86_64 0:4.8.5-44.el7                                                                                    make.x86_64 1:3.82-24.el7                                                                                    nodejs.x86_64 2:14.20.0-1nodesource

Dependency Installed:
  cpp.x86_64 0:4.8.5-44.el7          gcc.x86_64 0:4.8.5-44.el7          glibc-devel.x86_64 0:2.17-326.el7_9          glibc-headers.x86_64 0:2.17-326.el7_9          kernel-headers.x86_64 0:3.10.0-1160.76.1.el7          libgomp.x86_64 0:4.8.5-44.el7          libmpc.x86_64 0:1.0.1-3.el7          libstdc++-devel.x86_64 0:4.8.5-44.el7
  mpfr.x86_64 0:3.1.1-4.el7

Dependency Updated:
  glibc.x86_64 0:2.17-326.el7_9                                                                                                                                           glibc-common.x86_64 0:2.17-326.el7_9

Complete!
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated text-encoding@0.6.4: no longer maintained
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

> @splunk/otel@1.3.0 install /node_modules/@splunk/otel
> node-gyp-build

make: Entering directory `/node_modules/@splunk/otel/build'
  CXX(target) Release/obj.target/metrics/src/native_ext/util/arena.o
In file included from ../src/native_ext/util/arena.cpp:1:0:
../src/native_ext/util/arena.h:26:73: error: 'assume_aligned' attribute directive ignored [-Werror=attributes]
 void* SPLK_ASSUME_ALIGNED(16) MemArenaAlloc(MemArena* arena, size_t size);
                                                                         ^
../src/native_ext/util/arena.h:30:77: error: 'assume_aligned' attribute directive ignored [-Werror=attributes]
 void* SPLK_ASSUME_ALIGNED(16) PagedArenaAlloc(PagedArena* arena, size_t size);
                                                                             ^
../src/native_ext/util/arena.cpp:63:77: error: 'assume_aligned' attribute directive ignored [-Werror=attributes]
 void* SPLK_ASSUME_ALIGNED(16) PagedArenaAlloc(PagedArena* arena, size_t size) {
                                                                             ^
cc1plus: error: unrecognized command line option "-Wno-cast-function-type" [-Werror]
cc1plus: all warnings being treated as errors
make: *** [Release/obj.target/metrics/src/native_ext/util/arena.o] Error 1
make: Leaving directory `/node_modules/@splunk/otel/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Linux 5.10.47-linuxkit
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /node_modules/@splunk/otel
gyp ERR! node -v v14.20.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/package.json'
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @splunk/otel@1.3.0 install: `node-gyp-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @splunk/otel@1.3.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-09-05T15_43_42_903Z-debug.log

It looks like it is not using any of the prebuilds and when it actually tries to build it fails on c++ version. Which seems to have changed with this PR: #385

[root@fb9d447e45e3 @splunk]# node-gyp-build-test
internal/modules/cjs/loader.js:1144
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /tmp-preb/node_modules/@splunk/prebuilds/linux-x64/node.abi83.node)
    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:101:18)
    at load (/node-gyp-build/index.js:23:10)
    at Object.<anonymous> (/node-gyp-build/build-test.js:19:19)
    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) {
  code: 'ERR_DLOPEN_FAILED'
}

but

[root@fb9d447e45e3 @splunk]# strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX_
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_DEBUG_MESSAGE_LENGTH

this is why it's ignoring prebuilds. Can you send me an email (address is in my profile) so I know which account (company) this is for?

Emailed you!

seemk commented

We'll do a new release on Monday, getting a few more changes in

I can confirm this now works, thanks for fixing this!