ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
192 stars 150 forks source link

osx 10.14.2 - failed install (dyld: Library not loaded: /usr/local/lib/libwep #500

Closed kevindashgit closed 5 years ago

kevindashgit commented 5 years ago

Here's the full output:

❯ npm i ibm_db

> ibm_db@2.5.0 install /Users/<username>/temp/ibm_db_try/node_modules/ibm_db
> node installer/driverInstall.js

Downloading DB2 ODBC CLI Driver from https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz...

100.00% | 20080158 bytes downloaded out of 20080158 bytes.

****************************************
You are downloading a package which includes the Node.js module for IBM DB2/Informix.  The module is licensed under the Apache License 2.0. The package also includes IBM ODBC and CLI Driver from I
BM, which is automatically downloaded as the node module is installed on your system/device. The license agreement to the IBM ODBC and CLI Driver is available in undefined   Check for additional d
ependencies, which may come with their own license agreement(s). Your use of the components of the package and dependencies constitutes your acceptance of their respective license agreements. If y
ou do not accept the terms of any license agreement(s), then delete the relevant component(s) from your device.
****************************************

Downloading and extraction of DB2 ODBC CLI Driver completed successfully ...

  CXX(target) Release/obj.target/odbc_bindings/src/odbc.o

{ Error: Command failed: node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"
dyld: Library not loaded: /usr/local/lib/libwep
  Referenced from: /usr/bin/c++
  Reason: no suitable image found.  Did find:
        /usr/local/lib/libwep: code signature in (/usr/local/lib/libwep) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at le
ast ad-hoc signed.
        /usr/local/lib/libwep: stat() failed with errno=1
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Abort trap: 6
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/<username>/.nvm/versions/node/v6.14.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/Users/<username>/.nvm/versions/node/v6.14.2/bin/node" "/Users/<username>/.nvm/versions/node/v6.14.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configur
e" "build" "--IS_DOWNLOADED=true" "--IBM_DB_HOME=/Users/<username>/temp/ibm_db_try/node_modules/ibm_db/installer/clidriver"
gyp ERR! cwd /Users/<username>/temp/ibm_db_try/node_modules/ibm_db
gyp ERR! node -v v6.14.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

    at ChildProcess.exithandler (child_process.js:199:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:920:16)
    at Socket.<anonymous> (internal/child_process.js:351:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:509:12)
  killed: false,
  code: 1,
  signal: null,
  cmd: 'node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"' }
npm WARN ibm_db_try@1.0.0 No description
npm WARN ibm_db_try@1.0.0 No repository field.

I tried a number of things that I found online:

What else should I try? Is there a way to get more information? Or maybe someone will hit me over the head with the obvious answer :)

bimalkjha commented 5 years ago

@kevindashgit Here is the main error: dyld: Library not loaded: /usr/local/lib/libwep You can check result of otool -L /usr/local/lib/libwep to find out any missing dependent library. You many install the latest version of WebP from here: https://developers.google.com/speed/webp/download Thanks.

kevindashgit commented 5 years ago

thanks @bimalkjha for your reply.

You can check result of otool -L /usr/local/lib/libwep to find out any missing dependent library.

❯ otool -L /usr/local/lib/libwep
/usr/local/lib/libwep:
        /usr/local/lib/libwep (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

Also, looks like I'm not the only one running into this - and it makes sense - after I upgraded to OSX Mojave is about when I started hitting this.

I tried installing latest via homebrew but looks like I'm gonna have to figure out how to get the downloaded version as you suggested. I did notice that the downloaded version indicates mac-10.13 -- whereas I'm on Mojave 10.14. Maybe I'm SOL for now?

cjwhitsitt commented 5 years ago

It looks like libwep actually comes from Websense (aka Forcepoint or Triton AP Endpoint). It's injected into processes to enforce some security and proxy settings.

https://ftiff.wordpress.com/2016/04/01/triton-ap-endpoint-on-os-x/

@kevindashgit, did you ever get past the issue?

kevindashgit commented 5 years ago

I did not :(

I do have Forcepoint running though! Do you think this could be the culprit?

bimalkjha commented 5 years ago

@kevindashgit Here is complete error:

dyld: Library not loaded: /usr/local/lib/libwep
  Referenced from: /usr/bin/c++
  Reason: no suitable image found.  Did find:
   /usr/local/lib/libwep: code signature in (/usr/local/lib/libwep) not valid for use in 
process using Library Validation: mapped file has no cdhash, completely unsigned? Code has 
to be at least ad-hoc signed.
        /usr/local/lib/libwep: stat() failed with errno=1
make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Abort trap: 6
gyp ERR! build error

Error also mentioned that your node.js version is v6.14.2. Could you upgrade your node to v10.x or v11.x and try? You should check these links too which mentioned similar issue related to ad-hoc sign: https://apple.stackexchange.com/questions/288291/what-are-the-restrictions-of-ad-hoc-code-signing https://forums.developer.apple.com/thread/109182 Thanks.

kevindashgit commented 5 years ago

10.x / 11.x both yield the same results.

Downloading and extraction of DB2 ODBC CLI Driver completed successfully ...

CXX(target) Release/obj.target/odbc_bindings/src/odbc.o

{ Error: Command failed: node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"
dyld: Library not loaded: /usr/local/lib/libwep
        Referenced from: /usr/bin/c++
        Reason: no suitable image found.  Did find:
        /usr/local/lib/libwep: code signature in (/usr/local/lib/libwep) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
        /usr/local/lib/libwep: stat() failed with errno=1
        make: *** [Release/obj.target/odbc_bindings/src/odbc.o] Abort trap: 6
        gyp ERR! build error
        gyp ERR! stack Error: `make` failed with exit code: 2
        gyp ERR! stack     at ChildProcess.onExit (/Users/username/.nvm/versions/node/v11.9.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
        gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
        gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
        gyp ERR! System Darwin 18.2.0
        gyp ERR! command "/Users/username/.nvm/versions/node/v11.9.0/bin/node" "/Users/username/.nvm/versions/node/v11.9.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" "--IS_DOWNLOADED=true" "--IBM_DB_HOME=/Users/username/temp/try-db2/node_modules/ibm_db2/installer/clidriver"
        gyp ERR! cwd /Users/username/temp/try-db2/node_modules/ibm_db2
        gyp ERR! node -v v11.9.0
        gyp ERR! node-gyp -v v3.8.0
        gyp ERR! not ok

        at ChildProcess.exithandler (child_process.js:297:12)
        at ChildProcess.emit (events.js:197:13)
        at maybeClose (internal/child_process.js:978:16)
        at Socket.stream.socket.on (internal/child_process.js:395:11)
        at Socket.emit (events.js:197:13)
        at Pipe._handle.close (net.js:611:12)
        killed: false,
        code: 1,
        signal: null,
        cmd:
          'node-gyp configure build  --IS_DOWNLOADED=true --IBM_DB_HOME="$IBM_DB_HOME"' }
          npm WARN try-db2@1.0.0 No description
          npm WARN try-db2@1.0.0 No repository field.

          npm ERR! code ELIFECYCLE
          npm ERR! errno 1
          npm ERR! ibm_db2@3.0.0 install: `node installer/driverInstall.js`
          npm ERR! Exit status 1
          npm ERR!
          npm ERR! Failed at the ibm_db2@3.0.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!     /Users/username/.npm/_logs/2019-02-06T20_06_34_019Z-debug.log
          ...
bimalkjha commented 5 years ago

@kevindashgit This issue is related to xcode and /usr/local/lib/libwep which is used to compile C++ code of ibm_db on MacOS. Its OS upgrade issue and I do not see any issue with ibm_db code here. On apple support site, other users has also reported similar problem after OS upgrade. Thanks.

kevindashgit commented 5 years ago

@bimalkjha I'm inclined to agree with you assessment. Just trying to rule out anything else.

To that end, @cjwhitsitt I was able to disable Forcepoint and attempt to re-install (log here) to no avail 😭