ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
191 stars 149 forks source link

deploy to IBM cloud does not work npm ERR! ibm_db@2.5.0 install: `node installer/driverInstall.js` #498

Closed feotCopernicaiser closed 5 years ago

feotCopernicaiser commented 5 years ago

Hi. I have a continuous delivery pipeline on IBM cloud, with 2 stages. Build and Deploy.

The building part of is working, but the the deploy is always failing.

This is what i have tried. downgrade nodejs from 9 to 8. export environment variable. installed ibm_db locally then pushed the app. removed ibm_db and let it install as a dependencie tried different command in the Build script section under jobs

` 0 B / 14.05 MiB 0.00% 4.00 MiB / 14.05 MiB 28.48% 7.44 MiB / 14.05 MiB 52.95% 9.34 MiB / 14.05 MiB 66.52% 10.25 MiB / 14.05 MiB 72.97% 12.28 MiB / 14.05 MiB 87.43% 13.25 MiB / 14.05 MiB 94.33% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 14.05 MiB / 14.05 MiB 100.00% 4s

Waiting for API to complete processing files...

Staging app and tracing logs... Downloading sdk-for-nodejs... Downloaded sdk-for-nodejs Cell a16c6bd8-5094-471f-ac60-8a9a32c71bec creating container for instance 2cbea384-f767-4274-80a4-cf2f35e833e3 Cell a16c6bd8-5094-471f-ac60-8a9a32c71bec successfully created container for instance 2cbea384-f767-4274-80a4-cf2f35e833e3 Downloading app package... Downloaded app package (42.8M) -----> IBM SDK for Node.js Buildpack v3.24-20181128-1339 Based on Cloud Foundry Node.js Buildpack v1.5.24 -----> Creating runtime environment

      NPM_CONFIG_LOGLEVEL=error
      NPM_CONFIG_PRODUCTION=true
      NODE_ENV=production
      NODE_MODULES_CACHE=true

-----> Installing binaries engines.node (package.json): 8.0.0 engines.npm (package.json): 5.6.0

      Downloading and installing node 8.0.0...
      Downloading and installing npm 5.6.0 (replacing version 5.0.0)...

-----> Restoring cache Skipping cache restore (new runtime signature) -----> Building dependencies Prebuild detected (node_modules already exists) Rebuilding any native modules

      > websocket@1.0.28 install /tmp/app/node_modules/websocket
      > (node-gyp rebuild 2> builderror.log) || (exit 0)

      make: Entering directory `/tmp/app/node_modules/websocket/build'
      CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
      SOLINK_MODULE(target) Release/obj.target/bufferutil.node
      COPY Release/bufferutil.node
      CXX(target) Release/obj.target/validation/src/validation.o
      SOLINK_MODULE(target) Release/obj.target/validation.node
      COPY Release/validation.node
      make: Leaving directory `/tmp/app/node_modules/websocket/build'

      > ibm_db@2.5.0 install /tmp/app/node_modules/ibm_db
      > node installer/driverInstall.js

      Rebuild Process: Found clidriver at -> /tmp/app/node_modules/ibm_db/installer/clidriver

      Downloading of clidriver skipped - build is in progress...

      make: Entering directory `/tmp/app/node_modules/ibm_db/build'
      CXX(target) Release/obj.target/odbc_bindings/src/odbc.o
      CXX(target) Release/obj.target/odbc_bindings/src/odbc_connection.o
      CXX(target) Release/obj.target/odbc_bindings/src/odbc_statement.o
      CXX(target) Release/obj.target/odbc_bindings/src/odbc_result.o
      SOLINK_MODULE(target) Release/obj.target/odbc_bindings.node
      make: Leaving directory `/tmp/app/node_modules/ibm_db/build'

      { Error: Command failed: node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"
      ../src/odbc.cpp: In static member function ‘static void ODBC::UV_AfterCreateConnection(uv_work_t*, int)’:
      ../src/odbc.cpp:210:27: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call(1, info);
      ^
      ../src/odbc.cpp:222:27: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call(2, info);
      ^
      ../src/odbc.cpp: In static member function ‘static v8::Handle<v8::Value> ODBC::GetColumnValue(SQLHSTMT, Column, uint16_t*, int)’:
      ../src/odbc.cpp:671:78: warning: format ‘%i’ expects argument of type ‘int’, but argument 4 has type ‘long int’ [-Wformat=]
      (long)(hStmt) & 0x0000ffff, (int) column.type, column.index);
      ^
      ../src/odbc.cpp:671:78: warning: format ‘%i’ expects argument of type ‘int’, but argument 5 has type ‘long int’ [-Wformat=]
      ../src/odbc.cpp: In static member function ‘static v8::Local<v8::Value> ODBC::CallbackSQLError(SQLSMALLINT, SQLHANDLE, char*, Nan::Callback*)’:
      ../src/odbc.cpp:1194:19: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      cb->Call(1, info);
      ^
      ../src/odbc_connection.cpp: In static member function ‘static void ODBCConnection::UV_AfterOpen(uv_work_t*, int)’:
      ../src/odbc_connection.cpp:318:35: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call(err ? 1 : 0, argv);
      ^
      ../src/odbc_connection.cpp: In static member function ‘static void ODBCConnection::UV_AfterClose(uv_work_t*, int)’:
      ../src/odbc_connection.cpp:547:35: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call(err ? 1 : 0, argv);
      ^
      ../src/odbc_connection.cpp: In static member function ‘static void ODBCConnection::UV_AfterCreateStatement(uv_work_t*, int)’:
      ../src/odbc_connection.cpp:960:26: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call( 2, info);
      ^
      ../src/odbc_connection.cpp: In static member function ‘static void ODBCConnection::UV_AfterQuery(uv_work_t*, int)’:
      ../src/odbc_connection.cpp:1189:27: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call(2, info);
      ^
      ../src/odbc_connection.cpp:1216:27: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call(3, info);
      ^
      ../src/odbc_connection.cpp: In static member function ‘static void ODBCConnection::UV_AfterBeginTransaction(uv_work_t*, int)’:
      ../src/odbc_connection.cpp:1809:36: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call( err ? 1 : 0, argv);
      ^
      ../src/odbc_connection.cpp: In static member function ‘static void ODBCConnection::UV_AfterEndTransaction(uv_work_t*, int)’:
      ../src/odbc_connection.cpp:1991:35: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call(err ? 1 : 0, argv);
      ^
      ../src/odbc_statement.cpp: In static member function ‘static void ODBCStatement::UV_AfterExecute(uv_work_t*, int)’:
      ../src/odbc_statement.cpp:241:27: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call(3, info);
      ^
      ../src/odbc_statement.cpp: In static member function ‘static void ODBCStatement::UV_AfterExecuteNonQuery(uv_work_t*, int)’:
      ../src/odbc_statement.cpp:406:63: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1633) [-Wdeprecated-declarations]
      data->cb->Call(Nan::GetCurrentContext()->Global(), 2, info);
      ^
      ../src/odbc_statement.cpp: In static member function ‘static void ODBCStatement::UV_AfterExecuteDirect(uv_work_t*, int)’:
      ../src/odbc_statement.cpp:565:27: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call(2, info);
      ^
      ../src/odbc_statement.cpp: In static member function ‘static void ODBCStatement::UV_AfterPrepare(uv_work_t*, int)’:
      ../src/odbc_statement.cpp:791:28: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call( 2, info);
      ^
      ../src/odbc_statement.cpp: In static member function ‘static void ODBCStatement::UV_AfterBind(uv_work_t*, int)’:
      ../src/odbc_statement.cpp:962:28: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call( 2, info);
      ^
      ../src/odbc_result.cpp: In static member function ‘static void ODBCResult::UV_AfterFetch(uv_work_t*, int)’:
      ../src/odbc_result.cpp:288:27: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call(2, info);
      ^
      ../src/odbc_result.cpp:312:27: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call(2, info);
      ^
      ../src/odbc_result.cpp: In static member function ‘static void ODBCResult::UV_AfterFetchAll(uv_work_t*, int)’:
      ../src/odbc_result.cpp:596:27: warning: ‘v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const’ is deprecated (declared at ../../nan/nan.h:1655) [-Wdeprecated-declarations]
      data->cb->Call(3, info);
      ^
      /usr/bin/ld: cannot find -ldb2
      collect2: error: ld returned 1 exit status
      make: *** [Release/obj.target/odbc_bindings.node] Error 1
      gyp ERR! build error
      gyp ERR! stack Error: `make` failed with exit code: 2
      gyp ERR! stack     at ChildProcess.onExit (/tmp/app/vendor/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
      gyp ERR! stack     at emitTwo (events.js:125:13)
      gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
      gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
      gyp ERR! System Linux 4.15.0-33-generic
      gyp ERR! command "/tmp/app/vendor/node/bin/node" "/tmp/app/vendor/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IS_DOWNLOADED=true" "--IBM_DB_HOME=/tmp/app/node_modules/ibm_db/installer/clidriver"
      gyp ERR! cwd /tmp/app/node_modules/ibm_db
      gyp ERR! node -v v8.0.0
      gyp ERR! node-gyp -v v3.6.2
      gyp ERR! not ok

      at ChildProcess.exithandler (child_process.js:252:12)
      at emitTwo (events.js:125:13)
      at ChildProcess.emit (events.js:213:7)
      at maybeClose (internal/child_process.js:887:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
      killed: false,
      code: 1,
      signal: null,
      cmd: 'node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"' }
      npm ERR! code ELIFECYCLE
      npm ERR! errno 1
      npm ERR! ibm_db@2.5.0 install: `node installer/driverInstall.js`
      npm ERR! Exit status 1
      npm ERR!
      npm ERR! Failed at the ibm_db@2.5.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!     /home/vcap/.npm/_logs/2018-12-19T21_47_55_611Z-debug.log

-----> Build failed

      Some possible problems:

      - node_modules checked into source control
      http://docs.cloudfoundry.org/buildpacks/node/node-tips.html

Failed to compile droplet: Failed to compile droplet: exit status 1 Exit status 223 Cell a16c6bd8-5094-471f-ac60-8a9a32c71bec stopping instance 2cbea384-f767-4274-80a4-cf2f35e833e3 Cell a16c6bd8-5094-471f-ac60-8a9a32c71bec destroying container for instance 2cbea384-f767-4274-80a4-cf2f35e833e3 FAILED Error staging application: App staging failed in the buildpack compile phase

Finished: FAILED`

This happens only when the package ibm_db is included on the deploy. Locally it works flawless... Thanks in advance.

Package

    "engines": {
        "node": "8.x",
        "npm": "5.x"
    }

    "dependencies": {
        "body-parser": "^1.18.3",
        "botkit": "^0.7.0",
        "botkit-middleware-watson": "^1.7.1",
        "cfenv": "latest",
        "dotenv": "^6.0.0",
        "express": "^4.16.3",
        "ibm_db": "^2.5.0"
    }
}
feotCopernicaiser commented 5 years ago

Closing this. the problem was the ibm_db needs to be installed but the installer/clidriver folder need to be removed before pushing. After that deploy went successfully