node-oracledb icon indicating copy to clipboard operation
node-oracledb copied to clipboard

Error: DPI-1047: Cannot locate a 64-bit Oracle Client library: "/usr/src/app/oracle/instantclient_18_3/libclntsh.so: file too short".

Open KaustubhYK opened this issue 7 years ago • 7 comments

This is my Dockerfile FROM node:carbon

USER root

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

COPY . .

RUN chmod -R 777 /usr/src/app

ENV LD_LIBRARY_PATH="/usr/src/app/oracle/instantclient_18_3"

I am using [email protected] node module to connect with oracle database. And I am getting above error while calling getConnection function of oracledb.

KaustubhYK avatar Feb 26 '19 22:02 KaustubhYK

file too short sounds like an OS error reporting you have a corrupted Oracle Instant Client installation.

cjbj avatar Feb 26 '19 22:02 cjbj

Thanks @cjbj for responding, There is only single line in libclntsh.so , i.e. libclntsh.so.18.1

KaustubhYK avatar Feb 26 '19 23:02 KaustubhYK

That would be the expected symbolic link to libclntsh.so.18.1, which obviously must exist. Make sure you copy all the files.

Here are some resources that you may be interested in:

  • http://yum.oracle.com/oracle-linux-nodejs.html You could use these packages to install Node.js
  • https://github.com/oracle/docker-images/blob/master/OracleInstantClient/dockerfiles/18.3.0/Dockerfile You could use this as the basis for a container

cjbj avatar Feb 26 '19 23:02 cjbj

Thanks @cjbj , libclntsh.so file was getting corrupt on windows machine while extracting. Now I am extracting it directly on my remote environment before setting environment variables.

KaustubhYK avatar Mar 01 '19 11:03 KaustubhYK

@KaustubhYK can you please share your fixed dockerfile here? it would help a lot.

bmabir17 avatar May 15 '23 07:05 bmabir17

@KaustubhYK try the new node-oracledb 6 default Thin mode: this doesn't need Instant Client, so installing will be a lot smoother. See the release announcement.

cjbj avatar May 26 '23 06:05 cjbj

@KaustubhYK and @bmabir17 can you share your solution? DPI-1047: Cannot locate a 64-bit Oracle Client library: "/opt/oracle/instantclient_23_6/libclntsh.so: file too short".

I have the same issue. I checked the client installation it seems ok.

ldconfig -p | grep libclntsh.so

    libclntsh.so.23.1 (libc6,x86-64) => /opt/oracle/instantclient_23_6/libclntsh.so.23.1

yooman00 avatar Nov 11 '24 11:11 yooman00