-
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
Alpine support - musl libc #217
Comments
Ok. So, the problem is this error:
While loading libdb2.so.1, OS does not find the symbol pthread_mutexattr_setkind_np. $ nm libdb2.so.1 | grep pthread_mutexattr_setkind_np Please share output of |
I added in For those looking for how to do it: RUN cd /tmp \
&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.23-r3/glibc-2.23-r3.apk \
&& apk add --no-cache glibc-2.23-r3.apk NodeJS: v7.4.0 $ docker run odbc ldd /var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1
Error relocating /var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1: pthread_mutexattr_setkind_np: symbol not found
Error relocating /var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1: __strtof_internal: symbol not found
Error relocating /var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1: pthread_attr_setaffinity_np: symbol not found
Error relocating /var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1: __register_atfork: symbol not found
Error relocating /var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1: __strtod_internal: symbol not found
Error relocating /var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1: sysctl: symbol not found
Error relocating /var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1: backtrace: symbol not found
Error relocating /var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1: getgrent_r: symbol not found
Error relocating /var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1: __res_init: symbol not found
Error relocating /var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1: dlvsym: symbol not found
ldd (0x5608749ab000)
libcrypt.so.1 => /usr/lib/libcrypt.so.1 (0x7f336255c000)
libdl.so.2 => ldd (0x5608749ab000)
libpthread.so.0 => ldd (0x5608749ab000)
librt.so.1 => ldd (0x5608749ab000)
libpam.so.0 => /lib/libpam.so.0 (0x7f3362350000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x7f3362025000)
libm.so.6 => ldd (0x5608749ab000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f3361cd5000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f3361ac2000)
libc.so.6 => ldd (0x5608749ab000)
libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x7f33618b1000)
libz.so.1 => /lib/libz.so.1 (0x7f336169b000) |
So, your alpine OS has below missing libraries:
On my Linux system I can see these libs under /lib64:
Please contact docker team and get these libs. Now, I am curious to know - after installing ibm_db, which server you want to connect? None of the IBM DB2 or DashDB driver would work on this system with missing libraries. It is not an issue with node-ibm_db driver. Thanks. |
Looks like it's related to this: https://github.com/gliderlabs/docker-alpine/blob/master/docs/caveats.md#incompatible-binaries I'll dig deeper and post a solution when I find one. Thank you for the assistance. |
For other running into this. Checkout: gliderlabs/docker-alpine#11 (comment) and https://github.com/frol/docker-alpine-glibc/blob/master/Dockerfile One of two things needs to happen for this to work.
The later seems like the better approach, but could take awhile to figure out how to do it. |
@hwangbible do you remember how you resolve your issue at gliderlabs/docker-alpine#11 (comment) ? |
@willfarrell I would suggest to install |
$ ldd /var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1
ldd (0x5630cd73b000)
libcrypt.so.1 => /usr/lib/libcrypt.so.1 (0x7f991cd7f000)
libdl.so.2 => ldd (0x5630cd73b000)
libpthread.so.0 => ldd (0x5630cd73b000)
librt.so.1 => ldd (0x5630cd73b000)
libpam.so.0 => /lib/libpam.so.0 (0x7f991cb73000)
libxml2.so.2 => /usr/lib/libxml2.so.2 (0x7f991c848000)
libm.so.6 => ldd (0x5630cd73b000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f991c4f8000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f991c2e5000)
libc.so.6 => ldd (0x5630cd73b000)
libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x7f991c0d4000)
libz.so.1 => /lib/libz.so.1 (0x7f991bebe000) For what I'm understanding, |
Is it possible to have IBM compile the binary against musl libc? |
Closing the issue as IBM ODBC/CLI driver is not supported on Alpine Linux and hence ibm_db can not work on Alpine. Checked with Kelly Rodger at IBM and he confirmed that Alpine Linux is not a supported platform for DB2. Thanks. |
If not alpine what is a super lightweight linux container docker image to use? |
@kentonbmax You can use Ubuntu docker image. Thanks. |
Hey, I had difficulty with the ubuntu image and tried the oracle linux image (smaller). it works but am getting license issue that I commented on in a different issue. |
@kentonbmax Could you please paste the error about license issue here? that would help to understand the problem. Also, let me know your database is on which OS? License file is required only if your DB2 server is installed on z/OS or i-Series systems. Thanks. |
DB Server: i-series. errors: [], |
@kentonbmax You need to copy db2connect license file under ibm_db/installer/clidriver/license folder to access i-Series server using ibm_db. Please contact your i-series system adminstrator or IBM support to get the db2connect license file. The license file name should be like db2con*.lic . Thanks. |
Hello, I copied my lic file
to ./node_modules/ibm_db/installer/clidriver/license. This is the same
license we use with windows and the .net core nuget package. Same error.
…On Thu, May 24, 2018 at 11:59 AM Bimal Kumar Jha ***@***.***> wrote:
@kentonbmax <https://github.com/kentonbmax> You need to copy db2connect
license file under ibm_db/installer/clidriver/license folder to access
i-Series server using ibm_db. Please contact your i-series system
adminstrator or IBM support to get the db2connect license file. The license
file name should be like db2con*.lic . Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#217 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APEoRImSer-fxykAtaPwkxwphko900pLks5t1tjagaJpZM4LlHty>
.
|
@kentonbmax First check the db2level output of your windows system where this .lic file was working. If it is not DB2 V10.5, please get a db2 v10.5 license file. |
My .lic says I have v. 11.1. This file is the same that gets copied with
our .net core nuget setup to production. We setup a env variable for that
environment. Is setting up an env var in linux necessary?
…On Fri, Jun 1, 2018 at 3:01 AM Bimal Kumar Jha ***@***.***> wrote:
@kentonbmax <https://github.com/kentonbmax> First check the db2level
output of your windows system where this .lic file was working. If it is
not DB2 V10.5, please get a db2 v10.5 license file.
Second, delete existing clidriver/cfgcache/conlic.bin file and then try
connection if you have the correct license file. On windows, we can find
cfgcache folder under C:\ProgramData\IBM\DB2<install_copy> folder.
If you are still facing issue, please update the connection string in
ibm_db\installer\testODBCConnection.sh file near line no 29 for db2cli
validate command and execute testODBCConnection.sh file. If it fails,
share the generated files for investigation.
Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#217 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APEoREwPUV7QVw6ZU_G1dqPzL0AdlAvNks5t4ObjgaJpZM4LlHty>
.
|
@kentonbmax If you already have Db2 V11.1 installed in your system, please share the output of "db2level" command. |
We are at O/S 7.2 with database group 21. Output: DB21085I This instance
or install (instance name, where applicable: "*") uses
"64" bits and DB2 code release "SQL11012" with level identifier "0203010F".
Informational tokens are "DB2 v11.1.2020.1393", "s1706091900",
"DYN1701310100WIN64", and Fix Pack "2".
…On Mon, Jun 4, 2018 at 10:13 AM Bimal Kumar Jha ***@***.***> wrote:
@kentonbmax <https://github.com/kentonbmax> If you already have Db2 V11.1
installed in your system, please share the output of "db2level" command.
The v11.1 license file will not work with ibm_db, but you can tell ibm_db
to use pre-installed db2 v11.1 by setting IBM_DB_HOME env variable. Setting
up the env var in linux is not necessary. Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#217 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APEoRK4W801n0LMsTZGQ57sONniAtrVjks5t5UCIgaJpZM4LlHty>
.
|
Also tried this approach using oracle/linux. I also copied the .lic to the
/clidriver/license folder. The build is successful from the npm install but
I get the same error on connect with or without the .lic file. Do you maybe
have a linux image on Dockerhub that has the driver already setup?
RUN mkdir /clidriver
COPY ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz /clidriver
RUN tar -xzf
/clidriver/ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz
ENV IBM_DB_HOME "/clidriver"
…On Mon, Jun 4, 2018 at 10:33 AM Kenton Bocock ***@***.***> wrote:
We are at O/S 7.2 with database group 21. Output: DB21085I This instance
or install (instance name, where applicable: "*") uses
"64" bits and DB2 code release "SQL11012" with level identifier "0203010F".
Informational tokens are "DB2 v11.1.2020.1393", "s1706091900",
"DYN1701310100WIN64", and Fix Pack "2".
On Mon, Jun 4, 2018 at 10:13 AM Bimal Kumar Jha ***@***.***>
wrote:
> @kentonbmax <https://github.com/kentonbmax> If you already have Db2
> V11.1 installed in your system, please share the output of "db2level"
> command.
> The v11.1 license file will not work with ibm_db, but you can tell ibm_db
> to use pre-installed db2 v11.1 by setting IBM_DB_HOME env variable. Setting
> up the env var in linux is not necessary. Thanks.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#217 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/APEoRK4W801n0LMsTZGQ57sONniAtrVjks5t5UCIgaJpZM4LlHty>
> .
>
|
@kentonbmax Please note that the license file that you have is for db2 v11.1 and it will not work with ibm_db which uses DB2 v10.5. You need a db2 v10.5 db2connect license file for ibm_db. The ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz that you are trying to use does not come with include folder and it do not have any header files. So, you can not use it with any other open source driver like node-ibm_db or python-ibm_db. Its a wrong version of clidriver that get packaged with .net-core without header files. If ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz would have include folder, then you should be able to use ibm_db with this clidriver and current license file. Hope, you'll understand the difference. Please tell .net-core team to use clidriver from Unset IBM_DB_HOME using : export IBM_DB_HOME= Thanks. |
I will try that. I still fail to understand why ibm_db works on my windows
10 machine and not a linux container.
…On Tue, Jun 5, 2018 at 1:39 AM Bimal Kumar Jha ***@***.***> wrote:
@kentonbmax <https://github.com/kentonbmax> Please note that the license
file that you have is for db2 v11.1 and it will not work with ibm_db which
uses DB2 v10.5. You need a db2 v10.5 db2connect license file for ibm_db.
The ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz that you are
trying to use does not come with include folder and it do not have any
header files. So, you can not use it with any other open source driver like
node-ibm_db or python-ibm_db. Its a wrong version of clidriver that get
packaged with .net-core without header files. If
ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz would have
include folder, then you should be able to use ibm_db with this clidriver
and current license file. Hope, you'll understand the difference.
Please tell .net-core team to use clidriver from
https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli
or keep include folder too with the clidriver that they ship with .net-core.
Unset IBM_DB_HOME using : export IBM_DB_HOME=
npm install ibm_db
get license file for DB2 V10.5fp6
copy 10.5 license file under ibm_db/installer/clidriver/license folder
Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#217 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/APEoRFvqzFZXdoMVz21rIYWAY2W56Pqyks5t5hmEgaJpZM4LlHty>
.
|
Can you please confirm what could lead this to work when running my
application on windows 10 and not on linux? I do have Inavigator installed
on windows 10. I wanted to add that I have not had to include a license file in the license folder when running on windows 10.
…On Tue, Jun 5, 2018 at 8:14 AM Kenton Bocock ***@***.***> wrote:
I will try that. I still fail to understand why ibm_db works on my windows
10 machine and not a linux container.
On Tue, Jun 5, 2018 at 1:39 AM Bimal Kumar Jha ***@***.***>
wrote:
> @kentonbmax <https://github.com/kentonbmax> Please note that the license
> file that you have is for db2 v11.1 and it will not work with ibm_db which
> uses DB2 v10.5. You need a db2 v10.5 db2connect license file for ibm_db.
>
> The ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz that you
> are trying to use does not come with include folder and it do not have any
> header files. So, you can not use it with any other open source driver like
> node-ibm_db or python-ibm_db. Its a wrong version of clidriver that get
> packaged with .net-core without header files. If
> ibm_data_server_driver_for_odbc_cli_linuxx64_v11.1.tar.gz would have
> include folder, then you should be able to use ibm_db with this clidriver
> and current license file. Hope, you'll understand the difference.
>
> Please tell .net-core team to use clidriver from
> https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli
> or keep include folder too with the clidriver that they ship with .net-core.
>
> Unset IBM_DB_HOME using : export IBM_DB_HOME=
> npm install ibm_db
> get license file for DB2 V10.5fp6
> copy 10.5 license file under ibm_db/installer/clidriver/license folder
>
> Thanks.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#217 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/APEoRFvqzFZXdoMVz21rIYWAY2W56Pqyks5t5hmEgaJpZM4LlHty>
> .
>
|
@kentonbmax There seems some confusion. Lets talk about Windows first. You have not shared the complete output of
Seems, you are using DB2 v11.1.2 on Windows and you have license file for DB2 v11.1.2 too. Once you connect using the license file to i-Series, license check happens after 7 days only from that client. |
It's prolly a good idea to support musl Alpine environment... It's really tiny and awesome |
@willfarrell what did you end up doing? I'm facing the same issue and would prefer to use the alpine image as it is the company standard. |
node-ibm_db works on Linux-x86-64 images of amazonlinux, ubuntu and debian. It can not work on alpile as IBM Db2 Client Installers are not compiled on alpine linux using |
+1 for adding Alpine support. |
Another +1 for alpine support.. If your goal is to build secure containers, ubuntu and debian fail to meet the requirement with all the bloat they include. Install scan toolsSee https://github.com/aquasecurity/trivyRUN apk add curl This will fail the docker image build if there are problemsRUN trivy filesystem --exit-code 1 --no-progress / ^^ This is secure, run the same on the other base images, and you will see all sorts of security vulnerabilities. |
I'm getting the following error while attempting to run the example on alpine.
The file does exist at:
/var/www/node_modules/ibm_db/installer/clidriver/lib/libdb2.so.1
.Source:
Dockerfile
app.js
The text was updated successfully, but these errors were encountered: