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
975 stars 126 forks source link

Error with node:14.17.6-alpine3.14 image #654

Open atewari-bot opened 3 years ago

atewari-bot commented 3 years ago

This issue occurs with the latest version (v5.1.1) of appmetrics and the public node:14.17.6-alpine3.14 docker image. It works with the node:14.16.0-alpine3.12 image.

I also tried other public node-alpine images like below but encountered same issue. node:14.17-alpine3.14, node:14.17.6-alpine3.14, node:16.8.0-alpine3.14

#13 139.3 npm ERR! code 1
#13 139.3 npm ERR! path /usr/src/app/node_modules/appmetrics
#13 139.3 npm ERR! command failed
#13 139.3 npm ERR! command sh -c node showBuildInfo.js && node-gyp rebuild
#13 139.3 npm ERR! Wed, 01 Sep 2021 17:59:58 GMT
#13 139.3 npm ERR! ********************************************************************************
#13 139.3 npm ERR! You are installing the Node Application Metrics monitoring and profiling module.
#13 139.3 npm ERR! Licensed under the Apache License, Version 2.0 (the "License")
#13 139.3 npm ERR! you may not use this file except in compliance with the License.
#13 139.3 npm ERR! You may obtain a copy of the License at
#13 139.3 npm ERR! 
#13 139.3 npm ERR! http://www.apache.org/licenses/LICENSE-2.0
#13 139.3 npm ERR! 
#13 139.3 npm ERR! Unless required by applicable law or agreed to in writing, software
#13 139.3 npm ERR! distributed under the License is distributed on an "AS IS" BASIS,
#13 139.3 npm ERR! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#13 139.3 npm ERR! See the License for the specific language governing permissions and
#13 139.3 npm ERR! limitations under the License.
#13 139.3 npm ERR! ********************************************************************************
#13 139.3 npm ERR! 
#13 139.3 npm ERR! 
#13 139.3 npm ERR! ********************************************************************************
#13 139.3 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.
#13 139.3 npm ERR! ********************************************************************************
#13 139.3 npm ERR! 
#13 139.3 npm ERR! 
#13 139.3 npm ERR! make: Entering directory '/usr/src/app/node_modules/appmetrics/build'
#13 139.3 npm ERR!   ACTION binding_gyp_appmetrics_target_Set_appmetrics_reported_version_build_level Release/obj.target/appmetrics/geni/appmetrics.cpp
#13 139.3 npm ERR! infile: ./src/appmetrics.cpp
#13 139.3 npm ERR! outfile: /usr/src/app/node_modules/appmetrics/build/Release/obj.target/appmetrics/geni/appmetrics.cpp
#13 139.3 npm ERR! Replacing '"99\.99\.99\.29991231"' with '"5.1.1.202109011800"'
#13 139.3 npm ERR!   CXX(target) Release/obj.target/appmetrics/geni/appmetrics.o
#13 139.3 npm ERR! make: Leaving directory '/usr/src/app/node_modules/appmetrics/build'
#13 139.3 npm ERR! gyp info it worked if it ends with ok
#13 139.3 npm ERR! gyp info using node-gyp@5.1.1
#13 139.3 npm ERR! gyp info using node@14.17.6 | linux | x64
#13 139.3 npm ERR! gyp info find Python using Python version 2.7.18 found at "/usr/bin/python"
#13 139.3 npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v14.17.6/node-v14.17.6-headers.tar.gz
#13 139.3 npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v14.17.6/node-v14.17.6-headers.tar.gz
#13 139.3 npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v14.17.6/SHASUMS256.txt
#13 139.3 npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v14.17.6/SHASUMS256.txt
#13 139.3 npm ERR! gyp info spawn /usr/bin/python
#13 139.3 npm ERR! gyp info spawn args [
#13 139.3 npm ERR! gyp info spawn args   '/usr/src/app/node_modules/node-gyp/gyp/gyp_main.py',
#13 139.3 npm ERR! gyp info spawn args   'binding.gyp',
#13 139.3 npm ERR! gyp info spawn args   '-f',
#13 139.3 npm ERR! gyp info spawn args   'make',
#13 139.3 npm ERR! gyp info spawn args   '-I',
#13 139.3 npm ERR! gyp info spawn args   '/usr/src/app/node_modules/appmetrics/build/config.gypi',
#13 139.3 npm ERR! gyp info spawn args   '-I',
#13 139.3 npm ERR! gyp info spawn args   '/usr/src/app/node_modules/node-gyp/addon.gypi',
#13 139.3 npm ERR! gyp info spawn args   '-I',
#13 139.3 npm ERR! gyp info spawn args   '/root/.cache/node-gyp/14.17.6/include/node/common.gypi',
#13 139.3 npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
#13 139.3 npm ERR! gyp info spawn args   '-Dvisibility=default',
#13 139.3 npm ERR! gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/14.17.6',
#13 139.3 npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/src/app/node_modules/node-gyp',
#13 139.3 npm ERR! gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/14.17.6/<(target_arch)/node.lib',
#13 139.3 npm ERR! gyp info spawn args   '-Dmodule_root_dir=/usr/src/app/node_modules/appmetrics',
#13 139.3 npm ERR! gyp info spawn args   '-Dnode_engine=v8',
#13 139.3 npm ERR! gyp info spawn args   '--depth=.',
#13 139.3 npm ERR! gyp info spawn args   '--no-parallel',
#13 139.3 npm ERR! gyp info spawn args   '--generator-output',
#13 139.3 npm ERR! gyp info spawn args   'build',
#13 139.3 npm ERR! gyp info spawn args   '-Goutput_dir=.'
#13 139.3 npm ERR! gyp info spawn args ]
#13 139.3 npm ERR! gyp info spawn make
#13 139.3 npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
#13 139.3 npm ERR! In file included from Release/obj.target/appmetrics/geni/appmetrics.cpp:22:
#13 139.3 npm ERR! ../../nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker*)':
#13 139.3 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]
#13 139.3 npm ERR!  2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
#13 139.3 npm ERR!       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#13 139.3 npm ERR! In file included from Release/obj.target/appmetrics/geni/appmetrics.cpp:25:
#13 139.3 npm ERR! ../src/plugins/node/prof/watchdog.h: In function 'const char* watchdog::StartCpuProfiling(v8::Isolate*, uint64_t)':
#13 139.3 npm ERR! ../src/plugins/node/prof/watchdog.h:251:6: error: 'struct sigevent' has no member named '_sigev_un'
#13 139.3 npm ERR!   251 |   ev._sigev_un._tid = profiler_tid;
#13 139.3 npm ERR!       |      ^~~~~~~~~
#13 139.3 npm ERR! ../src/plugins/node/prof/watchdog.h: In function 'void watchdog::Initialize(v8::Isolate*, v8::Local<v8::Object>)':
#13 139.3 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>)'
#13 139.3 npm ERR!   305 |   );
#13 139.3 npm ERR!       |   ^
#13 139.3 npm ERR! In file included from /root/.cache/node-gyp/14.17.6/include/node/node.h:67,
#13 139.3 npm ERR!                  from Release/obj.target/appmetrics/geni/appmetrics.cpp:21:
#13 139.3 npm ERR! /root/.cache/node-gyp/14.17.6/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>)'
#13 139.3 npm ERR!  3670 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
#13 139.3 npm ERR!       |                                     ^~~
#13 139.3 npm ERR! /root/.cache/node-gyp/14.17.6/include/node/v8.h:3670:37: note:   candidate expects 3 arguments, 2 provided
#13 139.3 npm ERR! /root/.cache/node-gyp/14.17.6/include/node/v8.h:3673:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)'
#13 139.3 npm ERR!  3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
#13 139.3 npm ERR!       |                                     ^~~
#13 139.3 npm ERR! /root/.cache/node-gyp/14.17.6/include/node/v8.h:3673:37: note:   candidate expects 3 arguments, 2 provided
#13 139.3 npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp: In function 'void emitMessage(uv_async_t*, int)':
#13 139.3 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]
#13 139.3 npm ERR!   424 |         listener->callback->Call(argc, argv);
#13 139.3 npm ERR!       |                                            ^
#13 139.3 npm ERR! In file included from Release/obj.target/appmetrics/geni/appmetrics.cpp:22:
#13 139.3 npm ERR! ../../nan/nan.h:1740:3: note: declared here
#13 139.3 npm ERR!  1740 |   Call(int argc, v8::Local<v8::Value> argv[]) const {
#13 139.3 npm ERR!       |   ^~~~
#13 139.3 npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp: In function 'void lrtime(const Nan::FunctionCallbackInfo<v8::Value>&)':
#13 139.3 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]
#13 139.3 npm ERR!   593 |     result->Set(context, 0, v8::Number::New(isolate, ts.tv_sec));
#13 139.3 npm ERR!       |                                                                ^
#13 139.3 npm ERR! In file included from /root/.cache/node-gyp/14.17.6/include/node/node.h:67,
#13 139.3 npm ERR!                  from Release/obj.target/appmetrics/geni/appmetrics.cpp:21:
#13 139.3 npm ERR! /root/.cache/node-gyp/14.17.6/include/node/v8.h:3673:37: note: declared here
#13 139.3 npm ERR!  3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
#13 139.3 npm ERR!       |                                     ^~~
#13 139.3 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]
#13 139.3 npm ERR!   594 |     result->Set(context, 1, v8::Integer::NewFromUnsigned(isolate, ts.tv_nsec));
#13 139.3 npm ERR!       |                                                                              ^
#13 139.3 npm ERR! In file included from /root/.cache/node-gyp/14.17.6/include/node/node.h:67,
#13 139.3 npm ERR!                  from Release/obj.target/appmetrics/geni/appmetrics.cpp:21:
#13 139.3 npm ERR! /root/.cache/node-gyp/14.17.6/include/node/v8.h:3673:37: note: declared here
#13 139.3 npm ERR!  3673 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
#13 139.3 npm ERR!       |                                     ^~~
#13 139.3 npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp: In function 'void init(v8::Local<v8::Object>, v8::Local<v8::Object>)':
#13 139.3 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]
#13 139.3 npm ERR!   713 |     uv_async_init(uv_default_loop(), messageAsync, (uv_async_cb)emitMessage);
#13 139.3 npm ERR!       |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~
#13 139.3 npm ERR! In file included from Release/obj.target/appmetrics/geni/appmetrics.cpp:21:
#13 139.3 npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp: At global scope:
#13 139.3 npm ERR! /root/.cache/node-gyp/14.17.6/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]
#13 139.3 npm ERR!   758 |       (node::addon_register_func) (regfunc),                          \
#13 139.3 npm ERR!       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#13 139.3 npm ERR! /root/.cache/node-gyp/14.17.6/include/node/node.h:792:3: note: in expansion of macro 'NODE_MODULE_X'
#13 139.3 npm ERR!   792 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
#13 139.3 npm ERR!       |   ^~~~~~~~~~~~~
#13 139.3 npm ERR! Release/obj.target/appmetrics/geni/appmetrics.cpp:768:1: note: in expansion of macro 'NODE_MODULE'
#13 139.3 npm ERR!   768 | NODE_MODULE(appmetrics, init)
#13 139.3 npm ERR!       | ^~~~~~~~~~~
#13 139.3 npm ERR! make: *** [Makefile:282: Release/obj.target/appmetrics/geni/appmetrics.o] Error 1
#13 139.3 npm ERR! gyp ERR! build error 
#13 139.3 npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
#13 139.3 npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/src/app/node_modules/node-gyp/lib/build.js:194:23)
#13 139.3 npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
#13 139.3 npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
#13 139.3 npm ERR! gyp ERR! System Linux 5.10.25-linuxkit
#13 139.3 npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/src/app/node_modules/.bin/node-gyp" "rebuild"
#13 139.3 npm ERR! gyp ERR! cwd /usr/src/app/node_modules/appmetrics
#13 139.3 npm ERR! gyp ERR! node -v v14.17.6
#13 139.3 npm ERR! gyp ERR! node-gyp -v v5.1.1
#13 139.3 npm ERR! gyp ERR! not ok
#13 139.3 
#13 139.3 npm ERR! A complete log of this run can be found in:
#13 139.3 npm ERR!     /root/.npm/_logs/2021-09-01T18_00_11_316Z-debug.log
------
executor failed running [/bin/sh -c npm install -g npm   && npm install -g node-gyp   && npm ci]: exit code: 1
eoo commented 3 years ago

I have the exact same issue since yesterday. I did a system update and since then its not working for me. Node Version - 10, 14 OS Arch linux x64 Linux Kernel - 5.13.13

i have tried reinstalling node-gym, removing package-lock, remove .node-gyp folder from $home, removing node_modules folder and reinstalling etc..

Let me know if you find a solution.