Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: DPI-1047 ... libnsl.so.1: errno: symbol not found #1245

Closed
mhechthz opened this issue Apr 30, 2020 · 20 comments
Closed

Error: DPI-1047 ... libnsl.so.1: errno: symbol not found #1245

mhechthz opened this issue Apr 30, 2020 · 20 comments

Comments

@mhechthz
Copy link

mhechthz commented Apr 30, 2020

Hi,

I use nodere-node-contrib-oracledb-mod inside the nodered docker container. Installation of oracle was tricky, but finally seemed to work. Than I got errors of missing libraries libnsl, libaio, libresolv and ld-linux-x86-64. So I copied all from /lib/x86_64-linux-gnu to a local subdirectory. The local subdirectory is reachable from docker.

As I try to connect now I get the following:
Error: DPI-1047: Cannot locate a 64-bit Oracle Client library: "Error relocating /data/ora/instantclient_19_5/libnsl.so.1: errno: symbol not found". See https://oracle.github.io/odpi/doc/installation.html#linux for helpNode-oracledb installation instructions: https://oracle.github.io/node-oracledb/INSTALL.htmlYou must have 64-bit Oracle client libraries in LD_LIBRARY_PATH, or configured with ldconfig.If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
As far as I now, docker uses the system libraries, so regardless of copying them to a different directory, it should work. Inside the docker container the libraries are not installed. So I have no other libraries available. My version e.g. for libnsl is libnsl-2.27.so (checked also 2.26 and 2.31). I'm using oracledb4.2.0.

What can I do now?

@cjbj
Copy link
Member

cjbj commented May 1, 2020

What's the container OS and the the OS version used by nodered?

Don't manually copy files around. Just install the necessary OS packages using the OS package management system

For the specific error you gave, make sure the 'libnsl' package is installed in the container. E.g on Oracle Linux you could run yum install -y libaio libnsl in your Dockerfile.

Review Using node-oracledb in Docker and Docker for Oracle Database Applications in Node.js and Python.

@mhechthz
Copy link
Author

mhechthz commented May 1, 2020

This is the Docker file:

https://github.com/node-red/node-red-docker/blob/master/.docker/Dockerfile.alpine

There is no yum or apt-get. I managed to run wget and unzip insid the container to provide oracle and I managed to hand over the ORACLE_HOME and GL_LIBRARY_PATH. The only thing missing are the 4 libraries. It should be not so hard to provide appropriate files in a subdirectory instead of buildin an entire new Cocker-File (which I never did before and think will take a long time). The host system is Ubuntu 18.04.

@mhechthz
Copy link
Author

mhechthz commented May 1, 2020

Meanwhile I provided the glibc-libraries of alpine to the container. What I now get is the following:
Error: DPI-1047: Cannot locate a 64-bit Oracle Client library: "Error relocating /data/apkpack/usr/lib/libnsl.so.1: __asprintf: symbol not found". See https://oracle.github.io/odpi/doc/installation.html#linux for helpNode-oracledb installation instructions: https://oracle.github.io/node-oracledb/INSTALL.htmlYou must have 64-bit Oracle client libraries in LD_LIBRARY_PATH, or configured with ldconfig.If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
The LD_LIBRARY_PATH is /lib:/usr/lib:/data/ora/instantclient_19_5:/data/apkpack/usr/lib. All nessary files are in LD_LIBRARY_PATH and asprintf is in /lib/ld-musl-x86_64.so.1. This is what is required by libnsl.so.1 (ldd libnsl.so.1 output ... /lib/ld-musl-x68_64.so.1 ...).

There are comparable dicsussions here: sgerrand/alpine-pkg-glibc#13 (where I couldn't find a solution).

Probably oracledb will not work inside docker.

@cjbj
Copy link
Member

cjbj commented May 2, 2020

Alpine? I'll have to let you Google & sort that out yourself.

I'd recommend using a supported OS that isn't going to give you installation or runtime grief.

@cjbj cjbj closed this as completed May 2, 2020
@mhechthz
Copy link
Author

mhechthz commented May 2, 2020

Well, its the official node-red docker container https://nodered.org/docs/getting-started/docker.

Ok, maybe I try a little bit more to get it running. If I have any news, I let you know.

@abanoubEssam
Copy link

any one have the answer ?

@Adhikaripr
Copy link

Any update on this, in facing the same issue

@cjbj
Copy link
Member

cjbj commented May 8, 2023

When node-oracledb 6.0 is released, you could try it's default Thin mode, since that won't need Instant Client which seems to be your problem. Or try x64

@sosoba
Copy link

sosoba commented May 8, 2023

When node-oracledb 6.0 is released, you could try it's default Thin mode

Is there already more code publicly available than

"version": "6.0.0-dev",
?

@cjbj
Copy link
Member

cjbj commented May 8, 2023

@sosoba I appreciate the eagerness. All the public code is .... public.

@Adhikaripr
Copy link

Alpine? I'll have to let you Google & sort that out yourself.

I'd recommend using a supported OS that isn't going to give you installation or runtime grief.

Is there supported OS for ppc64le? I am also getting same libnsl.so.1 not found error.

@yasirharis
Copy link

@cjbj I tried 6.0.0-dev thin mode in alpine:13.4.2

node_modules/oracle_db/build/Release:
oracledb.node

simple js scripts:
const cas = require('oracledb'); console.warn(cas.oracleClientVersion); console.warn(cas.oracleClientVersionString);

output:
Segmentation fault

are there any missing things?

@sharadraju
Copy link
Member

sharadraju commented May 9, 2023

@yasirharis The thin mode is not yet out.
The code that you see on Github does not include the code for thin mode, but some extra functionalities that will be used by the upcoming node-oracledb version.
The Thin mode will not require the binary file oracledb.node when it is released.

So please wait until the new version of node-oracledb is officially released.

@Adhikaripr
Copy link

anyone has solution for the libnsl.so.1, i tried
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories &&
apk add --update libaio libnsl &&
ln -s /usr/lib/libnsl.so.2 /usr/lib/libnsl.so.1 but still it's not working.

@yasirharis
Copy link

yasirharis commented May 11, 2023

anyone has solution for the libnsl.so.1, i tried RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && apk add --update libaio libnsl && ln -s /usr/lib/libnsl.so.2 /usr/lib/libnsl.so.1 but still it's not working.

hi @Adhikaripr I manage to use node-oracledb in alpine:3.14.2

try to combine this on your dockerfile :
`
FROM node:14.18.1-alpine3.14

RUN printf "https://uk.alpinelinux.org/alpine/v3.14/main\nhttps://uk.alpinelinux.org/alpine/v3.14/community\n" > /etc/apk/repositories

RUN apk add --no-cache musl libaio libnsl libc6-compat krb5-libs
RUN apk add --update libc6-compat gcompat krb5-libs
`

@Adhikaripr
Copy link

anyone has solution for the libnsl.so.1, i tried RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && apk add --update libaio libnsl && ln -s /usr/lib/libnsl.so.2 /usr/lib/libnsl.so.1 but still it's not working.

hi @Adhikaripr I manage to use node-oracledb in alpine:3.14.2

try to combine this on your dockerfile : ` FROM node:14.18.1-alpine3.14

RUN printf "https://uk.alpinelinux.org/alpine/v3.14/main\nhttps://uk.alpinelinux.org/alpine/v3.14/community\n" > /etc/apk/repositories

RUN apk add --no-cache musl libaio libnsl libc6-compat krb5-libs RUN apk add --update libc6-compat gcompat krb5-libs `

thanks I tried that but still Error: DPI-1047: Cannot locate a 64-bit Oracle Client library: "Error loading shared library libnsl.so.1: No such file or directory (needed by /code/instantclient/libclntsh.so)

@cjbj
Copy link
Member

cjbj commented May 12, 2023

@Adhikaripr are you still on ppc64le? Did you try a different architecture? Did you try getting SQL*Plus working?

@yasirharis
Copy link

yasirharis commented May 12, 2023

@Adhikaripr or maybe you can share something so we can help you check the issue.

for my case,
~I put all .so files that needed by instant client into one folder
image

~check each file dependeny using ldd or lddtree to make sure no missing dependency.
~and set LD_LIBRARY_PATH to that folder. I use cross-env. eg. cross-env LD_LIBRARY_PATH=/app/instantclient_11_2 node app.js

@Adhikaripr
Copy link

@Adhikaripr are you still on ppc64le? Did you try a different architecture? Did you try getting SQL*Plus working?

@cjbj , yes still on ppc64le, i tried on another architecture, it works but on ppc64le, it doesnt.

@Adhikaripr
Copy link

After sym-linking these three it finally worked for ppc64le.
RUN ln -s /usr/lib/libnsl.so.3 /usr/lib/libnsl.so.1
RUN ln -s /usr/lib/libc.so /usr/lib/libresolv.so.2
RUN ln -s /lib64/ld64.so.2 /usr/lib/ld64.so.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants