ibmdb / node-ibm_db

IBM DB2 and IBM Informix bindings for node
MIT License
188 stars 151 forks source link

Hi- im getting error `libcrypt.so.1: cannot open shared object file: No such file or directory` while creating ibm_db instance in aws lambda. #866

Closed nsdnl closed 2 years ago

nsdnl commented 2 years ago

Hi, im trying to setup a node lambda with connection to IBM db. im using ibm_db npm. its working fine on my local machine but when i deploy on aws i get below error: libcrypt.so.1: cannot open shared object file: No such file or directory.

complete error: { "errorType": "Error", "errorMessage": "libcrypt.so.1: cannot open shared object file: No such file or directory", "stack": [ "Error: libcrypt.so.1: cannot open shared object file: No such file or directory", " at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18)", " at Module.load (internal/modules/cjs/loader.js:863:32)", " at Function.Module._load (internal/modules/cjs/loader.js:708:14)", " at Module.require (internal/modules/cjs/loader.js:887:19)", " at require (internal/modules/cjs/helpers.js:74:18)", " at bindings (/var/task/node_modules/bindings/bindings.js:112:48)", " at Object.<anonymous> (/var/task/node_modules/ibm_db/lib/odbc.js:57:31)", " at Module._compile (internal/modules/cjs/loader.js:999:30)", " at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)", " at Module.load (internal/modules/cjs/loader.js:863:32)" ] }

i tried installing openssl as mentioned here (https://github.com/ibmdb/node-ibm_db/issues/767) but didn't help. tried reaching out old reported issue (https://forums.aws.amazon.com/thread.jspa?threadID=247288) but it has been archived hence couldn't found.

Could you help me here? im using "ibm_db": "^2.8.1", please let me know if you need more information about it.

bimalkjha commented 2 years ago

@nsdnl The clidriver hosting site was down since 6hrs. It is up now and issue should be fixed. Could you please try a fresh installation and verify. Thanks.

nsdnl commented 2 years ago

@bimalkjha thanks for the reply. i just re-tried now and unfortunately got the same error. is clidriver site up now?

bimalkjha commented 2 years ago

@nsdnl Yes, clidriver site is up and you can see all files are available here: https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/

Regarding libcrypt.so.1; this library is not part of clidriver. It is system library and installing openssl should fix it. Check amazon doc about it. Probably this link will help you: https://installati.one/amazonlinux/2/libcrypt.x86_64/ Thanks.

nsdnl commented 2 years ago

i am installing 'openssl' but still getting the same error libcrypt.so.1: cannot open shared object file: No such file or directory. i tired below packages for openssl and ended up with same error:

bimalkjha commented 2 years ago

@nsdnl libcrypt.so.1 is a C library not a node.js library. So installing node.js package has no effect. Login to AWS EC2 instance, install the library using yum install openssl-devel command. Better to use yum install make gcc gcc-c++ kernel-devel openssl-devel bzip2-devel command as documented here for Docker containers. Then check the result of ls -l /usr/lib64/libcrypt* command and share. Thanks.

nsdnl commented 2 years ago

oh, i had got it all wrong, thanks @bimalkjha for clarification. i'll install this on AWS and try.