"ODPI [00088] 2023-10-08 20:24:31.060: ODPI-C 5.0.0"
"ODPI [00088] 2023-10-08 20:24:31.061: debugging messages initialized at level 64"
"ODPI [00088] 2023-10-08 20:24:31.062: Context Parameters:"
"ODPI [00088] 2023-10-08 20:24:31.062: Environment Variables:"
"ODPI [00088] 2023-10-08 20:24:31.062: LD_LIBRARY_PATH => ""/opt/oracle-instant-client"""
"ODPI [00088] 2023-10-08 20:24:31.062: check module directory"
"ODPI [00088] 2023-10-08 20:24:31.062: module name is /home/site/wwwroot/build/Release/oracledb-6.1.0-linux-x64.node"
"ODPI [00088] 2023-10-08 20:24:31.062: load in dir /home/site/wwwroot/build/Release"
"ODPI [00088] 2023-10-08 20:24:31.062: load with name /home/site/wwwroot/build/Release/libclntsh.so"
"ODPI [00088] 2023-10-08 20:24:31.063: load by OS failure: /home/site/wwwroot/build/Release/libclntsh.so: cannot open shared object file: No such file or directory"
"ODPI [00088] 2023-10-08 20:24:31.063: load with OS search heuristics"
"ODPI [00088] 2023-10-08 20:24:31.063: load with name libclntsh.so"
"ODPI [00088] 2023-10-08 20:24:31.063: load by OS failure: libclntsh.so: cannot open shared object file: No such file or directory"
"ODPI [00088] 2023-10-08 20:24:31.063: load with name libclntsh.so.19.1"
"ODPI [00088] 2023-10-08 20:24:31.063: load by OS failure: libclntsh.so.19.1: cannot open shared object file: No such file or directory"
"ODPI [00088] 2023-10-08 20:24:31.063: load with name libclntsh.so.18.1"
"ODPI [00088] 2023-10-08 20:24:31.063: load by OS failure: libclntsh.so.18.1: cannot open shared object file: No such file or directory"
"ODPI [00088] 2023-10-08 20:24:31.064: load with name libclntsh.so.12.1"
"ODPI [00088] 2023-10-08 20:24:31.064: load by OS failure: libclntsh.so.12.1: cannot open shared object file: No such file or directory"
"ODPI [00088] 2023-10-08 20:24:31.064: load with name libclntsh.so.11.1"
"ODPI [00088] 2023-10-08 20:24:31.064: load by OS failure: libclntsh.so.11.1: cannot open shared object file: No such file or directory"
"ODPI [00088] 2023-10-08 20:24:31.064: load with name libclntsh.so.20.1"
"ODPI [00088] 2023-10-08 20:24:31.064: load by OS failure: libclntsh.so.20.1: cannot open shared object file: No such file or directory"
"ODPI [00088] 2023-10-08 20:24:31.065: load with name libclntsh.so.21.1"
"ODPI [00088] 2023-10-08 20:24:31.065: load by OS failure: libclntsh.so.21.1: cannot open shared object file: No such file or directory"
I also created Azure/azure-functions-core-tools#1620 (comment) as this may be on the Azure side, but I'm not 100% sure the internals of the v6 binaries.
Unfortunately, at this point, I didn't know where to look further. It feels as though:
There's a mystical lookup function included in the pre-compiled binaries that I don't understand that excludes my directory on Azure functions.
Azure functions filesystem operates "differently" in a way that I do not understand.
true
=== false
results in true
Azure Linux Functions library will not find specified file
Azure Linux Functions Error: DPI-1047 Cannot locate a 64-bit Oracle Client library
Oct 8, 2023
Thanks for reporting this. Based on the logs, it seems that the underlying ODPI-C library does not pickup the LD_LIBRARY_PATH for fetching libclntsh.so
, when called through Azure functions.
We will investigate this and get back to you.
I would assume so. I wound up just spinning up a docker container based upon mcr.microsoft.com/azure-functions/node:4-node18
that does actually function properly with the LD_LIBRARY_PATH
. I suspect that this is something specific to Azure functions, but depending on whether or not the team cares to support the Azure Functions model, you may or may not want to investigate it further.
I can provide any further information you may need, but my C is weak at best and I got to LoadLibrary
in the ODPI and then gave up as I don't know what that function does internally.
LoadLibrary
is an windows API called by ODPI. GetLastError
is dumped in odpi code. I think any application doing dlopen seems to have some permissions/setting issue. Can we also run under Linux which uses dlopen
Does thin mode work for your application? I mean If you remove oracledb.initOracleClient
(); call from your application, driver runs in thin mode.
I strugle with the same issue. Any solution? I can only use thick mode Azure deployment, but can't run because of the missing instant oracle client. If I install it with ssh then the new deployment removes it from /oracle directory.
Azure web app -> Linux plan
@flash4174 Can you tell, what is the new deployment that removes Oracle Instant Client from the /oracle
directory?
Are you saying that installing node-oracledb via npm removes Oracle Instant Client from the oracle
?
@sharadraju I install Oracle Instant Client with ssh with wget and unzip to /oracle folder
Then I redeploy my site with local git and after that if I check the folder with ssh, it not exist.
Does the oracledb library should have the instant client by default?
Thanks @flash4174 for the explanation.
When you redeploy your site, there may be other modules that could have erased the /oracle
directory.
Node-oracledb will not remove the /oracle
directory and as of version 6.0 does not require Oracle Instant Client to get started.
If you want to use Thick mode, Oracle Instant Client is required.
I would suggest that you raise this issue with Azure.
See #1611 (comment) for the OP's comments on Azure functions.