-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue using ibm_db in lambda layer #616
Comments
@mrn3 There might be problem with your license file version or some other installation of db2 exist in your system which is getting used at run-time. The error says, either license file is not found at correct location or license file is of incorrect version of Db2. Please confirm the version of ibm_db and db2connect license. The license file should have name like Also, we would request to share the output of
Please share the output of above command too. Thanks. |
Thanks so much for your response. Yes, I have a license file and it is at: /opt/nodejs/node_modules/ibm_db/installer/clidriver/license/db2consv_ee.lic It has: ProductVersion=11.1 I am using ibm_db@2.6.4. When I am in my docker container, I run this: bash-4.2# ./db2cli validate -database "ArkonaQ:proxy.privatelink.internal:10041" -user 'DTATTUN' -passwd '<some_password>' -connect ===============================================================================
|
@mrn3 Please update the connection string in the "db2cli validate" command in file |
You can also delete the |
Thanks so much @bimalkjha. So I did remove the conlic.bin file and I seem to still get the error, so this isn't a result of caching the wrong license file. I will email you those generated trace files and the license file. It may be a bit of a challenge to read those 1.* files in lambda, but I will try. |
@mrn3 After looking into the trace files, found below logs in 1.fmt file:
It looks the userid using which this node program is running do not have write permission for clidriver/license or clidriver/db2dump directories. Could you please check and correct the permission of these directories and try? Thanks. |
Okay thank you so much. This actually makes a lot of sense because a lambda really only can reliably write to the /tmp directory. Is there a way I can configure this so it will write what it needs to there instead of in the clidriver directories? If so, how would I do that? |
I figure I could do a more manual install where I copy the clidriver directory on /tmp and then have an environment variable point to it as part of the lambda startup, but ideally I would just be able to configure the write directory in The IBM driver instead. |
I got it to work in lambda! Thank you so much for your help! I put the ODBC driver and license file in the /tmp folder (at run time I do that) so I can write to it. I also had to set PATH and LD_LIBRARY_PATH to point at that /tmp directory in my lambda, and run ldconfig at runtime as well. If you have any other ideas (writing somewhere other than license or db2dump folder, or maybe just disable the caching of the license since I am losing that cache every time lambda restarts anyway), it would be very appreciated. Take care! |
@mrn3 Unfortunately this is the only way that you are using. License file must be under clidriver/license directory and it requires write permission on license and db2dump directories. |
Okay great thanks @bimaljha - it is working well for me, and thanks for confirming that there isn't another way to accomplish it. Again, I appreciate all the help. Take care! |
Has anyone successfully gotten ibm_db working in a lambda layer?
Because it needs node-gyp and c bindings, I ended up creating my own node 10 runtime (using https://github.com/lambci/node-custom-lambda as a base). I add all the stuff I need (make gcc gcc-c++ kernel-devel openssl-devel bzip2-devel), and also do npm install --unsafe-perm ibm_db. I put the ibm_db stuff all in the nodejs folder, and my layer seems to look good. I also make sure to copy the license file to the license directory properly. When I run a lambda that uses the layer, I get "{ [Error: [IBM][CLI Driver] SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968]" no matter what I do. I use the same license file and run this locally, and it works fine, so I am perplexed.
I am thinking it has to do something with the license file or environment variables so that lambda doesn't know to use the license file that is in the lambda layer.
Any guidance would be appreciated.
The text was updated successfully, but these errors were encountered: