How does one build the upload package for an AWS Lamba function to connect to an Oracle RDS database? The lambda language is Python 3.6. My development environment is Windows NOT linux.
When I try, I get error:
DPI-1047: 64-bit Oracle Client library cannot be loaded: "libaio.so.1: cannot open shared object file: No such file or directory
This is strange, because as I understand it, libaio.so is part of the amazon linux system, and so the correct version of libaio.so should be found.
I did the following steps to build my lambda package:
/lib
/
/
LD_LIBRARY_PATH
includes /lib
and environment variable TNS_ADMIN
points to directory /
here is the fragment of the python code, inside the lambda to achieve that:
oraclePath = os.environ['LAMBDA_TASK_ROOT'] + '/lib'
if oraclePath not in os.environ['LD_LIBRARY_PATH'].split(':'):
os.environ['LD_LIBRARY_PATH'] = oraclePath + ':' + os.environ['LD_LIBRARY_PATH']
if ('TNS_ADMIN' not in os.environ) or (os.environ['TNS_ADMIN'] != os.environ['LAMBDA_TASK_ROOT']):
os.environ['TNS_ADMIN'] = os.environ['LAMBDA_TASK_ROOT']
libclntsh.so.18.1
to libclntsh.so
. Similarly for libocci.so
, and libclntshcore.so
Here are two similiar SO questions with answers that didnt work for me, or are not applicable to my situation:
AWS Lambda cannot connect to Oracle Instant Client Paul's solution is done in step 5 above.
AWS Python Lambda with Oracle Thomas's solution is not helpful to me in my situation. These are linux commands. I need a windows solution.
Perhaps I need to ask: How does a windows developer acquire the correct version of libaio.so.1 for the Amazon Linux Lambda environment, and where should this file be placed in the lambda package? Any solution that involves bash commands is not helpful.
Since I ran into the same problem, you can find the needed libraries from here: https://pkgs.org/download/libaio (eg the Arch linux package)
Then extract the files from that package into the /lib folder of your lambda package.
Download instant client basic lite for windows x64.. that error will get solved! As u have downloaded linux version and using it on windows.. you are getting that error.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.