×
Back to Geneos FAQ
Internal documentation only
This page has been marked as draft.
How to fix the ODBC Connection Issues to the SQL Server
Problems / Details (1)
The following issues when trying to connect to a SQL Server Database using ODBC Driver 17 for SQL Server.
The gateway log is showing the following error:
2023-09-22 17:03:28.125+0200 WARN: Event:DatabaseLogging 1695395008.125318 DatabaseLogging /geneos/gateway[@name="JTEST"] Connection Failed There was a problem connecting => db error msg: 01000 [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.4.1' : file not found, db error code: 0 (type: DBMSAPI) [0] 01000 [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.4.1' : file not found DBMSAPI
Even though this file exists:
[admin@server bin]$ ls -l /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.4.1
-rwxr-xr-x. 1 root root 2061248 Apr 25 18:17 /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.4.1
Is correctly assigned in the odbcinst.ini file:
[admin@server bin]$ cat /opt/microsoft/msodbcsql17/lib64/odbcinst.ini
[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.4.1
And the relevant environment variables are set in the Geneos start up environment:
SQLSERVER_LIB=/opt/microsoft/msodbcsql17/lib64
LD_LIBRARY_PATH=${SQLSERVER_LIB}:.:${LD_LIBRARY_PATH}
ODBCHOME=${SQLSERVER_LIB}
ODBCSYSINI=${SQLSERVER_LIB}
ODBCINSTINI=odbcinst.ini
GENEOS_MSSQL_DRIVER='ODBC Driver 17 for SQL Server'
The DB instance is reachable:
[admin@serverbin]$ telnet GENEOS_DB_PROD.LDN.EMEA 50503
Trying XX.XXX.XXX.XX ...
Connected to GENEOS_DB_PROD.LDN.EMEA
Escape character is ^].
Possible Solution
- The Relevant Variables must follow this code by exporting all the variable sets.
export SQLSERVER_LIB=/opt/microsoft/msodbcsql17/lib64
export LD_LIBRARY_PATH=${SQLSERVER_LIB}
export ODBCHOME=${SQLSERVER_LIB}
export ODBCSYSINI=${SQLSERVER_LIB}
export ODBCINSTINI=odbcinst.ini
export GENEOS_MSSQL_DRIVER='ODBC Driver 17 for SQL Server'
Installing the Microsoft ODBC DRIVER For SQL SERVER
Problems / Details
Connection Failed There was a problem connecting => db error msg: 01000 [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.10.so.4.1' : file not found
WARN: SQL-TOOLKIT[Gateway Audit] Fail - 01000 [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found(100)
- This might be that the EL8 OS was running but had not used an EL8 Specific Gateway Installation.
Possible Solutions (2)
- The RHEL version must be compatible with the Geneos Version. Geneos Release Notes - Compatibility Matrix
- In this case, Geneos Version 6.1.2 was compatible with the MS ODBC Driver 17. Geneos Release Notes - MS ODBC Driver 17
- There are different versions of Geneos software built for EL7, EL8, and EL9, with specific library dependencies, in particular openssl, and libcurl.
References
["Geneos"]
["Geneos > Gateway"]
["FAQ"]