Closed damienwebdev closed 2 weeks ago
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.
If all the files are confirmed to be at the path set in LD_LIBRARY_PATH, then it most likely looks to be some permissions or settings issue in the Function stack.
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 can't use thin mode as I am targeting an Oracle 11g database.
I did try to connect and I received a specific error saying that the thin client wasn't supported for the database I was connecting to.
@damienwebdev Note the extra quotes around the value of LD_LIBRARY_PATH used in Azure compared to the one locally. It looks like the value of the environment variable includes the quotes -- which shouldn't be happening. Can you remove those quotes and try again?
Those extra quotes are just from the log file escaper. They don't exist at runtime.
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 https://github.com/oracle/node-oracledb/issues/1611#issuecomment-1753909473 for the OP's comments on Azure functions.
Closing this issue as it is an install issue with Azure, over which node-oracledb has no control.
Give your database version -
11g
Is it an error or a hang or a crash? Error.
What error(s) or behavior you are seeing?
func start
Locally, I can get this to work with a
local.settings.json
like:However, when I tried the exact same setup in Azure Functions (I confirmed the instantclient's
*.so
are uploaded correctly to the right location both via manual inspection and via a script like:For clarity, for me, my settings across the envs in question are:
I tried the debug setting
DPI_DEBUG_LEVEL: 64
and locally I see a successful load:However, comparing that with the Azure Function logs with debugging enabled gives me:
I also created https://github.com/Azure/azure-functions-core-tools/issues/1620#issuecomment-1752126509 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:
true
===false
results intrue