strongloop / strong-oracle

Deprecated: Node.js Driver for Oracle databases (Use https://github.com/oracle/node-oracledb instead)
Other
45 stars 18 forks source link

Error: dlopen / Expected in: dynamic lookup #37

Closed CollinEstes closed 9 years ago

CollinEstes commented 9 years ago

I was able to successfully run my integration test with strong-oracle just yesterday, now I'm getting an error that makes me think my environment changed and is causing a problem but I can't track down what it is. Here is my enviornment varables and the error being thrown.

> process.env
{ OCI_INCLUDE_DIR: '/opt/oracle/instantclient/sdk/include',
  TERM_PROGRAM: 'iTerm.app',
  SHELL: '/bin/bash',
  TERM: 'xterm-256color',
  TMPDIR: '/var/folders/j2/v06_095s5kb_l6hyqcjpxq380000gn/T/',
  Apple_PubSub_Socket_Render: '/private/tmp/com.apple.launchd.LnjUof5CfO/Render',
  OCI_HOME: '/opt/oracle/instantclient/',
  USER: 'collinestes',
  SSH_AUTH_SOCK: '/private/tmp/com.apple.launchd.BAGRSMn8hb/Listeners',
  __CF_USER_TEXT_ENCODING: '0x1F5:0x0:0x0',
  DLYD_LIBRARY_PATH: '/opt/oracle/instantclient/',
  PATH: '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
  PWD: '/Users/collinestes',
  LANG: 'en_US.UTF-8',
  ITERM_PROFILE: 'Default',
  XPC_FLAGS: '0x0',
  XPC_SERVICE_NAME: '0',
  SHLVL: '1',
  COLORFGBG: '7;0',
  HOME: '/Users/collinestes',
  ITERM_SESSION_ID: 'w0t0p0',
  LOGNAME: 'collinestes',
  OCI_LIB_DIR: '/opt/oracle/instantclient/',
  _: '/usr/local/bin/node' }
> require('/Users/collinestes/work/node/mdt_oracle/integrationSpec.js');
Error: dlopen(/Users/collinestes/work/node/mdt_oracle/node_modules/strong-oracle/build/Release/oracle_bindings.node, 1): Symbol not found: __ZTIN6oracle4occi12SQLExceptionE
  Referenced from: /Users/collinestes/work/node/mdt_oracle/node_modules/strong-oracle/build/Release/oracle_bindings.node
  Expected in: dynamic lookup

    at Error (native)
    at Module.load (module.js:351:32)
    at Function.Module._load (module.js:306:12)
    at Module.require (module.js:361:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/collinestes/work/node/mdt_oracle/node_modules/strong-oracle/lib/oracle.js:11:14)
    at Module._compile (module.js:426:26)
    at Object.Module._extensions..js (module.js:444:10)
    at Module.load (module.js:351:32)
    at Function.Module._load (module.js:306:12)
>
raymondfeng commented 9 years ago

Is the env var correct? DLYD_LIBRARY_PATH: '/opt/oracle/instantclient/'?

CollinEstes commented 9 years ago

I believe so, it is to the unzip'd instant client libraries.

Collins-MacBook-Pro:~ collinestes$ cd $DLYD_LIBRARY_PATH
Collins-MacBook-Pro:instantclient collinestes$ ls
BASIC_README        libclntsh.dylib     libnnz11.dylib      libocci.so      ojdbc5.jar      uidrvci
adrci           libclntsh.dylib.11.1    libocci.dylib       libociei.dylib      ojdbc6.jar      xstreams.jar
genezi          libclntsh.so        libocci.dylib.11.1  libocijdbc11.dylib  sdk
Collins-MacBook-Pro:instantclient collinestes$
CollinEstes commented 9 years ago

I have those set in my ~/.bash_profile file:

export OCI_HOME=/opt/oracle/instantclient/
export OCI_LIB_DIR=/opt/oracle/instantclient/
export OCI_INCLUDE_DIR=/opt/oracle/instantclient/sdk/include
export DLYD_LIBRARY_PATH=/opt/oracle/instantclient/
raymondfeng commented 9 years ago

Did you create symbolic links per https://github.com/strongloop/strong-oracle?

CollinEstes commented 9 years ago

Yes I have:

Collins-MacBook-Pro:~ collinestes$ cd $OCI_LIB_DIR
Collins-MacBook-Pro:instantclient collinestes$ ln -s libclntsh.dylib.11.1 libclntsh.dylib
ln: libclntsh.dylib: File exists
Collins-MacBook-Pro:instantclient collinestes$ ln -s libocci.dylib.11.1 libocci.dylib
ln: libocci.dylib: File exists
bnoordhuis commented 9 years ago

What does nm libocci.dylib | grep -w __ZTIN6oracle4occi12SQLExceptionE print?

CollinEstes commented 9 years ago

Looks like a problem:

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm: can't open file: libocci.dylib (No such file or directory)
CollinEstes commented 9 years ago

What is extra strange is I wrote an integration test and it ran, now I'm stuck on that error.

raymondfeng commented 9 years ago

I see the following files under oracle instant client. Please note I have libocci.dylib -> libocci.dylib.11.1.

-rw-rw-rw-@  1 rfeng  staff        484 Feb 15  2013 BASIC_README
-rwxrwxrwx@  1 rfeng  staff      10252 Feb 15  2013 adrci
-rwxrwxrwx@  1 rfeng  staff      40768 Feb 15  2013 genezi
lrwxr-xr-x   1 rfeng  staff         20 Feb  9  2014 libclntsh.dylib -> libclntsh.dylib.11.1
-rwxrwxrwx@  1 rfeng  staff   64771444 Dec 19  2012 libclntsh.dylib.11.1
-rwxrwxrwx@  1 rfeng  staff    2808528 Feb 15  2013 libnnz11.dylib
lrwxr-xr-x   1 rfeng  staff         18 Feb  9  2014 libocci.dylib -> libocci.dylib.11.1
-rwxrwxrwx@  1 rfeng  staff    1897664 Dec 19  2012 libocci.dylib.11.1
-rwxrwxrwx@  1 rfeng  staff  118379468 Feb 15  2013 libociei.dylib
-rwxrwxrwx@  1 rfeng  staff     158924 Dec 19  2012 libocijdbc11.dylib
-rw-rw-rw-@  1 rfeng  staff    2095661 May 29  2012 ojdbc5.jar
-rw-rw-rw-@  1 rfeng  staff    2714016 May 29  2012 ojdbc6.jar
drwxrwxrwx@  7 rfeng  staff        238 Feb  9  2014 sdk
-rwxrwxrwx@  1 rfeng  staff     162324 Feb 15  2013 uidrvci
-rw-rw-rw-@  1 rfeng  staff      66779 Dec 19  2012 xstreams.jar
CollinEstes commented 9 years ago

I just went all the way back through the install process, and I got the following error now:

  Reason: no suitable image found.  Did find:
    /opt/instantclient/libocci.dylib.11.1: mach-o, but wrong architecture

I then went back into my project and did an 'npm install strong-oracle' which succeeded (although with a couple errors:

XX(target) Release/obj.target/oracle_bindings/src/connection.o
../src/connection.cpp:151:11: warning: 'FatalException' is deprecated: Use FatalException(isolate, ...) [-Wdeprecated-declarations]
    node::FatalException(tryCatch);
          ^
/var/folders/1b/sfc4sf6j3vz0rqp70przm0wr312_ty/T/.node-gyp/2.3.1/src/node.h:283:29: note: 'FatalException' has been explicitly marked deprecated
      here
                inline void FatalException(const v8::TryCatch& try_catch) {
                            ^
/var/folders/1b/sfc4sf6j3vz0rqp70przm0wr312_ty/T/.node-gyp/2.3.1/src/node.h:66:42: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                                         ^
../src/connection.cpp:263:11: warning: 'FatalException' is deprecated: Use FatalException(isolate, ...) [-Wdeprecated-declarations]
    node::FatalException(tryCatch);
          ^
/var/folders/1b/sfc4sf6j3vz0rqp70przm0wr312_ty/T/.node-gyp/2.3.1/src/node.h:283:29: note: 'FatalException' has been explicitly marked deprecated
      here
                inline void FatalException(const v8::TryCatch& try_catch) {
                            ^
/var/folders/1b/sfc4sf6j3vz0rqp70przm0wr312_ty/T/.node-gyp/2.3.1/src/node.h:66:42: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                                         ^
../src/connection.cpp:803:11: warning: 'FatalException' is deprecated: Use FatalException(isolate, ...) [-Wdeprecated-declarations]
    node::FatalException(tryCatch);
          ^
/var/folders/1b/sfc4sf6j3vz0rqp70przm0wr312_ty/T/.node-gyp/2.3.1/src/node.h:283:29: note: 'FatalException' has been explicitly marked deprecated
      here
                inline void FatalException(const v8::TryCatch& try_catch) {
                            ^
/var/folders/1b/sfc4sf6j3vz0rqp70przm0wr312_ty/T/.node-gyp/2.3.1/src/node.h:66:42: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                                         ^
../src/connection.cpp:873:11: warning: 'FatalException' is deprecated: Use FatalException(isolate, ...) [-Wdeprecated-declarations]
    node::FatalException(tryCatch);
          ^
/var/folders/1b/sfc4sf6j3vz0rqp70przm0wr312_ty/T/.node-gyp/2.3.1/src/node.h:283:29: note: 'FatalException' has been explicitly marked deprecated
      here
                inline void FatalException(const v8::TryCatch& try_catch) {
                            ^
/var/folders/1b/sfc4sf6j3vz0rqp70przm0wr312_ty/T/.node-gyp/2.3.1/src/node.h:66:42: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                                         ^
4 warnings generated.
  CXX(target) Release/obj.target/oracle_bindings/src/oracle_bindings.o
../src/oracle_bindings.cpp:167:11: warning: 'FatalException' is deprecated: Use FatalException(isolate, ...) [-Wdeprecated-declarations]
    node::FatalException(tryCatch);
          ^
/var/folders/1b/sfc4sf6j3vz0rqp70przm0wr312_ty/T/.node-gyp/2.3.1/src/node.h:283:29: note: 'FatalException' has been explicitly marked deprecated
      here
                inline void FatalException(const v8::TryCatch& try_catch) {
                            ^
/var/folders/1b/sfc4sf6j3vz0rqp70przm0wr312_ty/T/.node-gyp/2.3.1/src/node.h:66:42: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator
                                         ^
../src/oracle_bindings.cpp:351:11: warning: 'FatalException' is deprecated: Use FatalException(isolate, ...) [-Wdeprecated-declarations]
    node::FatalException(tryCatch);
          ^
/var/folders/1b/sfc4sf6j3vz0rqp70przm0wr312_ty/T/.node-gyp/2.3.1/src/node.h:283:29: note: 'FatalException' has been explicitly marked deprecated
      here
                inline void FatalException(const v8::TryCatch& try_catch) {
                            ^
/var/folders/1b/sfc4sf6j3vz0rqp70przm0wr312_ty/T/.node-gyp/2.3.1/src/node.h:66:42: note: expanded from macro 'NODE_DEPRECATED'
    __attribute__((deprecated(message))) declarator

Then my error changed back to the same as above, after I had reinstalled strong-oracle.

CollinEstes commented 9 years ago

I'm on osx. And I downloaded the OSX specific binaries from oracle

raymondfeng commented 9 years ago

Is your Mac 64 bit?

CollinEstes commented 9 years ago

yes it is, my processor: 2.9 GHz Intel Core i5

CollinEstes commented 9 years ago

i am running io.js

cjbj commented 9 years ago

Reason: no suitable image found. Did find: /opt/instantclient/libocci.dylib.11.1: mach-o, but wrong architecture

Did you get the Intel 64bit Instant Client, not the PPC one?

CollinEstes commented 9 years ago

I got this one:

Instant Client Downloads for Mac OS X (Intel x86)

Should I get the PPC version? I'm assuming I need the intel x86.

bnoordhuis commented 9 years ago

The x86 version is the right one but make sure you get the 64 bits download, i.e. http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html or http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html.

CollinEstes commented 9 years ago

I bet that is it! I think I pulled 32 bit...

I'll confirm...

CollinEstes commented 9 years ago

That was it. Thanks everyone. Sorry I was careless with the download page...

enxtur commented 8 years ago

i was download wrong architecture too, this saved my life :P

faridblaster commented 8 years ago

guys, i have this error after doing this command:

=>What does nm libocci.dylib | grep -w __ZTIN6oracle4occi12SQLExceptionE print?

00000000001334e0 S __ZTIN6oracle4occi12SQLExceptionE

bnoordhuis commented 8 years ago

@faridblaster Can you file a new issue? Please include the exact output from the npm install step, the verbatim error message and the output of uname -a and node -p process.versions. Thanks.