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
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!
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
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
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/
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?
2 weeks ago
Hi all,
I am also facing similar issue . is there any working alternate solution ?
2 weeks ago
Hi,
Yes! A workaround we discovered is to wrap the pyodbc script in some error handling code. Our particular script was throwing some exceptions/outputs which were ignored by Databricks in a notebook, as well as when installed as a global init script. Apparently....the cluster could not ignore the exceptions when the pyodbc script was installed in the Volume. Once the script in the Volume stopped "outputting".....the shared cluster was able to read it and start up.
Hope that helps you!
Benni
a week ago
Hello all,
Below workaround was efficient to me
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 15.4 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
If you are using from ADF use below volumes option and provide ADF SP access to volume path
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group