UC, pyodbc, Shared Cluster, and :Can't open lib 'ODBC Driver 17 for SQL Server' : file not found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2024 01:42 PM
Hey Databricks!
Trying to use the pyodbc init script in a Volume in UC on a shared compute cluster but receive error: "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)"). I followed the instructions here which seem straightforward: Shared Clusters in Unity Catalog | Databricks Blog
1) pyodbc-install.sh is uploaded in a Volume 2) the shared cluster is able to navigate to the Volume to select the init script 3) the Databricks runtime is 13.3 LTS 4) the Allowlist has been updated to allow the init script 5) the cluster spins up with no problem 6) the pyodbc==5.2.0 library has been installed (although it made no difference) but 7) it errors with "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")
Seems like it can't read or find the pyodbc file so doesn't find any drivers. Although the cluster can navigate to it.
Is it a permissions issue? What am I doing wrong?
Thanks!
Benedetta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 08:23 AM
Hi @Benni ,
Ensure that the ODBC Driver 17 for SQL Server is installed on the Databricks cluster, you can verify this by running the following command in a notebook cell on the cluster to check if the driver is available in the system:
!ls /opt/microsoft/msodbcsql17/lib64/
if the msodbcsql17 library is missing, it indicates the driver was not installed properly.
Let me know if you need further assistance!
-------------------
Alfonso Gallardo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2024 11:14 AM
Hi @agallard2
Thanks for you reply - but it's not installed on the cluster.....because it seems like it's not reading the pyodbc init script (which also has the msodbcsql17 driver in it) in the Volume in the Unity Catalog. Why can't it read the file from the Volume?. If I install the init script globally, and use a single use cluster that works. I'm trying to make a shared cluster that can connect to Azure SQL Database (among other things), and the instructions say to place the init script in a Volume when it's Unity Catalog.
Thanks!
Benedetta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 09:36 AM
Hey Databricks - can you help me understand why the init script in the Volume doesn't work for a shared cluster?
Thanks!
Benedetta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2024 01:38 PM
May you should have a look here for global init script:
https://learn.microsoft.com/en-us/azure/databricks/init-scripts/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2024 06:29 AM
Hi h_h_ak,
Sure, sure. I've already done that. We can't use global init scripts with Shared Clusters and UC. Seems it has to be installed in Volume or cloud storage. How come mu shared cluster can't read the pyodbc script in the volume?
![](/skins/images/582998B45490C7019731A5B3A872C751/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/582998B45490C7019731A5B3A872C751/responsive_peak/images/icon_anonymous_message.png)