vtulluru / node-red-contrib-oracledb-mod

MIT License
4 stars 9 forks source link

Dockerized Node-red unable to load libnnz21.so #8

Closed yayitazale closed 1 year ago

yayitazale commented 2 years ago

I have installed the Instant Client Basic in the host server and shared the folder path with the node-red container but I get this error:

Oracle-server error connection to oracle12.tns: DPI-1047: Cannot locate a 64-bit Oracle Client library: "Error loading shared library libnnz21.so: No such file or directory (needed by /data/files/Oracle/instantclient_21_5/libclntsh.so)". See https://oracle.github.io/node-oracledb/INSTALL.html for help
Node-oracledb installation instructions: https://oracle.github.io/node-oracledb/INSTALL.html
You must have 64-bit Oracle Client libraries configured with ldconfig, or in LD_LIBRARY_PATH.
If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from 
https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html

The install path is mounted under the path _/data/files/Oracle/instantclient_215 so that's the folder defined on the config node.

Node-oracledb is installed on both host and container and LD_LIBRARY_PATH is set to its path on both host and container.

What I'm doing wrong?

Thanks

recursivecodes commented 2 years ago

Can you open a shell in the container and echo $LD_LIBRARY_PATH and make sure that the var exists and points to a valid path in the container?

recursivecodes commented 2 years ago

You might also have a look at one of the pre-built images that have instant client to compare to your Dockerfile:

https://github.com/oracle/docker-images/tree/main/OracleInstantClient

yayitazale commented 2 years ago

Can you open a shell in the container and echo $LD_LIBRARY_PATH and make sure that the var exists and points to a valid path in the container?

Var exists and points to the installation path and it doesn't work.

yayitazale commented 1 year ago

I am answering myself in case the solution I have found is useful to someone else. Installing the "oracleinstantclient" on a linux host is not working as there are some components missing.

To avoid this you should use this dockerfile https://github.com/RyuunosukeDS3/node-red-docker-oracle/blob/main/Dockerfile.custom and build your own image witch will install the oracle client itself and the missing "libaio" && "libaio libnsl libc6-compat" inside the container. Then it will automatically add the ENV /lib to the container so in node-red, in the "Instant Client Path" you should add something like: /lib/instantclient_21_10 but changing the name to the latest version available at https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html

Then you should be able to connect to the oracleDB.