microsoft/homebrew-mssql-release

Problem installing macOS

MikeB2019x opened this issue · 4 comments

When installing on:

  System Version:	macOS 10.15.2 (19C57)
  Kernel Version:	Darwin 19.2.0

I did:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update

Then I get the following error:

(base) ...@MAC-2019-16-012 ~ % HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=Y brew install msodbcsql17 mssql-tools
==> Installing msodbcsql17 from microsoft/mssql-release
==> Downloading https://download.microsoft.com/download/1/9/A/19AF548A-6DD3-4B48-88DC-724E9ABCEB9A/msodbcsql-17.5.2.1.tar.gz
Already downloaded: /Users/.../Library/Caches/Homebrew/downloads/b8402326ee28ebb9b25b5c98a4fcfe0ecad17cd385a8ccb3ef5bedb0e097c2e0--msodbcsql-17.5.2.1.tar.gz
==> odbcinst -u -d -n "ODBC Driver 17 for SQL Server"
Last 15 lines from /Users/.../Library/Logs/Homebrew/msodbcsql17/01.odbcinst:
2020-06-13 23:48:59 -0400

odbcinst
-u
-d
-n
"ODBC Driver 17 for SQL Server"

odbcinst: SQLRemoveDriver failed with Unable to find component name.

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/microsoft/homebrew-mssql-release/issues

The location of files is:

(base) ...@MAC-2019-16-012 ~ %  odbcinst -j                                                                  
unixODBC 2.3.7
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /Users/.../.odbc.ini     <===== this file is NOT created ie. does not exist
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

This is the content of 'usr/local/etc/odbcinst.ini' so does that mean that 'odbcinst' is not seeing this file e.g. expects it in another location:

[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/usr/local/lib/libmsodbcsql.17.dylib
UsageCount=1

I have followed the guide here. I have also looked at and attempted to follow the guidance offered at issue #42.

Note that the error above and the comments in the latter issue mention the uninstall using 'odbcinst -u -d -n "ODBC Driver 17 for SQL Server" '. It is unclear what the end result of this command is supposed do. The command is for an uninstall but the comments suggest something has to added as well.

I'm pretty confused at this point. Note that I have wrestled with installation of these drivers before and posted my results on Stack. It looks like things have changed since then. Any clarification would be welcome particularly:

  • what does successful installation look like ie. what files should be located where when the process is completed?
  • what should the content of the various .ini files be?

Usage Note:

I recently had to change laptops. I received a fresh laptop with Catalina already installed and my user files transferred. On the old laptop per my Stack post I had driver files in 'Library/ODBC'. The first I learned something was off was the error message below:

~/git/moat-ds/db_connect.py in Connect(self)
     22 
     23         ## Connect
---> 24         conn = pyodbc.connect(url)
     25 
     26         ## This converter allows the reading of some data formats used by MS SQL server

Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")

[SOLVED]
As always, all answers come from Stack. When you do 'odbcinst -j' and it shows you the file list, it's telling you where 'unixodbc' is actually looking for the files it needs. That means the 'User' directory will be the last place it looks ... and it likely won't find anything there BTW.

Anyways, you will note that it's looking in directories '/etc' except that (certainly in macOS Catalina) that directory doesn't exist. So you have to create a symbolic mapping from where the files actually do exist to the path name being used. Do it like so:

sudo ln -s /usr/local/etc/odbcinst.ini /etc/odbcinst.ini
sudo ln -s /usr/local/etc/odbc.ini /etc/odbc.ini

The complete Stack answer is here. Yes, that refers to a previous version and yet the problem continues in the latest version as well.

Don't know what's required in the code in this repo to fix it, but it should be fixed by whoever is contributing to this repo.

hi, I'm on Catalina, /etc does exist on Catalina:

bigmac:~ shui$ cd /etc
bigmac:etc shui$ pwd
/etc
bigmac:etc shui$ uname -a
Darwin bigmac 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
bigmac:etc shui$

yes and no. on my machine it's an 'alias' not a 'folder' (see below). near as I can see there are a bunch of symbolic links. I can go in to it like it was a folder but it is peppered with symbolic links. When I look at the ocdb... files they too are 'alias'. I haven't looked further because now that pyodbc is working I have an even closer deadline to meet. Maybe later.

image

It is normal that /etc is a symlink on macOS, but that does not affect the operation.