RuntimeTools / appmetrics

Node Application Metrics provides a foundational infrastructure for collecting resource and performance monitoring data for Node.js-based applications.
https://developer.ibm.com/open/node-application-metrics/
Apache License 2.0
970 stars 125 forks source link

Error with node:14-alpine3.13 image #648

Closed dnascimb closed 3 years ago

dnascimb commented 3 years ago

This issue occurs with the latest version (v5.1.1) of appmetrics and the public node:14-alpine3.13 docker image. I verified that this works with the node:12.20-alpine image.

npm ERR! code 1
npm ERR! path /usr/src/app/node_modules/appmetrics
npm ERR! command failed
npm ERR! command sh -c node showBuildInfo.js && node-gyp rebuild
npm ERR! Thu, 18 Feb 2021 20:22:17 GMT
npm ERR! ********************************************************************************
npm ERR! You are installing the Node Application Metrics monitoring and profiling module.
npm ERR! Licensed under the Apache License, Version 2.0 (the "License")
npm ERR! you may not use this file except in compliance with the License.
npm ERR! You may obtain a copy of the License at
npm ERR!
npm ERR! http://www.apache.org/licenses/LICENSE-2.0
npm ERR!
npm ERR! Unless required by applicable law or agreed to in writing, software
npm ERR! distributed under the License is distributed on an "AS IS" BASIS,
npm ERR! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
npm ERR! See the License for the specific language governing permissions and
npm ERR! limitations under the License.
npm ERR! ********************************************************************************
npm ERR!
npm ERR!
npm ERR! ********************************************************************************
npm ERR! Appmetrics uses node-gyp to compile and build local binary libraries to enhance execution performance. If the following compilation and build logs contain errors, make sure you have the node-gyp pre-requisites installed (https://github.com/nodejs/node-gyp#installation). If you have them and the build still had errors, see if there are any related issues at https://github.com/RuntimeTools/appmetrics/issues). If there aren't, feel free to open a new issue to report the bug.
npm ERR! ********************************************************************************
npm ERR!
npm ERR!
npm ERR! make: Entering directory '/usr/src/app/node_modules/appmetrics/build'
npm ERR!   ACTION binding_gyp_appmetrics_target_Set_appmetrics_reported_version_build_level Release/obj.target/appmetrics/geni/appmetrics.cpp
npm ERR! infile: ./src/appmetrics.cpp
npm ERR! outfile: /usr/src/app/node_modules/appmetrics/build/Release/obj.target/appmetrics/geni/appmetrics.cpp
npm ERR! Replacing '"99\.99\.99\.29991231"' with '"5.1.1.202102182022"'
npm ERR!   CXX(target) Release/obj.target/appmetrics/geni/appmetrics.o
npm ERR! make: Leaving directory '/usr/src/app/node_modules/appmetrics/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@5.1.1
npm ERR! gyp info using node@14.15.5 | linux | x64
npm ERR! gyp info find Python using Python version 2.7.18 found at "/usr/bin/python"
npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v14.15.5/node-v14.15.5-headers.tar.gz
npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v14.15.5/node-v14.15.5-headers.tar.gz
npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v14.15.5/SHASUMS256.txt
npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v14.15.5/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/src/app/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   '/usr/src/app/node_modules/appmetrics/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/src/app/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/root/.cache/node-gyp/14.15.5/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/14.15.5',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/src/app/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/14.15.5/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/usr/src/app/node_modules/appmetrics',
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' ]
npm ERR! In file included from Release/obj.target/appmetrics/geni/appmetrics.cpp:22:
npm ERR! ../../nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker*)':
npm ERR! ../../nan/nan.h:2298:7: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
npm ERR!  2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
npm ERR!       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from Release/obj.target/appmetrics/geni/appmetrics.cpp:25:
npm ERR! ../src/plugins/node/prof/watchdog.h: In function 'const char* watchdog::StartCpuProfiling(v8::Isolate*, uint64_t)':
npm ERR! ../src/plugins/node/prof/watchdog.h:251:6: error: 'struct sigevent' has no member named '_sigev_un'
npm ERR!   251 |   ev._sigev_un._tid = profiler_tid;
npm ERR!       |      ^~~~~~~~~
npm ERR! ../src/plugins/node/prof/watchdog.h: In function 'void watchdog::Initialize(v8::Isolate*, v8::Local<v8::Object>)':
npm ERR! ../src/plugins/node/prof/watchdog.h:305:3: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::Function>)'
npm ERR!   305 |   );
npm ERR!       |   ^
npm ERR! In file included from /root/.cache/node-gyp/14.15.5/include/node/node.h:67,
npm ERR!                  from Release/obj.target/appmetrics/geni/appmetrics.cpp:21:
npm ERR! /root/.cache/node-gyp/14.15.5/include/node/v8.h:3670:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)'
npm ERR!  3670 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!       |                                     ^~~
npm ERR! /root/.cache/node-gyp/14.15.5/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /root/.cache/node-gyp/14.15.5/include/node/v8.h:3673:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)'
npm ERR!  3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! /root/.cache/node-gyp/14.15.5/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp: In function 'void emitMessage(uv_async_t*, int)':
npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp:424:44: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
npm ERR!   424 |         listener->callback->Call(argc, argv);
npm ERR!       |                                            ^
npm ERR! In file included from Release/obj.target/appmetrics/geni/appmetrics.cpp:22:
npm ERR! ../../nan/nan.h:1740:3: note: declared here
npm ERR!  1740 |   Call(int argc, v8::Local<v8::Value> argv[]) const {
npm ERR!       |   ^~~~
npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp: In function 'void lrtime(const Nan::FunctionCallbackInfo<v8::Value>&)':
npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp:593:64: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)', declared with attribute 'warn_unused_result' [-Wunused-result]
npm ERR!   593 |     result->Set(context, 0, v8::Number::New(isolate, ts.tv_sec));
npm ERR!       |                                                                ^
npm ERR! In file included from /root/.cache/node-gyp/14.15.5/include/node/node.h:67,
npm ERR!                  from Release/obj.target/appmetrics/geni/appmetrics.cpp:21:
npm ERR! /root/.cache/node-gyp/14.15.5/include/node/v8.h:3673:37: note: declared here
npm ERR!  3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp:594:78: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)', declared with attribute 'warn_unused_result' [-Wunused-result]
npm ERR!   594 |     result->Set(context, 1, v8::Integer::NewFromUnsigned(isolate, ts.tv_nsec));
npm ERR!       |                                                                              ^
npm ERR! In file included from /root/.cache/node-gyp/14.15.5/include/node/node.h:67,
npm ERR!                  from Release/obj.target/appmetrics/geni/appmetrics.cpp:21:
npm ERR! /root/.cache/node-gyp/14.15.5/include/node/v8.h:3673:37: note: declared here
npm ERR!  3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!       |                                     ^~~
npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp: In function 'void init(v8::Local<v8::Object>, v8::Local<v8::Object>)':
npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp:713:52: warning: cast between incompatible function types from 'void (*)(uv_async_t*, int)' {aka 'void (*)(uv_async_s*, int)'} to 'uv_async_cb' {aka 'void (*)(uv_async_s*)'} [-Wcast-function-type]
npm ERR!   713 |     uv_async_init(uv_default_loop(), messageAsync, (uv_async_cb)emitMessage);
npm ERR!       |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from Release/obj.target/appmetrics/geni/appmetrics.cpp:21:
npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp: At global scope:
npm ERR! /root/.cache/node-gyp/14.15.5/include/node/node.h:758:7: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Object>)' to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
npm ERR!   758 |       (node::addon_register_func) (regfunc),                          \
npm ERR!       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /root/.cache/node-gyp/14.15.5/include/node/node.h:792:3: note: in expansion of macro 'NODE_MODULE_X'
npm ERR!   792 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!       |   ^~~~~~~~~~~~~
npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp:768:1: note: in expansion of macro 'NODE_MODULE'
npm ERR!   768 | NODE_MODULE(appmetrics, init)
npm ERR!       | ^~~~~~~~~~~
npm ERR! make: *** [Makefile:282: Release/obj.target/appmetrics/geni/appmetrics.o] 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 (/usr/src/app/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Linux 4.19.121-linuxkit
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/src/app/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /usr/src/app/node_modules/appmetrics
npm ERR! gyp ERR! node -v v14.15.5
npm ERR! gyp ERR! node-gyp -v v5.1.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-02-18T20_22_29_388Z-debug.log
ERROR: Service 'app' failed to build : The command '/bin/sh -c npm install -g npm   && npm install -g node-gyp   && npm ci' returned a non-zero code: 1
krisan commented 3 years ago

The same error on node:14.16.0-alpine3.13 but node:14.16.0-alpine3.12 works

********************************************************************************
Appmetrics uses node-gyp to compile and build local binary libraries to enhance execution performance. If the following compilation and build logs contain errors, make sure you have the node-gyp pre-requisites installed (https://github.com/nodejs/node-gyp#installation). If you have them and the build still had errors, see if there are any related issues at https://github.com/RuntimeTools/appmetrics/issues). If there aren't, feel free to open a new issue to report the bug.
********************************************************************************

make: Entering directory '/app/node_modules/appmetrics/build'
  ACTION binding_gyp_appmetrics_target_Set_appmetrics_reported_version_build_level Release/obj.target/appmetrics/geni/appmetrics.cpp
infile: ./src/appmetrics.cpp
outfile: /app/node_modules/appmetrics/build/Release/obj.target/appmetrics/geni/appmetrics.cpp
Replacing '"99\.99\.99\.29991231"' with '"5.1.1.202103292235"'
  CXX(target) Release/obj.target/appmetrics/geni/appmetrics.o
In file included from Release/obj.target/appmetrics/geni/appmetrics.cpp:25:
../src/plugins/node/prof/watchdog.h: In function 'const char* watchdog::StartCpuProfiling(v8::Isolate*, uint64_t)':
../src/plugins/node/prof/watchdog.h:251:6: error: 'struct sigevent' has no member named '_sigev_un'
  251 |   ev._sigev_un._tid = profiler_tid;
      |      ^~~~~~~~~
../src/plugins/node/prof/watchdog.h: In function 'void watchdog::Initialize(v8::Isolate*, v8::Local<v8::Object>)':
../src/plugins/node/prof/watchdog.h:305:3: error: no matching function for call to 'v8::Object::Set(v8::Local<v8::String>, v8::Local<v8::Function>)'
  305 |   );
      |   ^
In file included from /root/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from Release/obj.target/appmetrics/geni/appmetrics.cpp:21:
/root/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)'
 3670 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
/root/.cache/node-gyp/14.16.0/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
/root/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)'
 3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
      |                                     ^~~
/root/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
Release/obj.target/appmetrics/geni/appmetrics.cpp: In function 'void emitMessage(uv_async_t*, int)':
Release/obj.target/appmetrics/geni/appmetrics.cpp:424:44: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
  424 |         listener->callback->Call(argc, argv);
      |                                            ^
In file included from Release/obj.target/appmetrics/geni/appmetrics.cpp:22:
../../nan/nan.h:1742:3: note: declared here
 1742 |   Call(int argc, v8::Local<v8::Value> argv[]) const {
      |   ^~~~
Release/obj.target/appmetrics/geni/appmetrics.cpp: In function 'void lrtime(const Nan::FunctionCallbackInfo<v8::Value>&)':
Release/obj.target/appmetrics/geni/appmetrics.cpp:593:64: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)', declared with attribute 'warn_unused_result' [-Wunused-result]
  593 |     result->Set(context, 0, v8::Number::New(isolate, ts.tv_sec));
      |                                                                ^
In file included from /root/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from Release/obj.target/appmetrics/geni/appmetrics.cpp:21:
/root/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note: declared here
 3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
      |                                     ^~~
Release/obj.target/appmetrics/geni/appmetrics.cpp:594:78: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)', declared with attribute 'warn_unused_result' [-Wunused-result]
  594 |     result->Set(context, 1, v8::Integer::NewFromUnsigned(isolate, ts.tv_nsec));
      |                                                                              ^
In file included from /root/.cache/node-gyp/14.16.0/include/node/node.h:67,
                 from Release/obj.target/appmetrics/geni/appmetrics.cpp:21:
/root/.cache/node-gyp/14.16.0/include/node/v8.h:3673:37: note: declared here
 3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
      |                                     ^~~
Release/obj.target/appmetrics/geni/appmetrics.cpp: In function 'void init(v8::Local<v8::Object>, v8::Local<v8::Object>)':
Release/obj.target/appmetrics/geni/appmetrics.cpp:713:52: warning: cast between incompatible function types from 'void (*)(uv_async_t*, int)' {aka 'void (*)(uv_async_s*, int)'} to 'uv_async_cb' {aka 'void (*)(uv_async_s*)'} [-Wcast-function-type]
  713 |     uv_async_init(uv_default_loop(), messageAsync, (uv_async_cb)emitMessage);
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from Release/obj.target/appmetrics/geni/appmetrics.cpp:21:
Release/obj.target/appmetrics/geni/appmetrics.cpp: At global scope:
/root/.cache/node-gyp/14.16.0/include/node/node.h:758:7: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Object>)' to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
  758 |       (node::addon_register_func) (regfunc),                          \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/.cache/node-gyp/14.16.0/include/node/node.h:792:3: note: in expansion of macro 'NODE_MODULE_X'
  792 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
Release/obj.target/appmetrics/geni/appmetrics.cpp:768:1: note: in expansion of macro 'NODE_MODULE'
  768 | NODE_MODULE(appmetrics, init)
      | ^~~~~~~~~~~
make: Leaving directory '/app/node_modules/appmetrics/build'
make: *** [Makefile:282: Release/obj.target/appmetrics/geni/appmetrics.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 4.19.121-linuxkit
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /app/node_modules/appmetrics
gyp ERR! node -v v14.16.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appmetrics@5.1.1 install: `node showBuildInfo.js && node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the appmetrics@5.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
dnascimb commented 3 years ago

The same error on node:14.16.0-alpine3.13 but node:14.16.0-alpine3.12 works

I was able to verify this. Thanks for responding.

dnascimb commented 3 years ago

Closing issue since a workaround of using node:14.16.0-alpine3.12 seems to be sufficient.