[unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libmdbodbcw.so' : file not found

Server:
Oracle Linux 8.5

After installing “unixODBC” and downloading the files “libmdbodbca.so” and “libmdbodbcw.so” to the directory “/usr/local/lib”.

Changed “/etc/odbc.ini” with connection information and parameter “DRIVER = /usr/local/lib/libmdbodbcw.so”.

But the error is occurring:

iusql -v MongoDBODBC01

[unixODBC][Driver Manager]Can’t open lib ‘/usr/local/lib/libmdbodbcw.so’ : file not found
[ISQL]ERROR: Could not SQLDriverConnect

ls -ltr /usr/local/lib/

-rwxrwxrwx. 1 root root 35557176 Jul 12 23:21 libmdbodbca.so
-rwxrwxrwx. 1 root root 35557632 Jul 12 23:21 libmdbodbcw.so

Hi @Rafael_Carvalho1 ,

The . at the end of the permissions suggest SElinux is at play.

I would generally set SELinux permissive, test it, revert to enforcing and then work out what context needs to be applied.

There are ways with more finesse I’m sure, but hopefully this can help.

I did the total deactivation of SELINUX and the same error persisted.

Okay could be missing some dependencies.

Try ldd /usr/local/lib/libmdbodbcw.so and you’ll likely see some missing shared libraries.

I’m guessing it will be libssl1.0.0 but could be others.

2 Likes

this might be related to an older prodecure you might be following. newer systems seems to do it like this: driver name and file path are set in odbcinst.ini, then that name is used in odbc.ini, and also odbcinst command is executed at last. check this link and see if it applies to your issue:
[zLinux] RHEL and SUSE: Configuring an Oracle datasource to use ODBC - IBM Documentation

Or, it might just be an issue of using spaces in that line. examples in this following link do not use spaces:
Configure the ODBC Source of Data (Linux) (oracle.com)

ldd /usr/local/lib/libmdbodbcw.so
return:
linux-vdso.so.1 (0x00007ffdcb09f000)
librt.so.1 => /lib64/librt.so.1 (0x00007f9a071fe000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f9a06fde000)
libm.so.6 => /lib64/libm.so.6 (0x00007f9a06c5c000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f9a06a07000)
libssl.so.10 => not found
libcrypto.so.10 => not found
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f9a06672000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f9a0646e000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f9a06255000)
libc.so.6 => /lib64/libc.so.6 (0x00007f9a05e8f000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9a094b4000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f9a05ba5000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f9a0598e000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f9a0578a000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f9a05579000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f9a05375000)
libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007f9a04e8c000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f9a04c74000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f9a04a49000)
libz.so.1 => /lib64/libz.so.1 (0x00007f9a04831000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f9a045ad000)

Than i do:
yum whatprovides libcrypto.so.10
Last metadata expiration check: 1:42:20 ago on Wed 21 Dec 2022 09:07:32 AM -03.
compat-openssl10-1:1.0.2o-3.el8.i686 : Compatibility version of the OpenSSL library
Repo : ol8_appstream
Matched from:
Provide : libcrypto.so.10

compat-openssl10-1:1.0.2o-4.el8_6.i686 : Compatibility version of the OpenSSL library
Repo : ol8_appstream
Matched from:
Provide : libcrypto.so.10

ldd /usr/local/lib/libmdbodbcw.so
linux-vdso.so.1 (0x00007fffb2172000)
librt.so.1 => /lib64/librt.so.1 (0x00007fdd07316000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fdd070f6000)
libm.so.6 => /lib64/libm.so.6 (0x00007fdd06d74000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007fdd06b1f000)
libssl.so.10 => /lib64/libssl.so.10 (0x00007fdd068b0000)
libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007fdd0644e000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fdd060b9000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fdd05eb5000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fdd05c9c000)
libc.so.6 => /lib64/libc.so.6 (0x00007fdd058d6000)
/lib64/ld-linux-x86-64.so.2 (0x00007fdd095cc000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007fdd055ec000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007fdd053d5000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fdd051d1000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007fdd04fc0000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007fdd04dbc000)
libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007fdd048d3000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fdd046bb000)
libz.so.1 => /lib64/libz.so.1 (0x00007fdd044a3000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fdd04278000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007fdd03ff4000)

Now I don’t have the error anymore, thanks!

2 Likes

You’re welcome.

I haven’t looked into why linux gives the File Not Found when the shared library has a missing dependency, just have hit it often enough in the past. Had to rule out SELinux first, although it probably gives a different error in any case.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.