ODBC fails on Apple Silicon
I have a problem with connecting to IRIS via ODBC on Apple Silicon.
I installed unixodbc with brew, and downloaded ODBC-2023.1.0.229.0-macos.tar.gz from the community github repo.
After setting up odbc.ini so that libirisodbcur6435.so that was just downloaded is used as the driver, isql fails as follows:
$ isql -v sampleodbc
[08S01][unixODBC][Iris ODBC][State : 08S01][Native Code 459]
[libirisodbcur6435.so]
Connection via irisconnect failed:
getaddrinfo(, , 0, 0) failed in s_TCPConnect, reason = nodename nor servname provided, or not known.
[ISQL]ERROR: Could not SQLConnect
Can anyone tell me what I am doing wrong ? The macOS version is Ventura 13.3.1 (a).
Thanks.
Product version: IRIS 2023.1
$ZV: IRIS for UNIX (Apple macOS for Apple Silicon) 2023.1 (Build 229U) Fri Apr 14 2023 17:16:20 EDT
I suggest that you open a Support ticket with the WRC if you don't get a good answer quickly here.
I do not have an Apple Silicon Mac but I have worked with the ODBC driver on various Unix platforms and these sort of problems are typically because of where the libirisodbcur6435.so driver looks to get its configuration files vs. where the driver manager (in this case, unixODBC) looks for its configuration. Also, how have you installed the libirisodbcur6435.so driver? Is it part of a "stand-alone" ODBC kit or part of a server installation?
You can determine where unixODBC tries to find its configuration files by running:
which on my Intel Mac system returns:
Meaning that it looks to find its DSN configuration in /opt/local/etc/odbc.ini. I have found that the odbc driver sometimes wants to get its configuration information from a different location. You typically can either create a symbolic link to that file (I will explain below how to find that) or by setting the ODBCINI environment variable to point to the odbc.ini file that the driver manager us using it which will force libirisodbcur6435.so to use that file.
To determine where libirisodbcur6435.so driver is searching, you can use the following in one macOS terminal:
while running your isql command from above which will generate output looking like this:
Meaning that my driver (installed in /Applications/ISC/mikebsql) is looking for a file /Applications/ISC/mikebsql/mgr/irisodbc.ini
@Michael Burstin to clarify, is it more accurate to say that the driver is looking for settings in all the .ini files listed in the above output? And do all the file locations output by
odbcinst -j
need to be present in thefs_usage isql
output?I installed the driver by downloading ODBC-2023.1.0.229.0-macos.tar.gz from the community github repo. I am not sure *-macos.tar.gz is for Apple Silicon.
odbcinst -j gives:
$ odbcinst -j
unixODBC 2.3.11
DRIVERS............: /opt/homebrew/etc/odbcinst.ini
SYSTEM DATA SOURCES: /opt/homebrew/etc/odbc.ini
FILE DATA SOURCES..: /opt/homebrew/etc/ODBCDataSources
USER DATA SOURCES..: /Users/horita/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
and sudo fs_usage isql | grep ini :
so it looks like the driver is reading the correct configuration files.
The log file shows:
and this looks like the problem. The error was the same in both HOST=localhost and HOST=127.0.0.1.