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

Library not loaded? #44

Closed MikeFielden closed 8 years ago

MikeFielden commented 8 years ago

I have followed the instructions but cannot seem to get this working. The error I get is:

Error: dlopen(LOCAL_MODULE_PATH/node_modules/strong-oracle/build/Release/oracle_bindings.node, 1): Library not loaded: /ade/b/3071542110/oracle/rdbms/lib/libocci.dylib.11.1 Referenced from: LOCAL_MODULE_PATH/node_modules/strong-oracle/build/Release/oracle_bindings.node Reason: image not found 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> (LOCAL_MODULE_PATH/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)

The relevant part, i think is, 1): Library not loaded: /ade/b/3071542110/oracle/rdbms/lib/libocci.dylib.11.1

The path to the instantclient is /opt/oracle/instantclient/

I have set the env to { OCI_INCLUDE_DIR: '/opt/oracle/instantclient/sdk/include', OCI_HOME: '/opt/oracle/instantclient/', DYLD_LIBRARY_PATH: '/opt/oracle/instantclient/', OCI_LIB_DIR: '/opt/oracle/instantclient/', }

screen shot 2015-08-05 at 9 03 46 am

Everything looks right but I cannot seem to get past that error.

kathan commented 8 years ago

Do you have a folder /ade/b/3071542110/oracle/rdbms containing a symbolic link called lib that points to /opt/oracle/instantclient/? If not, that could be what you're missing.

MikeFielden commented 8 years ago

Yeah I obviously dont. Nor did I tell it to look there :) How/What/Where is it supposed to be looking and how do I change that?

kathan commented 8 years ago

It's been a while since I've needed to do this but I believe this should help you:

This will create the directory sudo mkdir -p /ade/b/3071542110/oracle/rdbms Move to the directory you just created - cd /ade/b/3071542110/oracle/rdbms Make a link to the instant client directory - sudo ln -s /opt/oracle/instantclient lib

FYI, you may encounter another similar issue regarding LDAP.

MikeFielden commented 8 years ago

It looks like that will work however it is basically going file for file saying Library Not Loaded.... So I think this isnt a great fix. Any idea why its looking in that folder in the first place?

kathan commented 8 years ago

Are you getting another error? AFAIK, that path is hard coded into the Oracle instant client.

MikeFielden commented 8 years ago

Error now is: 1): Library not loaded: /ade/b/3071542110/oracle/rdbms/lib/libclntsh.dylib.11.1 and when I do the same thing on that one I get the next error: 1): Library not loaded: /ade/dosulliv_ldapmac/oracle/ldap/lib/libnnz11.dylib and so on...

My symlink format is sudo ln -s /opt/oracle/instantclient/libclntsh.dylib.11.1 /ade/b/3071542110/oracle/rdbms/lib

I mean that is right but is there a faster way?

kathan commented 8 years ago

Sorry, that might be on me. I looked at the script I used to do my setup and it's slightly different. My script looks like this: sudo mkdir -p /ade/b/3071542110/oracle/rdbms/lib/ cd /ade/b/3071542110/oracle/rdbms/lib/ sudo ln -s /opt/oracle/instantclient/libclntsh.dylib.11.1 libclntsh.dylib.11.1

raymondfeng commented 8 years ago

Did you strictly follow the instructions at https://github.com/strongloop/strong-oracle?

Please note /ade/b/3071542110/oracle/rdbms is an internal name used in the Oracle dynamic lib. It's not a physical dir on the file system. Do not try to fiddle around it.

MikeFielden commented 8 years ago

Yes @raymondfeng I have followed the instructions several times. I always get to the same dlopen issue. Believe me I dont want to fiddle around with anything. :) Id just like for it to work. So whatever help you can provide would be much appreciated.

raymondfeng commented 8 years ago

The key is that you have to make sure DYLD_LIBRARY_PATH is effective in your shell. For example, you can export DYLD_LIBRARY_PATH in ~/.bash_profile as follows:

export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/opt/oracle/instantclient/"

And run source ~/.bash_profile or logout and login again.

MikeFielden commented 8 years ago

^ that.

ganeshchand commented 8 years ago

Is this resolved? I am stuck with this error.

ibre5041 commented 8 years ago

See this solution: https://github.com/kubo/fix_oralib_osx

cjbj commented 8 years ago

Also check the solution @raymondfeng found so you don't need to modify the libraries https://github.com/oracle/node-oracledb/issues/149#issuecomment-170711705

MikeFielden commented 8 years ago

@ganeshchand I find that just running with the env mapped to the path of the DYLD library is the route of least friction.