Sample Header Ad - 728x90

NetSuite 64bit ODBC Driver installation on Ubuntu 18.04 Cluster giving error:- Can't open lib '/opt/netsuite/odbcclient/lib64/ivoa27.so

0 votes
1 answer
1096 views
Have been running around this issue since 2-3 days now with no luck. Hope someone guides me and help resolve this issue here. I am running a Python application from /home/admin/app/example.py directory in a 3 node Ubuntu 18.04 clustered environment which is supposed to connect to NetSuite via ODBC and read list of tables. The code and directory setup is same across all 3 nodes. There's a load balancer routing request to all these 3 nodes. Here's example how the connection is made via PyODBC module: import pyodbc cnxn = pyodbc.connect('DSN=NetSuite;UID=user;PWD=pass'.format(dsn, uid, pwd), autocommit=True) cursor=cnxn.cursor() tables_list = [] for row in cursor.tables(): tables_list.append(row.table_name) print (tables_list) However, while running the python application on cluster, I am always getting error as:- **Can't open lib '/opt/netsuite/odbcclient/lib64/ivoa27.so**; even though the driver file, all its dependencies (via ldd command) and all the path variables i.e. $LD_LIBRARY_PATH, $ODBCINI and $OASDK_ODBC_HOME exists and is set to be available system-wide (added under /etc/environment file) as below on all the 3 nodes: > PYTHON_APP_HOME=/home/admin/app/ > LD_LIBRARY_PATH="/opt/netsuite/odbcclient/lib64" > ODBCINI="/opt/netsuite/odbcclient/odbc64.ini" > OASDK_ODBC_HOME="/opt/netsuite/odbcclient/lib64" Here's the output from "ldd" command for driver dependencies: -rwxr-xr-x 1 root root 3277375 Jul 25 16:03 ivoa27.so /opt/netsuite/odbcclient/lib64$ ldd /opt/netsuite/odbcclient/lib64/ivoa27.so linux-vdso.so.1 (0x00007fff401a2000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fee1d589000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fee1d385000) libicuuc.so.42 => /opt/netsuite/odbcclient/lib64/libicuuc.so.42 (0x00007fee1d12b000) libicudata.so.42 => /opt/netsuite/odbcclient/lib64/libicudata.so.42 (0x00007fee1c0e6000) libpam.so.0 => /lib/x86_64-linux-gnu/libpam.so.0 (0x00007fee1bed8000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fee1bcb9000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fee1b930000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fee1b592000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fee1b37a000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fee1af89000) /lib64/ld-linux-x86-64.so.2 (0x00007fee1db3c000) libaudit.so.1 => /lib/x86_64-linux-gnu/libaudit.so.1 (0x00007fee1ad60000) libcap-ng.so.0 => /lib/x86_64-linux-gnu/libcap-ng.so.0 (0x00007fee1ab5b000) Below is how the steps were performed as per Netsuite driver README.txt instructions and the ODBC driver is setup similarly across all the 3 nodes on Ubuntu 18.04 OS. 1) The Netsuite 64bit Linux driver files/folders are unpacked and copied at location: **$cd /opt/netsuite/odbcclient/***. This entire dir,sub-dir & files within have both r+x permissions. 2) Installed libraries **$sudo apt install unixodbc && apt-get install unixodbc-dev** 3) Executed script/command provided by Netsuite from dir /opt/netsuite/odbcclient:- **$source oaodbc64.sh** (since it's a bash shell). This sets up the same variables as shown above. 4) From the same directory/folder ran below command for registering it as system-wide Driver: > $**sudo odbcinst -i -d -f /opt/netsuite/odbcclient/odbcinst.ini** which returned message as: > odbcinst: Driver installed. Usage count increased to 1. > Target directory is /etc > odbcinst: Driver installed. Usage count increased to 1. > Target directory is /etc 5) Then ran below command also for installing it as system DSN:- > $**sudo odbcinst -i -s -l -f /opt/netsuite/odbcclient/odbc64.ini** After this, checked /etc directory where both odbc.ini and odbcinst.ini files where created/registered. Both *.ini files were also given execute permissions to all. -rwxr-xr-x 1 root root 500 Jul 24 10:31 odbc.ini -rwxr-xr-x 1 root root 199 Jul 24 10:31 odbcinst.ini $odbcinst -j unixODBC 2.3.4 DRIVERS............: /etc/odbcinst.ini SYSTEM DATA SOURCES: /etc/odbc.ini FILE DATA SOURCES..: /etc/ODBCDataSources USER DATA SOURCES..: /opt/netsuite/odbcclient/odbc64.ini SQLULEN Size.......: 8 SQLLEN Size........: 8 SQLSETPOSIROW Size.: 8 $odbcinst -q -d [ODBC Drivers] [NetSuite ODBC Drivers 8.1] $odbcinst -q -s [NetSuite] [ODBC] I am also able to connect from each individual nodes via isql and also by running the example.py via python shell locally. > $**isql -v 'NetSuite' 'user' 'pass'** +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> But when running the same on cluster, it gives same error always. Please help. I am sure am missing something. Here's the output of odbc.ini and odbcinst.ini files from /etc directory: /etc$ more odbcinst.ini [ODBC Drivers] NetSuite ODBC Drivers 8.1=Installed UsageCount=1 [NetSuite ODBC Drivers 8.1] APILevel=1 ConnectFunctions=YYN Driver=ivoa27.so DriverODBCVer=03.52 FileUsage=0 SQLLevel=1 UsageCount=1 /etc$ more odbc.ini [ODBC Data Sources] NetSuite=NetSuite ODBC Drivers 8.1 [NetSuite] Driver=/opt/netsuite/odbcclient/lib64/ivoa27.so Description=Connect to your NetSuite account Host=XXXXX.connect.api.netsuite.com Port=1708 ServerDataSource=NetSuite.com Encrypted=1 Truststore=/opt/netsuite/odbcclient/cert/ca3.cer CustomProperties=AccountID=XXXXX;RoleID=XXXX [ODBC] Trace=0 IANAAppCodePage=4 TraceFile=odbctrace.out TraceDll=/opt/netsuite/odbcclient/lib64/ddtrc27.so InstallDir=/opt/netsuite/odbcclient Tried below other things that didn't work: 1) Added ODBC variable paths within .profile,.bashrc ,/etc/profile,/etc/bash.bashrc other than /etc/environment. 2) Changed the owner of /lib64/ folder and all files within it and *.ini files under /etc from root to admin. 3) By creating symbolic links: sudo ln -s /etc/odbcinst.ini /usr/local/etc/odbcinst.ini sudo ln -s /etc/odbc.ini /usr/local/etc/odbc.ini Thanks !!
Asked by ManiK (111 rep)
Jul 27, 2020, 06:12 AM
Last activity: Nov 22, 2022, 08:42 PM