-
Notifications
You must be signed in to change notification settings - Fork 109
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
odbc crashes Rstudio if query errors #846
Comments
Hi: Thanks for the report. I am, however, unable to reproduce with both:
Here's my environment for the second:
And my connection:
Can you try:
|
Bumped the ODBC driver, tried the con <- DBI::dbConnect(
odbc::snowflake(),
UID = '[email protected]',
server = server,
authenticator = 'externalbrowser',
driver = "SnowflakeDriver"
interruptible=FALSE
)
DBI::dbGetQuery(con, 'SELECT lkas') Database> DBI::dbGetInfo(con)
$dbname
[1] ""
$dbms.name
[1] "Snowflake"
$db.version
[1] "8.34.0"
$username
[1] "[email protected]"
$host
[1] ""
$port
[1] ""
$sourcename
[1] ""
$servername
[1] "Snowflake"
$drivername
[1] "Snowflake"
$odbc.version
[1] "03.52"
$driver.version
[1] "3.4.1"
$odbcdriver.version
[1] "03.80"
$supports.transactions
[1] TRUE
$supports.catalogs
[1] TRUE
$supports.schema
[1] TRUE
$getdata.extensions.any_column
[1] TRUE
$getdata.extensions.any_order
[1] TRUE Session Info> devtools::session_info()
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
setting value
version R version 4.4.1 (2024-06-14)
os macOS Sonoma 14.6.1
system aarch64, darwin20
ui RStudio
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/London
date 2024-09-18
rstudio 2024.04.2+764 Chocolate Cosmos (desktop)
pandoc NA
─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
! package * version date (UTC) lib source
P arrow 17.0.0.1 2024-08-21 [?] CRAN (R 4.4.1)
P assertthat 0.2.1 2019-03-21 [?] CRAN (R 4.4.0)
P bit 4.0.5 2022-11-15 [?] CRAN (R 4.4.0)
P bit64 4.0.5 2020-08-30 [?] CRAN (R 4.4.0)
P blob 1.2.4 2023-03-17 [?] CRAN (R 4.4.0)
P bonsai 0.3.1 2024-07-23 [?] CRAN (R 4.4.0)
P cachem 1.1.0 2024-05-16 [?] CRAN (R 4.4.0)
P class 7.3-22 2023-05-03 [?] CRAN (R 4.4.1)
P cli 3.6.3 2024-06-21 [?] CRAN (R 4.4.0)
P codetools 0.2-20 2024-03-31 [?] CRAN (R 4.4.1)
P colorspace 2.1-1 2024-07-26 [?] CRAN (R 4.4.0)
P DALEX 2.4.3 2023-01-15 [?] CRAN (R 4.4.0)
P DALEXtra 2.3.0 2023-05-26 [?] CRAN (R 4.4.0)
P data.table 1.16.0 2024-08-27 [?] CRAN (R 4.4.1)
P DBI 1.2.3 2024-06-02 [?] CRAN (R 4.4.0)
P devtools 2.4.5 2022-10-11 [?] CRAN (R 4.4.0)
P dials 1.3.0 2024-07-30 [?] CRAN (R 4.4.0)
P DiceDesign 1.10 2023-12-07 [?] CRAN (R 4.4.0)
P digest 0.6.37 2024-08-19 [?] CRAN (R 4.4.1)
P doParallel 1.0.17 2022-02-07 [?] CRAN (R 4.4.0)
P dplyr 1.1.4 2023-11-17 [?] CRAN (R 4.4.0)
P duckdb 1.0.0-2 2024-07-19 [?] CRAN (R 4.4.0)
P ellipsis 0.3.2 2021-04-29 [?] CRAN (R 4.4.0)
P fansi 1.0.6 2023-12-08 [?] CRAN (R 4.4.0)
P fastmap 1.2.0 2024-05-15 [?] CRAN (R 4.4.0)
P foreach 1.5.2 2022-02-02 [?] CRAN (R 4.4.0)
P fs 1.6.4 2024-04-25 [?] CRAN (R 4.4.0)
P furrr 0.3.1 2022-08-15 [?] CRAN (R 4.4.0)
P future 1.34.0 2024-07-29 [?] CRAN (R 4.4.0)
P future.apply 1.11.2 2024-03-28 [?] CRAN (R 4.4.0)
P generics 0.1.3 2022-07-05 [?] CRAN (R 4.4.0)
P ggh4x 0.2.8 2024-01-23 [?] CRAN (R 4.4.0)
P ggplot2 3.5.1 2024-04-23 [?] CRAN (R 4.4.0)
P ggrepel 0.9.5 2024-01-10 [?] CRAN (R 4.4.0)
P globals 0.16.3 2024-03-08 [?] CRAN (R 4.4.0)
P glue 1.7.0 2024-01-09 [?] CRAN (R 4.4.0)
P gower 1.0.1 2022-12-22 [?] CRAN (R 4.4.0)
P GPfit 1.0-8 2019-02-08 [?] CRAN (R 4.4.0)
P gtable 0.3.5 2024-04-22 [?] CRAN (R 4.4.0)
P hardhat 1.4.0 2024-06-02 [?] CRAN (R 4.4.0)
P here 1.0.1 2020-12-13 [?] CRAN (R 4.4.0)
P hms 1.1.3 2023-03-21 [?] CRAN (R 4.4.0)
P htmltools 0.5.8.1 2024-04-04 [?] CRAN (R 4.4.0)
P htmlwidgets 1.6.4 2023-12-06 [?] CRAN (R 4.4.0)
P httpuv 1.6.15 2024-03-26 [?] CRAN (R 4.4.0)
P ipred 0.9-15 2024-07-18 [?] CRAN (R 4.4.0)
P iterators 1.0.14 2022-02-05 [?] CRAN (R 4.4.0)
P jsonlite 1.8.8 2023-12-04 [?] CRAN (R 4.4.0)
P knitr 1.48 2024-07-07 [?] CRAN (R 4.4.0)
P later 1.3.2 2023-12-06 [?] CRAN (R 4.4.0)
P lattice 0.22-6 2024-03-20 [?] CRAN (R 4.4.1)
P lava 1.8.0 2024-03-05 [?] CRAN (R 4.4.0)
P lhs 1.2.0 2024-06-30 [?] CRAN (R 4.4.0)
P lifecycle 1.0.4 2023-11-07 [?] CRAN (R 4.4.0)
P lightgbm 4.5.0 2024-07-26 [?] CRAN (R 4.4.0)
P listenv 0.9.1 2024-01-29 [?] CRAN (R 4.4.0)
P lubridate 1.9.3 2023-09-27 [?] CRAN (R 4.4.0)
P magrittr 2.0.3 2022-03-30 [?] CRAN (R 4.4.0)
P MASS 7.3-60.2 2024-04-26 [?] CRAN (R 4.4.1)
P Matrix 1.7-0 2024-04-26 [?] CRAN (R 4.4.1)
P memoise 2.0.1 2021-11-26 [?] CRAN (R 4.4.0)
P mime 0.12 2021-09-28 [?] CRAN (R 4.4.0)
P miniUI 0.1.1.1 2018-05-18 [?] CRAN (R 4.4.0)
P munsell 0.5.1 2024-04-01 [?] CRAN (R 4.4.0)
P nnet 7.3-19 2023-05-03 [?] CRAN (R 4.4.1)
P odbc 1.5.0 2024-06-05 [?] CRAN (R 4.4.1)
P parallelly 1.38.0 2024-07-27 [?] CRAN (R 4.4.0)
P parsnip 1.2.1 2024-03-22 [?] CRAN (R 4.4.0)
P pillar 1.9.0 2023-03-22 [?] CRAN (R 4.4.0)
P pkgbuild 1.4.4 2024-03-17 [?] CRAN (R 4.4.0)
P pkgconfig 2.0.3 2019-09-22 [?] CRAN (R 4.4.0)
P pkgload 1.4.0 2024-06-28 [?] CRAN (R 4.4.0)
P prodlim 2024.06.25 2024-06-24 [?] CRAN (R 4.4.0)
P profvis 0.3.8 2023-05-02 [?] CRAN (R 4.4.0)
P promises 1.3.0 2024-04-05 [?] CRAN (R 4.4.0)
P purrr 1.0.2 2023-08-10 [?] CRAN (R 4.4.0)
P R6 2.5.1 2021-08-19 [?] CRAN (R 4.4.0)
P rappdirs 0.3.3 2021-01-31 [?] CRAN (R 4.4.0)
P Rcpp 1.0.13 2024-07-17 [?] CRAN (R 4.4.0)
P recipes 1.1.0 2024-07-04 [?] CRAN (R 4.4.0)
P remotes 2.5.0 2024-03-17 [?] CRAN (R 4.4.0)
renv 1.0.7 2024-04-11 [1] CRAN (R 4.4.0)
P rlang 1.1.4 2024-06-04 [?] CRAN (R 4.4.0)
P roxygen2 7.3.2 2024-06-28 [?] CRAN (R 4.4.0)
P rpart 4.1.23 2023-12-05 [?] CRAN (R 4.4.1)
P rprojroot 2.0.4 2023-11-05 [?] CRAN (R 4.4.0)
P rsample 1.2.1 2024-03-25 [?] CRAN (R 4.4.0)
P rstudioapi 0.16.0 2024-03-24 [?] CRAN (R 4.4.0)
P scales 1.3.0 2023-11-28 [?] CRAN (R 4.4.0)
P sessioninfo 1.2.2 2021-12-06 [?] CRAN (R 4.4.0)
P shapviz 0.9.4 2024-08-20 [?] CRAN (R 4.4.1)
P shiny 1.9.1 2024-08-01 [?] CRAN (R 4.4.0)
shrtcts 0.1.2 2024-09-06 [1] Github (gadenbuie/shrtcts@41051cf)
snowflaker 0.20.1 2024-09-12 [1] local
P stringi 1.8.4 2024-05-06 [?] CRAN (R 4.4.0)
P stringr 1.5.1 2023-11-14 [?] CRAN (R 4.4.0)
P survival 3.6-4 2024-04-24 [?] CRAN (R 4.4.1)
P tibble 3.2.1 2023-03-20 [?] CRAN (R 4.4.0)
P tidyr 1.3.1 2024-01-24 [?] CRAN (R 4.4.0)
P tidyselect 1.2.1 2024-03-11 [?] CRAN (R 4.4.0)
P timechange 0.3.0 2024-01-18 [?] CRAN (R 4.4.0)
P timeDate 4032.109 2023-12-14 [?] CRAN (R 4.4.0)
P tune 1.2.1 2024-04-18 [?] CRAN (R 4.4.0)
P urlchecker 1.0.1 2021-11-30 [?] CRAN (R 4.4.0)
P usethis 3.0.0 2024-07-29 [?] CRAN (R 4.4.0)
P utf8 1.2.4 2023-10-22 [?] CRAN (R 4.4.0)
P vctrs 0.6.5 2023-12-01 [?] CRAN (R 4.4.0)
P withr 3.0.1 2024-07-31 [?] CRAN (R 4.4.0)
P workflows 1.1.4 2024-02-19 [?] CRAN (R 4.4.0)
P xfun 0.47 2024-08-17 [?] CRAN (R 4.4.0)
P xgboost 1.7.8.1 2024-07-24 [?] CRAN (R 4.4.0)
P xml2 1.3.6 2023-12-04 [?] CRAN (R 4.4.0)
P xtable 1.8-4 2019-04-21 [?] CRAN (R 4.4.0)
P yaml 2.3.10 2024-07-26 [?] CRAN (R 4.4.0)
P yardstick 1.3.1 2024-03-21 [?] CRAN (R 4.4.0)
[1] /Users/tobiasschmidt/repos/ne-pricing-macro/renv/library/macos/R-4.4/aarch64-apple-darwin20
[2] /Users/tobiasschmidt/Library/Caches/org.R-project.R/R/renv/sandbox/macos/R-4.4/aarch64-apple-darwin20/f7156815
P ── Loaded and on-disk path mismatch. |
Hey @RoyalTS I had a chance to try this out on an M1 Mac as well, and I am still unable to replicate your issue. At this point, I think it might be something specific to your setup. Couple of questions before I give up:
I am not convinced either of these are relevant since you said everything worked fine prior to upgrading the package, but also running out of ideas. |
Yup! It terminates with [1] 44528 abort R
via homebrew. Current
# To use this INI file, replace [INSTALLDIR] with the
# directory the tarball was extracted to.
[Driver]
ANSIENCODING=UTF-8
## Note that this default DriverManagerEncoding of UTF-32 is for iODBC. unixODBC uses UTF-16 by default.
## If unixODBC was compiled with -DSQL_WCHART_CONVERT, then UTF-32 is the correct value.
## Execute 'odbc_config --cflags' to determine if you need UTF-32 or UTF-16 on unixODBC
DriverManagerEncoding=UTF-32
DriverLocale=en-US
ErrorMessagesPath=/opt/snowflake/snowflakeodbc/ErrorMessages
LogLevel=0
LogPath=
CURLVerboseMode=false
CABundleFile=/opt/snowflake/snowflakeodbc/lib/universal/cacert.pem
## - Note that the path to your ODBC Driver Manager must be specified in LD_LIBRARY_PATH (LIBPATH for AIX, DYLD_LIBRARY_PATH for Darwin).
## - Note that AIX has a different format for specifying its shared libraries.
## - The driver can load the ODBCInstLib corresponding to the Driver Manager automatically normally you don't need to specify it.
## - In case you get error of "Unable to locate SQLGetPrivateProfileString function" that shows ODBCInstLib is not loaded correctly,
## - uncomment the ODBCInstLib corresponding to the Driver Manager being used and make sure the file name matches what exists on your system.
# Generic ODBCInstLib
# iODBC
# ODBCInstLib=libiodbcinst.so
# SimbaDM / unixODBC
ODBCInstLib=/opt/homebrew/lib/libodbcinst.dylib
# Darwin specific ODBCInstLib
# iODBC
# ODBCInstLib=libiodbcinst.dylib
# AIX specific ODBCInstLib
# iODBC
#ODBCInstLib=libiodbcinst.a(libiodbcinst.so.2)
# SimbaDM
#ODBCInstLib=libodbcinst.a(odbcinst.so)
# unixODBC
#ODBCInstLib=libodbcinst.a(libodbcinst.so.1) |
Great, thanks. Can you change DriverManagerEncoding=UTF-32 to UTF-16 and try again |
Not it, unfortunately. If it helps:
|
Those flags look fine. Last question - do you see the same with just [R] + Otherwise, out of ideas and bit confused since try as I might I can't replicate it - only difference from what I can tell is that this machine I am using to test is running Sequoia. If you feel like getting your hands dirty you could run [R] under Let me know if you come up with any ideas. |
Hmmm, doing this in plain R correctly throws the error but does not crash: > con <- DBI::dbConnect(
+ odbc::odbc(),
+ UID = '[email protected]',
+ server = server,
+ authenticator = 'externalbrowser',
+ driver = "SnowflakeDriver"
+ )
> DBI::dbGetQuery(con, 'SELECT does_not_exist')
Error in `DBI::dbGetQuery()`:
! ODBC failed with error 00000 from .
✖ SQL compilation error: error line 1 at position 7
• invalid identifier 'DOES_NOT_EXIST'
• <SQL> 'SELECT does_not_exist'
ℹ From nanodbc/nanodbc.cpp:1722.
Run `rlang::last_trace()` to see where the error occurred. |
Hi @RoyalTS Thanks for following up. OK, to me this is perhaps more of a symptom of a corrupted environment than an issue with this package. Unfortunately I don't know enough about Unless there are objections I'll close this issue. We can re-open if we can more conclusively point to an issue with |
I'm getting somewhat mysterious Rstudio crashes with
odbc
1.5.0
when trying to execute queries that throw errors. Valid queries are fine, as is the previousodbc
version.Install seems to go to plan:
but trying to execute an erroneous query predictably leads to an Rstudio crash
Database
Session Info
The text was updated successfully, but these errors were encountered: