Closed SunnyRajdeep-V42386 closed 11 months ago
@SunnyRajdeep-V42386 It seems the user which is running app do not have permission to create a file under "/app/node_modules/ibm_db/installer/clidriver/license
directory. Please check the permission of each directory starting from /app till license. It should have 755 permission. The ibm_db should be installed by same user who runs app, else change permission of license directory to 775 and try. Thanks.
Note that during the connection, clidriver reads file license/db2consv_zs.lic
and try to create nodelock files under license directory. It seems, user do not have sufficient permission to create a file under license directory and hence error. Please check the permissions.
Alternatively, you can install ibm-db using below commands and try:
cd $HOME
wget https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/v11.5.6/linuxx64_odbc_cli.tar.gz
tar xzf linuxx64_odbc_cli.tar.gz
cp db2consv_zs.lic clidriver/license
export IBM_DB_HOME=$HOME/clidriver
cd /app
npm install ibm_db
node app.js
Thanks.
@bimalkjha
My index.js and node modules residing in:root/app/
and /tmp
folder is residing at /root/tmp
where lambda have write permission.
I am trying to copy root/app/node_modules/ibm_db/installer
folder to /root/tmp
, so trying to achieve following things:
/temp/installer/testODBCConnection.sh
it will generate required trace files./tmp/installer/clidriver/license
and generate nodelock and other files.To achieve both, could you suggest what environment and Path variables and their values needs to be set for the linux oS/Lambda
I am trying to follow issue #616.
@SunnyRajdeep-V42386 You can run below commands and verify:
mv /root/app/node_modules/ibm_db/installer /tmp
cp db2consv_zs.lic /tmp/installer/clidriver/license
export IBM_DB_HOME=/tmp/installer/clidriver
export PATH=/tmp/installer/clidriver/bin:/tmp/installer/clidriver/lib:$PATH
export LD_LIBRARY_PATH=/tmp/installer/clidriver/lib
cd /root/app
rm -rf node_modules/ibm_db
npm install ibm_db
Thanks.
@bimalkjha As I am using docker image and docker commands I altered flow of suggested execution as below
RUN export IBM_DB_HOME=/tmp/installer/clidriver
RUN export PATH=/tmp/installer/clidriver/bin:/tmp/installer/clidriver/lib:$PATH
RUN export LD_LIBRARY_PATH=/tmp/installer/clidriver/lib
#RUN cd /root/app
RUN rm -rf ./node_modules/ibm_db
RUN npm install --unsafe-perm ibm_db
RUN mv ./node_modules/ibm_db/installer /tmp
RUN cp db2consv_zs.lic /tmp/installer/clidriver/license
After running nodejs script getting following error
/app/node_modules/bindings/bindings.js:121
--
throw e;
^
Error: libdb2.so.1: cannot open shared object file: No such file or directory
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at bindings (/app/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/app/node_modules/ibm_db/lib/odbc.js:57:31)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32) {
code: 'ERR_DLOPEN_FAILED'
}
@SunnyRajdeep-V42386 The error is due to change in the flow of suggested command. libdb2.so.1 is under ibm_db/installer/clidriver/lib
directory. Since, you moved this library post install, hence error at runtime. Reinstalling ibm_db again should fix the problem.
Update your docker file as below and verify:
RUN cd /root/app
RUN npm install --unsafe-perm ibm_db
RUN mv ./node_modules/ibm_db/installer /tmp
RUN cp db2consv_zs.lic /tmp/installer/clidriver/license
RUN export IBM_DB_HOME=/tmp/installer/clidriver
RUN export PATH=/tmp/installer/clidriver/bin:/tmp/installer/clidriver/lib:$PATH
RUN export LD_LIBRARY_PATH=/tmp/installer/clidriver/lib
RUN rm -rf ./node_modules/ibm_db
RUN npm install --unsafe-perm ibm_db
Thanks.
Note that once you export IBM_DB_HOME=/tmp/installer/clidriver, reinstalling ibm_db will not download clidriver and you'll not get installer/clidriver in second install. Thanks.
Here, first npm install --unsafe-perm ibm_db
is to get clidriver directory. Instead you can directly download clidriver too. In that case the commands would be like below:
RUN mkdir /tmp/installer && cd /tmp/installer
RUN wget https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz
RUN tar xzf linuxx64_odbc_cli.tar.gz
RUN cp db2consv_zs.lic /tmp/installer/clidriver/license
RUN export IBM_DB_HOME=/tmp/installer/clidriver
RUN export PATH=/tmp/installer/clidriver/bin:/tmp/installer/clidriver/lib:$PATH
RUN export LD_LIBRARY_PATH=/tmp/installer/clidriver/lib
RUN cd /root/app
RUN rm -rf ./node_modules/ibm_db
RUN npm install --unsafe-perm ibm_db
RUN cp ./node_modules/ibm_db/installer/testODBCConnection.sh /tmp/installer
Thanks.
@bimalkjha We are trying to copy files into /tmp folder upfront in docker file but when we deploy code to lambda, lambda clear out the /tmp directory everytime. I got reference here too: https://stackoverflow.com/questions/48580673/how-to-access-file-in-tmp-directory-of-aws-lambda#answer-73642693
On other side I tried to copy /ibm_db/installer in /tmp on run time and ran testODBCConnection.sh: given me following result:
Even we are setting IBM_DB_HOME and LD_LIBRARY_PATH it seems its not picking up those path in lambda.
I tried to change IBM_DB_HOME in testODBCConnection.sh as below:
============================================================================
Client information for the current copy:
===============================================================================
Client Package Type : IBM Data Server Driver For ODBC and CLI
Client Version (level/bit): DB2 v11.5.8.0 (special_26260/64-bit)
Client Platform : Linux/X8664
Install/Instance Path : /app/node_modules/ibm_db/installer/clidriver
DB2DSDRIVER_CFG_PATH value: <not-set>
db2dsdriver.cfg Path : /app/node_modules/ibm_db/installer/clidriver/cfg/db2dsdriver.cfg
DB2CLIINIPATH value : <not-set>
db2cli.ini Path : /app/node_modules/ibm_db/installer/clidriver/cfg/db2cli.ini
db2diag.log Path : /app/node_modules/ibm_db/installer/clidriver/db2dump/db2diag.log
===============================================================================
db2dsdriver.cfg schema validation for the entire file:
===============================================================================
Note: The validation utility could not find the configuration file
db2dsdriver.cfg. The file is searched at
"/app/node_modules/ibm_db/installer/clidriver/cfg/db2dsdriver.cfg".
===============================================================================
db2cli.ini validation for database "xxx:upico.xxx.com:5011":
===============================================================================
Note: The validation utility could not find the configuration file db2cli.ini.
The file is searched at
"/app/node_modules/ibm_db/installer/clidriver/cfg/db2cli.ini".
===============================================================================
db2dsdriver.cfg validation for database "xxx:upico.xxx.com:5011":
===============================================================================
Note: The validation utility could not find the configuration file
db2dsdriver.cfg. The file is searched at
"/app/node_modules/ibm_db/installer/clidriver/cfg/db2dsdriver.cfg".
===============================================================================
Connection attempt for database "xxx:upico.xxx.com:5011":
===============================================================================
[FAILED]: [IBM][CLI Driver] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968
===============================================================================
Valid License Found : No
License location : N/A
Server routine type attempted : SP and UDF
DB2 connect license version : N/A
===============================================================================
Error: The validation operation failed.
===============================================================================
===============================================================================
The validation is completed.
===============================================================================
/tmp/installer/testODBCConnection.sh: 6: [: unexpected operator
/tmp/installer/testODBCConnection.sh: 13: [: Linux: unexpected operator
/tmp/installer/testODBCConnection.sh: 21: [: Linux: unexpected operator
Could not create the trace file "1.trc".
/tmp/installer/testODBCConnection.sh: 34: [: Linux: unexpected operator
Trace is already off; no action was taken.
Could not create file "1.flw".
Check that you have enough disk space and have permission to create a file.
Another Possible reason might be too many open files
Try using [ulimit -n <# of files>] to increase the maximum number of open files.
Could not create file "1.fmt".
Check that you have enough disk space and have permission to create a file.
Another Possible reason might be too many open files
Try using [ulimit -n <# of files>] to increase the maximum number of open files.
Could not create file "1.fmtc".
Check that you have enough disk space and have permission to create a file.
Another Possible reason might be too many open files
Try using [ulimit -n <# of files>] to increase the maximum number of open files.
Could not create file "1.cli".
Check that you have enough disk space and have permission to create a file.
Another Possible reason might be too many open files
Try using [ulimit -n <# of files>] to increase the maximum number of open files.
Error: Command failed: sh /tmp/installer/testODBCConnection.sh
Thanks.
@SunnyRajdeep-V42386 See the result of testODBCConnection.sh script. The clidriver is still getting picked up from Install/Instance Path : /app/node_modules/ibm_db/installer/clidriver
and not from /tmp/intaller.
Check some other config file which might have setting clidriver at old location. Also, you need to set IBM_DB_HOME first and then install ibm_db. If it is reinstallation, then ibm_db too has not found IBM_DB_HOME set during installation time.
Also, why you need to copy installer under /tmp only? Can't you copy it under /home/$USER directory?
Actually, there is no requirement to copy installer under /tmp; but you need to check why the user who runs app, do not have write permission under /app/node_modules/ibm_db/installer/clidriver/license
directory?
If you can't give permission then you must need to set IBM_DB_HOME before installation of ibm_db so that clidriver can't get downloaded under ibm_db/installer. Thanks.
About error in execution of testODBCConnection.sh, use Korn Shell (ksh) and then run it. Script works with ksh. Thanks.
Hi @bimalkjha we managed to run testODBCConnection.sh from /temp/installer folder Now I am getting following message:
2023-07-06T09:08:51.682Z d5b75ba4-0547-4661-8929-2fb23aec9ac8 INFO /tmp/installer/clidriver
===============================================================================
Client information for the current copy:
===============================================================================
Client Package Type : IBM Data Server Driver For ODBC and CLI
Client Version (level/bit): DB2 v11.5.8.0 (special_26260/64-bit)
Client Platform : Linux/X8664
Install/Instance Path : /tmp/installer/clidriver
DB2DSDRIVER_CFG_PATH value: <not-set>
db2dsdriver.cfg Path : /tmp/installer/clidriver/cfg/db2dsdriver.cfg
DB2CLIINIPATH value : <not-set>
db2cli.ini Path : /tmp/installer/clidriver/cfg/db2cli.ini
db2diag.log Path : /tmp/installer/clidriver/db2dump/db2diag.log
===============================================================================
db2dsdriver.cfg schema validation for the entire file:
===============================================================================
Note: The validation utility could not find the configuration file
db2dsdriver.cfg. The file is searched at
"/tmp/installer/clidriver/cfg/db2dsdriver.cfg".
===============================================================================
db2cli.ini validation for database "xxx:upico.xxx.com:5011":
===============================================================================
Note: The validation utility could not find the configuration file db2cli.ini.
The file is searched at "/tmp/installer/clidriver/cfg/db2cli.ini".
===============================================================================
db2dsdriver.cfg validation for database "xxx:upico.xx.com:5011":
===============================================================================
Note: The validation utility could not find the configuration file
db2dsdriver.cfg. The file is searched at
"/tmp/installer/clidriver/cfg/db2dsdriver.cfg".
===============================================================================
Connection attempt for database "xxx:upico.xxx.com:5011":
===============================================================================
[SUCCESS]
===============================================================================
Valid License Found : Yes
License location : Client
Server routine type attempted : SP and UDF
DB2 connect license version : N/A
===============================================================================
The validation is completed.
===============================================================================
total 17M
-rw-r--r-- 1 sbx_user1051 990 67K Jul 6 09:08 APIDocumentation.md
-rw-r--r-- 1 sbx_user1051 990 1.2K Jul 6 09:08 LICENSE
-rw-r--r-- 1 sbx_user1051 990 15K Jul 6 09:08 INSTALL.md
-rw-r--r-- 1 sbx_user1051 990 28K Jul 6 09:08 CHANGES.md
-rw-r--r-- 1 sbx_user1051 990 25K Jul 6 09:08 README.md
-rw-r--r-- 1 sbx_user1051 990 3.4K Jul 6 09:08 binding.gyp
-rw-r--r-- 1 sbx_user1051 990 26 Jul 6 09:08 _config.yml
drwxr-xr-x 2 sbx_user1051 990 4.0K Jul 6 09:08 contributing
drwxr-xr-x 3 sbx_user1051 990 4.0K Jul 6 09:08 build
drwxr-xr-x 2 sbx_user1051 990 4.0K Jul 6 09:08 examples
drwxr-xr-x 2 sbx_user1051 990 4.0K Jul 6 09:08 lib
drwxrwxr-x 3 sbx_user1051 990 4.0K Jul 6 09:08 installer
drwxr-xr-x 5 sbx_user1051 990 4.0K Jul 6 09:08 node_modules
-rw-r--r-- 1 sbx_user1051 990 1.9K Jul 6 09:08 package.json
drwxr-xr-x 2 sbx_user1051 990 4.0K Jul 6 09:08 src
drwxr-xr-x 4 sbx_user1051 990 4.0K Jul 6 09:08 test
-rw------- 1 sbx_user1051 990 4.5M Jul 6 09:08 1.trc
-rw-r----- 1 sbx_user1051 990 3.0M Jul 6 09:08 1.flw
-rw-r----- 1 sbx_user1051 990 9.1M Jul 6 09:08 1.fmt
-rw-r----- 1 sbx_user1051 990 54K Jul 6 09:08 1.fmtc
-rw-r----- 1 sbx_user1051 990 4.5K Jul 6 09:08 1.cli
total 60K
-rwxrwxr-x 1 sbx_user1051 990 517 Jul 6 09:08 setenv.sh
-rwxrwxr-x 1 sbx_user1051 990 853 Jul 6 09:08 ifx.sh
-rwxrwxr-x 1 sbx_user1051 990 37K Jul 6 09:08 driverInstall.js
-rw-r--r-- 1 sbx_user1051 990 1.2K Jul 6 09:08 testODBCConnection.sh
-rwxrwxr-x 1 sbx_user1051 990 903 Jul 6 09:08 testODBCConnection.bat
drwxrwxr-x 15 sbx_user1051 990 4.0K Jul 6 09:08 clidriver
2023-07-06T09:08:51.682Z d5b75ba4-0547-4661-8929-2fb23aec9ac8 INFO /tmp/installer/testODBCConnection.sh: 6: [: /tmp/installer/clidriver: unexpected operator
/tmp/installer/testODBCConnection.sh: 13: [: Linux: unexpected operator
/tmp/installer/testODBCConnection.sh: 21: [: Linux: unexpected operator
Trace is turned on
/tmp/installer/testODBCConnection.sh: 36: [: Linux: unexpected operator
Trace is turned off
Total number of trace records : 35367
Trace truncated : NO
Trace wrapped : NO
Number of trace records formatted : 2 (pid: 24 tid 140031771225024 node: -1)
Number of trace records formatted : 35210 (pid: 28 tid 140351312694208 node: -1)
Trace truncated : NO
Trace wrapped : NO
Total number of trace records : 35367
Number of trace records formatted : 35212
Trace truncated : NO
Trace wrapped : NO
Total number of trace records : 35367
Number of trace records formatted : 32
Trace truncated : NO
Trace wrapped : NO
Total number of trace records : 35367
Number of trace records formatted : 155
Getting this error too: [Error: [IBM][CLI Driver] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968 ] { error: '[ibm_db] SQL_ERROR', sqlcode: -1598, state: '42968' }
{
success: -3, message: { message: 'Connection not open.', sqlstate: '08001', sqlcode: -30081 } }
@SunnyRajdeep-V42386 Now the output of testODBCConnection.sh
file looks good and it is able to connect to server. We can see the SUCCESS
message with below info and there is no more SQL1598N error with it.
Valid License Found : Yes
License location : Client
Server routine type attempted : SP and UDF
DB2 connect license version : N/A
So, how are you able to get SQL1598N error and using which script? Please update the database connection info in ibm_db/test/config.testConnectionStrings.json
file same as you used in testODBCConnection.sh and then execute node test/test-basic-test.js
script. Share the complete output of test-basic-test.js here.
Thanks.
@bimalkjha
Sorry for late response, if we use /tmp directory for aws-lambda it is working.
I added these environment variables in Lambda configuration:
But for a AWS Lambda, Its time consuming to perform those initial operation to move ibm_db node-modules to /tmp directory and do the connection.
Thanks for all the support.
Sharing below Dockerfile who is trying for it on Linux / Aws-Lambda:
FROM python:3.7
RUN pip install --no-cache --upgrade pip setuptools
# Define custom function directory
ARG FUNCTION_DIR="app"
FROM node:16
# Include global arg in this stage of the build
ARG FUNCTION_DIR
# Install build dependencies
RUN apt-get update
RUN apt-get install -y \
gcc \
g++ \
make \
cmake \
unzip \
libcurl4-openssl-dev
RUN dir -s
RUN cd /usr && ls -al
# Copy function code
#RUN mkdir -p ${FUNCTION_DIR}
COPY * app/
WORKDIR /app
# clearing cache if any
RUN rm -rf ./node_modules/ibm_db
# Install Node.js dependencies
RUN npm install
# Install Node-ibm_db dependencies
RUN npm install --unsafe-perm ibm_db
# Copying .lic file to license folder
RUN cp db2consv_zs.lic ./node_modules/ibm_db/installer/clidriver/license/
# Updating file permissions of all files
RUN chmod -R 775 ./node_modules/ibm_db/installer
# Replacing packaged testODBCConnection.sh with valid credentials to installer, this contains only valid credentials connection string. Not a mandatory step.
RUN rm ./node_modules/ibm_db/installer/testODBCConnection.sh
RUN cp testODBCConnection.sh ./node_modules/ibm_db/installer/
RUN cd ./node_modules/ibm_db/installer/clidriver/cfgcache/ && ls -al && rm conlic.bin
# Install the runtime interface client
RUN npm install aws-lambda-ric
# Grab a fresh slim copy of the image to reduce the final size
# FROM node:18-buster-slim
# Required for Node runtimes which use npm@8.6.0+ because
# by default npm writes logs under /home/.npm and Lambda fs is read-only
ENV NPM_CONFIG_CACHE=/tmp/.npm
# Set runtime interface client as default command for the container runtime
ENTRYPOINT ["/usr/local/bin/npx", "aws-lambda-ric"]
# Pass the name of the function handler as an argument to the runtime
CMD ["app.handler"]
In your script you need to move /app/node_modules/ibm_db/ all folder contents to /tmp folder const srcDir = "/app/node_modules/ibm_db"; const destDir = "/tmp";
@SunnyRajdeep-V42386 We are moving ibm_db/installer to /tmp so that the current user can have write permission for directory /tmp/installer/clidriver/license. If you could give write permission for current user for all dirs of /app/node_modules/ibm_db/installer/clidriver/license
or change permissions to 775, then you need not to move ibm_db to /tmp and app will work smoothly. Its all about write permission. Or run the app as root user in aws lambda. All workarounds that we are doing is to give permission.
Can we close this issue now as there is no problem with ibm_db but permission issue with your application environment? ibm_db is working fine when given correct permission to it.
Thanks.
Try to use EFS with lambda and see if it can make any change. Few users updated that - Was able to get this working using EFS and having the required dependency libraries.
Closing the issue as using /tmp directory for aws-lambda is working as per last update. Thanks.
Please provide below information while opening an issue to understand your problem
db2level
command from Db2 database system:For non-Windows system, output of below commands from terminal:
node -v : 14.18.1 npm ls ibm_db db2level echo $IBM_DB_HOME: none echo $PATH: none echo $LD_LIBRARY_PATH $DYLD_LIBRARY_PATH: none
Please provide below problem specific info:
=========================================
For Connection related issue
DATABASE=${DB_CONFIG.database};HOSTNAME=${DB_CONFIG.hostname};PORT=${DB_CONFIG.port};PROTOCOL=TCPIP;UID=${DB_CONFIG.id};PWD=${DB_CONFIG.password};
db2cli validate
command in fileibm_db/installer/testODBCConnection.bat
for windows oribm_db/installer/testODBCConnection.sh
for non-Windows. Then executetestODBCConnection.bat
from Administrator command prompt on Windows ortestODBCConnection.sh
script from terminal on non-Windows and share complete output of script along will all generated 1.* files in zip file.db2cli validate
command.Output ==================================================
Client information for the current copy:
Client Package Type : IBM Data Server Driver For ODBC and CLI Client Version (level/bit): DB2 v11.5.6.0 (special_13806/64-bit) Client Platform : Linux/X8664 Install/Instance Path : /app/node_modules/ibm_db/installer/clidriver DB2DSDRIVER_CFG_PATH value:
db2dsdriver.cfg Path : /app/node_modules/ibm_db/installer/clidriver/cfg/db2dsdriver.cfg
DB2CLIINIPATH value :
db2cli.ini Path : /app/node_modules/ibm_db/installer/clidriver/cfg/db2cli.ini
db2diag.log Path : /app/node_modules/ibm_db/installer/clidriver/db2dump/db2diag.log
db2dsdriver.cfg schema validation for the entire file:
Note: The validation utility could not find the configuration file db2dsdriver.cfg. The file is searched at "/app/node_modules/ibm_db/installer/clidriver/cfg/db2dsdriver.cfg".
db2cli.ini validation for database "XXXX:subdomain.domain.com:5011":
Note: The validation utility could not find the configuration file db2cli.ini. The file is searched at "/app/node_modules/ibm_db/installer/clidriver/cfg/db2cli.ini".
db2dsdriver.cfg validation for database "XXXX:subdomain.domain.com:5011":
Note: The validation utility could not find the configuration file db2dsdriver.cfg. The file is searched at "/app/node_modules/ibm_db/installer/clidriver/cfg/db2dsdriver.cfg".
Connection attempt for database "XXXX:subdomain.domain.com:5011":
[FAILED]: [IBM][CLI Driver] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968
Valid License Found : No License location : N/A Server routine type attempted : SP and UDF DB2 connect license version : N/A
Error: The validation operation failed.
========================================= The validation is completed.
./node_modules/ibm_db/installer/testODBCConnection.sh: 6: [: unexpected operator ./node_modules/ibm_db/installer/testODBCConnection.sh: 13: [: Linux: unexpected operator ./node_modules/ibm_db/installer/testODBCConnection.sh: 21: [: Linux: unexpected operator Could not create the trace file "1.trc". ./node_modules/ibm_db/installer/testODBCConnection.sh: 34: [: Linux: unexpected operator Trace is already off; no action was taken. Could not create file "1.flw". Check that you have enough disk space and have permission to create a file. Another Possible reason might be too many open files Try using [ulimit -n <# of files>] to increase the maximum number of open files. Could not create file "1.fmt". Check that you have enough disk space and have permission to create a file. Another Possible reason might be too many open files Try using [ulimit -n <# of files>] to increase the maximum number of open files. Could not create file "1.fmtc". Check that you have enough disk space and have permission to create a file. Another Possible reason might be too many open files Try using [ulimit -n <# of files>] to increase the maximum number of open files. Could not create file "1.cli". Check that you have enough disk space and have permission to create a file. Another Possible reason might be too many open files Try using [ulimit -n <# of files>] to increase the maximum number of open files. exec error: Error: Command failed: sh ./node_modules/ibm_db/installer/testODBCConnection.sh ./node_modules/ibm_db/installer/testODBCConnection.sh: 6: [: unexpected operator ./node_modules/ibm_db/installer/testODBCConnection.sh: 13: [: Linux: unexpected operator ./node_modules/ibm_db/installer/testODBCConnection.sh: 21: [: Linux: unexpected operator Could not create the trace file "1.trc". ./node_modules/ibm_db/installer/testODBCConnection.sh: 34: [: Linux: unexpected operator Trace is already off; no action was taken. Could not create file "1.flw". Check that you have enough disk space and have permission to create a file. Another Possible reason might be too many open files Try using [ulimit -n <# of files>] to increase the maximum number of open files. Could not create file "1.fmt". Check that you have enough disk space and have permission to create a file. Another Possible reason might be too many open files Try using [ulimit -n <# of files>] to increase the maximum number of open files. Could not create file "1.fmtc". Check that you have enough disk space and have permission to create a file. Another Possible reason might be too many open files Try using [ulimit -n <# of files>] to increase the maximum number of open files. Could not create file "1.cli". Check that you have enough disk space and have permission to create a file. Another Possible reason might be too many open files Try using [ulimit -n <# of files>] to increase the maximum number of open files. START RequestId: 836b4337-afd8-4274-817e-7602a3958faa Version: $LATEST RequestId: 836b4337-afd8-4274-817e-7602a3958faa Error: Runtime exited without providing a reason Runtime.ExitError
--> ./node_modules/ibm_db/installer/clidriver/license - folder containts
UNIX db2consv_zs.lic odbc_REDIST.txt odbc_notices.txt ----> ./tmp // tried copying license file under lambda temp(tmp) folder db2consv_zs.lic
[Error: [IBM][CLI Driver] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968 ] { error: '[ibm_db] SQL_ERROR', sqlcode: -1598, state: '42968' } { success: -3, message: { message: 'Connection not open.', sqlstate: '08001', sqlcode: -30081 } }
For SQL1598N Error
RUN apt-get install -y apt-transport-https make gcc g++ RUN pip install --no-cache --upgrade pip setuptools
FROM artifactory.aws.aflac.com/docker/node:14.18.1 RUN dir -s
COPY * app/ WORKDIR /app
RUN npm install --unsafe-perm ibm_db -clidriver=v11.5.6
RUN rm ./node_modules/ibm_db/installer/testODBCConnection.sh RUN cp testODBCConnection.sh ./node_modules/ibm_db/installer/ RUN cd ./node_modules/ibm_db/installer/clidriver/cfgcache/ && ls -al && rm conlic.bin
RUN dir -s RUN chmod -R 775 . RUN cp db2consv_zs.lic ./node_modules/ibm_db/installer/clidriver/license/
RUN cd ./node_modules/ibm_db/installer/clidriver/license/ && ls -ltra
ENTRYPOINT [ "node", "index.js" ]
const { exec } = require('child_process'); var yourscript = exec('sh ./node_modules/ibm_db/installer/testODBCConnection.sh', (error, stdout, stderr) => { console.log(stdout); console.log(stderr); if (error !== null) { console.log(
exec error: ${error}
); } });let connStr =
DATABASE=${DB_CONFIG.database};HOSTNAME=${DB_CONFIG.hostname};PORT=${DB_CONFIG.port};PROTOCOL=TCPIP;UID=${DB_CONFIG.id};PWD=${DB_CONFIG.password};
;(async (key, location) => {
await fs.copyFile("./db2consv_zs.lic", "/tmp/db2consv_zs.lic", (err)=>{ if(err) console.log("File was not copied to destination folder", err); }); console.log("----> ./node_modules/ibm_db/installer/clidriver/license"); await fs.readdirSync("./node_modules/ibm_db/installer/clidriver/license").forEach(file => { console.log(file); }); console.log("----> ./tmp"); await fs.readdirSync("/tmp").forEach(file => { console.log(file); });
})();