Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error connecting with Simba Spark driver: Could not load shared library, all attempted paths (<NULL>) failed #897

Open
wurli opened this issue Feb 12, 2025 · 2 comments

Comments

@wurli
Copy link

wurli commented Feb 12, 2025

Hi,

I'm trying to connect to Databricks via the Simba Spark ODBC driver, but I'm getting this error:

DBI::dbConnect(
  odbc::odbc(),
  Driver = "Simba Spark ODBC Driver",
  Host = # My host,
  Port = 443,
  Protocol = "HTTPS",
  HTTPPath = # my HTTP path,
  SSL = 1,
  ThriftTransport = 2,
  AuthMech = 3,
  UID = "token",
  PWD = # my access token
)
#> ! nanodbc/nanodbc.cpp:1138: 00000
#> [Simba][ODBC] (11560) Unable to locate SQLGetPrivateProfileString function: [Simba][Support] (50483) Could 
#> not load shared library, all attempted paths (<NULL>) failed 

I'm 99% sure odbc is picking up the correct path to the driver:

odbc::odbcListDrivers()
#>                      name               attribute                                                      value
#> 1            ODBC Drivers Simba Spark ODBC Driver                                                  Installed
#> 2 Simba Spark ODBC Driver             Description                                    Simba Spark ODBC Driver
#> 3 Simba Spark ODBC Driver                  Driver /Library/simba/spark/lib/libsparkodbc_sb64-universal.dylib

/Library/simba/spark/lib/libsparkodbc_sb64-universal.dylib definitely exists.

Apologies if this is an upstream issue - diagnosing these sorts of things is a bit beyond my current abilities. Thanks for your help!

devtools::session_info()
─ Session info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.4.2 (2024-10-31)
 os       macOS Sequoia 15.2
 system   aarch64, darwin20
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Europe/London
 date     2025-02-12
 pandoc   NA

─ Packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version date (UTC) lib source
 bit           4.0.5   2022-11-15 [1] CRAN (R 4.4.0)
 bit64         4.0.5   2020-08-30 [1] CRAN (R 4.4.0)
 blob          1.2.4   2023-03-17 [1] CRAN (R 4.4.0)
 brio          1.1.5   2024-04-24 [1] CRAN (R 4.4.0)
 cachem        1.1.0   2024-05-16 [1] CRAN (R 4.4.0)
 cli           3.6.3   2024-06-21 [1] CRAN (R 4.4.0)
 data.table    1.15.4  2024-03-30 [1] CRAN (R 4.4.0)
 DBI           1.2.3   2024-06-02 [1] CRAN (R 4.4.0)
 desc          1.4.3   2023-12-10 [1] CRAN (R 4.4.0)
 devtools      2.4.5   2022-10-11 [1] CRAN (R 4.4.0)
 digest        0.6.36  2024-06-23 [1] CRAN (R 4.4.0)
 ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.4.0)
 fastmap       1.2.0   2024-05-15 [1] CRAN (R 4.4.0)
 fs            1.6.4   2024-04-25 [1] CRAN (R 4.4.0)
 glue          1.7.0   2024-01-09 [1] CRAN (R 4.4.0)
 hms           1.1.3   2023-03-21 [1] CRAN (R 4.4.0)
 htmltools     0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0)
 htmlwidgets   1.6.4   2023-12-06 [1] CRAN (R 4.4.0)
 httpuv        1.6.15  2024-03-26 [1] CRAN (R 4.4.0)
 later         1.3.2   2023-12-06 [1] CRAN (R 4.4.0)
 lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.4.0)
 magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.4.0)
 memoise       2.0.1   2021-11-26 [1] CRAN (R 4.4.0)
 mime          0.12    2021-09-28 [1] CRAN (R 4.4.0)
 miniUI        0.1.1.1 2018-05-18 [1] CRAN (R 4.4.0)
 odbc          1.4.2   2024-01-22 [1] CRAN (R 4.4.0)
 pkgbuild      1.4.4   2024-03-17 [1] CRAN (R 4.4.0)
 pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 4.4.0)
 pkgload       1.4.0   2024-06-28 [1] CRAN (R 4.4.0)
 profvis       0.3.8   2023-05-02 [1] CRAN (R 4.4.0)
 promises      1.3.0   2024-04-05 [1] CRAN (R 4.4.0)
 purrr         1.0.2   2023-08-10 [1] CRAN (R 4.4.0)
 R6            2.5.1   2021-08-19 [1] CRAN (R 4.4.0)
 Rcpp          1.0.12  2024-01-09 [1] CRAN (R 4.4.0)
 remotes       2.5.0   2024-03-17 [1] CRAN (R 4.4.0)
 rlang         1.1.4   2024-06-04 [1] CRAN (R 4.4.0)
 rprojroot     2.0.4   2023-11-05 [1] CRAN (R 4.4.0)
 sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.4.0)
 shiny         1.8.1.1 2024-04-02 [1] CRAN (R 4.4.0)
 stringi       1.8.4   2024-05-06 [1] CRAN (R 4.4.0)
 stringr       1.5.1   2023-11-14 [1] CRAN (R 4.4.0)
 testthat      3.2.1.1 2024-04-14 [1] CRAN (R 4.4.0)
 urlchecker    1.0.1   2021-11-30 [1] CRAN (R 4.4.0)
 usethis       2.2.3   2024-02-19 [1] CRAN (R 4.4.0)
 vctrs         0.6.5   2023-12-01 [1] CRAN (R 4.4.0)
 withr         3.0.0   2024-01-16 [1] CRAN (R 4.4.0)
 xtable        1.8-4   2019-04-21 [1] CRAN (R 4.4.0)

 [1] /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@wurli
Copy link
Author

wurli commented Feb 12, 2025

Just updated to the dev version of {odbc} and the error persists but has some new information:

Error in `DBI::dbConnect()`:
! ODBC failed with error 00000 from [Simba][ODBC][Simba][Support].
✖  (11560) Unable to locate SQLGetPrivateProfileString function: (50483) Could not load shared library, all
  attempted paths (<NULL>, "libodbcinst.dylib") failed
ℹ From [nanodbc/nanodbc.cpp:1150](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#).

@wurli
Copy link
Author

wurli commented Feb 14, 2025

Finally managed to get this working. It seems the issue was that the Simba Spark driver couldn't find the system libodbcinst.dylib. To fix this, I had to locate the file on my machine and tell the spark driver where to find it. This meant adding the following line to /Library/simba/spark/lib/simba.sparkodbc.ini:

ODBCInstLib=/opt/homebrew/lib/libodbcinst.dylib

I can now connect as expected. For now I'll leave this open, as perhaps this configuration/setup is something that {odbc} could take care of for users in the future. If it feels out of scope for the package, please feel free to close this as complete :)

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant