-
Notifications
You must be signed in to change notification settings - Fork 174
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
dbplyr
itself cannot be loaded
#779
Comments
UPDATE I found that |
I get a similar error when using The message printed to the console by
And if I set the workers to log their output, the error is:
|
Could you tell us your situation in more detail, since
|
I'm using library(doSNOW); library(foreach)
cl <- makeCluster(12, outfile="temp\\sim_out.txt")
registerDoSNOW(cl)
out.ls <- foreach(i=1:nrow(grid.i), .combine="c",
.packages=c("tidyverse", "brms", "glue", "lubridate") %dopar% {
...
} If I run in series with If I use frequentist regressions (i.e., if I do not use anything from the This did start about a week ago when I unfortunately updated many packages, which makes it harder to track down exactly which combination is causing the error. To answer your questions:
> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] doSNOW_1.0.20 snow_0.4-4 iterators_1.0.14 foreach_1.5.2 readxl_1.3.1 brms_2.16.3 Rcpp_1.0.8
[8] lme4_1.1-28 Matrix_1.4-0 glue_1.6.1 sf_1.0-6 forcats_0.5.1 stringr_1.4.0 dplyr_1.0.8
[15] purrr_0.3.4 readr_2.1.2 tidyr_1.2.0 tibble_3.1.6 ggplot2_3.3.5 tidyverse_1.3.1 lubridate_1.8.0
[22] raster_3.5-15 sp_1.4-6
loaded via a namespace (and not attached):
[1] backports_1.4.1 plyr_1.8.6 igraph_1.2.11 splines_4.1.1 crosstalk_1.2.0 usethis_2.1.5
[7] rstantools_2.1.1 inline_0.3.19 digest_0.6.29 htmltools_0.5.2 rsconnect_0.8.25 fansi_1.0.2
[13] memoise_2.0.1 magrittr_2.0.2 checkmate_2.0.0 remotes_2.4.2 tzdb_0.2.0 modelr_0.1.8
[19] RcppParallel_5.1.5 matrixStats_0.61.0 vroom_1.5.7 xts_0.12.1 prettyunits_1.1.1 colorspace_2.0-3
[25] rvest_1.0.2 haven_2.4.3 xfun_0.29 rgdal_1.5-28 callr_3.7.0 crayon_1.5.0
[31] jsonlite_1.7.3 zoo_1.8-9 gtable_0.3.0 distributional_0.3.0 pkgbuild_1.3.1 rstan_2.21.3
[37] abind_1.4-5 scales_1.1.1 mvtnorm_1.1-3 DBI_1.1.2 miniUI_0.1.1.1 xtable_1.8-4
[43] units_0.8-0 bit_4.0.4 proxy_0.4-26 StanHeaders_2.21.0-7 stats4_4.1.1 DT_0.20
[49] htmlwidgets_1.5.4 httr_1.4.2 threejs_0.3.3 wk_0.6.0 posterior_1.2.0 ellipsis_0.3.2
[55] pkgconfig_2.0.3 loo_2.4.1 farver_2.1.0 dbplyr_2.1.1 utf8_1.2.2 tidyselect_1.1.2
[61] rlang_1.0.1 reshape2_1.4.4 later_1.3.0 cachem_1.0.6 munsell_0.5.0 cellranger_1.1.0
[67] tools_4.1.1 cli_3.1.1 generics_0.1.2 devtools_2.4.3 broom_0.7.12 ggridges_0.5.3
[73] evaluate_0.15 fastmap_1.1.0 yaml_2.2.2 processx_3.5.2 knitr_1.37 bit64_4.0.5
[79] fs_1.5.2 s2_1.0.7 nlme_3.1-152 projpred_2.0.2 mime_0.12 xml2_1.3.3
[85] brio_1.1.3 compiler_4.1.1 bayesplot_1.8.1 shinythemes_1.2.0 rstudioapi_0.13 gamm4_0.2-6
[91] testthat_3.1.2 e1071_1.7-9 reprex_2.0.1 stringi_1.7.6 ps_1.6.0 desc_1.4.0
[97] Brobdingnag_1.2-7 lattice_0.20-44 classInt_0.4-3 nloptr_2.0.0 markdown_1.1 shinyjs_2.1.0
[103] tensorA_0.36.2 vctrs_0.3.8 pillar_1.7.0 lifecycle_1.0.1 bridgesampling_1.1-2 httpuv_1.6.5
[109] R6_2.5.1 promises_1.2.0.1 KernSmooth_2.23-20 gridExtra_2.3 sessioninfo_1.2.2 codetools_0.2-18
[115] pkgload_1.2.4 boot_1.3-28 colourpicker_1.1.1 MASS_7.3-54 gtools_3.9.2 assertthat_0.2.1
[121] rprojroot_2.0.2 withr_2.4.3 shinystan_2.5.0 mgcv_1.8-36 parallel_4.1.1 hms_1.1.1
[127] terra_1.5-21 grid_4.1.1 coda_0.19-4 class_7.3-19 minqa_1.2.4 rmarkdown_2.11
[133] shiny_1.7.1 base64enc_0.1-3 dygraphs_1.1.1.6 I'm using RStudio 2021.09.0+351 |
Hi all I get a similar error when running loading brms in before tidyverse.
But the other way around works fine.
R version: 4.1.2 |
Reversing the order doesn't stop the error for me, but I did find a sequence that works. Everything runs successfully if I start the function (that is being parallelized) with: library(brms); library(Matrix); library(tidyverse) I'm currently using > sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] forcats_0.5.1 stringr_1.4.0 dplyr_1.0.8 purrr_0.3.4 readr_2.1.2 tidyr_1.2.0 tibble_3.1.6
[8] ggplot2_3.3.5 tidyverse_1.3.1 Matrix_1.4-0 brms_2.16.3 Rcpp_1.0.8
loaded via a namespace (and not attached):
[1] minqa_1.2.4 colorspace_2.0-3 ellipsis_0.3.2 ggridges_0.5.3 rsconnect_0.8.25
[6] markdown_1.1 fs_1.5.2 base64enc_0.1-3 rstudioapi_0.13 farver_2.1.0
[11] rstan_2.21.3 DT_0.20 fansi_1.0.2 mvtnorm_1.1-3 lubridate_1.8.0
[16] xml2_1.3.3 bridgesampling_1.1-2 codetools_0.2-18 splines_4.1.1 shinythemes_1.2.0
[21] bayesplot_1.8.1 projpred_2.0.2 jsonlite_1.7.3 nloptr_2.0.0 broom_0.7.12
[26] dbplyr_2.1.1 shiny_1.7.1 compiler_4.1.1 httr_1.4.2 backports_1.4.1
[31] assertthat_0.2.1 fastmap_1.1.0 cli_3.1.1 later_1.3.0 htmltools_0.5.2
[36] prettyunits_1.1.1 tools_4.1.1 igraph_1.2.11 coda_0.19-4 gtable_0.3.0
[41] glue_1.6.1 reshape2_1.4.4 posterior_1.2.0 cellranger_1.1.0 vctrs_0.3.8
[46] nlme_3.1-152 crosstalk_1.2.0 tensorA_0.36.2 ps_1.6.0 rvest_1.0.2
[51] lme4_1.1-28 mime_0.12 miniUI_0.1.1.1 lifecycle_1.0.1 gtools_3.9.2
[56] MASS_7.3-54 zoo_1.8-9 scales_1.1.1 colourpicker_1.1.1 hms_1.1.1
[61] promises_1.2.0.1 Brobdingnag_1.2-7 parallel_4.1.1 inline_0.3.19 shinystan_2.5.0
[66] gamm4_0.2-6 gridExtra_2.3 loo_2.4.1 StanHeaders_2.21.0-7 stringi_1.7.6
[71] dygraphs_1.1.1.6 checkmate_2.0.0 boot_1.3-28 pkgbuild_1.3.1 rlang_1.0.1
[76] pkgconfig_2.0.3 matrixStats_0.61.0 distributional_0.3.0 lattice_0.20-44 rstantools_2.1.1
[81] htmlwidgets_1.5.4 processx_3.5.2 tidyselect_1.1.2 plyr_1.8.6 magrittr_2.0.2
[86] R6_2.5.1 generics_0.1.2 DBI_1.1.2 withr_2.4.3 pillar_1.7.0
[91] haven_2.4.3 mgcv_1.8-36 xts_0.12.1 abind_1.4-5 modelr_0.1.8
[96] crayon_1.5.0 utf8_1.2.2 tzdb_0.2.0 grid_4.1.1 readxl_1.3.1
[101] callr_3.7.0 threejs_0.3.3 reprex_2.0.1 digest_0.6.29 xtable_1.8-4
[106] httpuv_1.6.5 RcppParallel_5.1.5 stats4_4.1.1 munsell_0.5.0 shinyjs_2.1.0 |
I receive the error as well. I'm on a Linux cluster and can't update I receive the error when trying to load
Here are the versions of packages I have installed:
Here's my
|
Interestingly enough, when I
Also, failed tidyverse load does not put any tidyverse package on search path. But when I create a completely new project, everything works. EDIT: when a clear the history, it works even in the project that it previously failed in... Note the DLL MD5 mismatch for |
FYI, there is full loadNamespace trace (using |
This comment was marked as outdated.
This comment was marked as outdated.
@proshano Note the rstan, bridgesampler and others, such as emmeans loaded via namespace. The issue have to be caused by some method registration conflict about Stan-related packages and tidyverse/dbplyr. |
Don`t want to be annoying, but is anyone actively solving this? It seems like a big deal not to be able to load a package... |
I now managed to reproduce the issue. library(bridgesampling)
library(dbplyr) I tracked the issue down to for (i in seq_along(contains)) {
obji <- contains[[i]]
cli <- contains[[i]]@superClass
cliDef <- getClassDef(cli, package = packageSlot(obji))
subcl <- cliDef@subclasses[[class2]]
if (is.null(subcl)) {
exti <- extends(classDef2, cliDef, fullInfo = TRUE)
if (identical(exti, FALSE) || (is(exti, "SClassExtension") &&
exti@distance > 1L && classDef@className ==
exti@by))
setIs(class2, cli, extensionObject = obji,
doComplete = FALSE, where = where)
}
} The 4th element of cli
#> [1] "index"
#> attr(,"package")
#> [1] "Matrix" The line
if neither |
This can be further simplified to creating a package with #'@importFrom Brobdingnag brob
#'@importFrom Matrix nearPD
f <- function(x) {} And then I found that setClassUnion("index", members = c("numeric", "logical", "character")) which seems to cause the issue.
Edit: Exporting actually does not help... @hadley Can you help here? |
@mgirlich what's the connection to dbplyr here? I assume it must be something to do with the methods::setOldClass(c("ident_q", "ident", "character"), ident_q())
methods::setOldClass(c("ident", "character"), ident())
methods::setOldClass(c("sql", "character"), sql()) But there's must be something else going on because this works fine: library(methods)
setClassUnion("index", c("numeric", "logical", "character"))
setOldClass(c("ident", "character"), dbplyr::ident()) Created on 2022-03-28 by the reprex package (v2.0.1) Unfortunately this sort of problem is very hard to debug as its likely to be a bug either in S4 or in the way that bridgesampling, dbplyr, or one of their dependencies is using it. |
I think it is a bug in S4 and/or an issue of My picture what happens is:
There it iterates over the S4 classes that have "character" in their class definition. One of these classes is
Then it tries to find class definition of |
How can "if bridgesampling is loaded but Matrix not" happen? bridgesampling imports Matrix in the DESCRIPTION and specficially imports And why is the briddgesampling the root cause? It doesn't seem to define any S4 classes of its own? .... Oh it's just the order in which it loads namespaces. So an even simpler reprex is: requireNamespace("Brobdingnag")
#> Loading required namespace: Brobdingnag
requireNamespace("Matrix")
#> Loading required namespace: Matrix
requireNamespace("dbplyr")
#> Loading required namespace: dbplyr
#> Error in completeSubclasses(classDef2, class1, obj, where) :
#> trying to get slot "subclasses" from an object of a basic class ("NULL") with no slots Created on 2022-03-28 by the reprex package (v2.0.1) |
Even simpler: requireNamespace("Brobdingnag")
#> Loading required namespace: Brobdingnag
requireNamespace("Matrix")
#> Loading required namespace: Matrix
methods::setOldClass(c("ident", "character"))
#> Error in completeSubclasses(classDef2, class1, obj, where) :
#> trying to get slot "subclasses" from an object of a basic class ("NULL") with no slots
#> Error in setClass(cl, contains = c(prevClass, "VIRTUAL"), where = where): error in contained classes ("character") for class "ident"; class definition removed from '.GlobalEnv' Created on 2022-03-28 by the reprex package (v2.0.1) So it seems almost certain that the problem lies in Brobdingnag |
(Oh I think you just accidentally wrote bridgesampling above, when you meant Brobdingnag) |
The problem is fixed in the dev version of Brobdingnag. Install it with |
I pinged Michael Lawrence about this and he also pushed a fix to R-devel: wch/r-source@3d97199 |
devtools::install_github("RobinHankin/Brobdingnag") keeps throwing the same error for me: Error: Failed to install 'Brobdingnag' from GitHub: Rate limit remaining: 53/60 Couldn't solve this. Any help would be appreciated. Edit: after reinstalling devtools, it worked for me (I think that's what made it work, at least). |
I get the Edit: I could install it after I reinstalled Matrix. |
I am still having this issue with dbplyr and installing the devtools::install_github("RobinHankin/Brobdingnag"). The trace is attached. Any pointer is appreciated. Thanks.
|
I encountered the same problem when I libraried another packages "proActiv", but then I might accidentally library the dbplyr successfulliy. Although I dont know exactly how they are going, here's my solution: |
For me, all the solutions above cannot work. But I found the error only occured when I open a rstudio project which had been created before, nor a newly created rstudio project. Then, I add code "library(dbplyr)" in file "Rprofile.site", the error never occur any more. |
@lanjlgle Bro,but,you are a real hero |
I've successfully installed
dbplyr
but cannot load it usinglibrary()
due to the error:error: error in contained classes ("character") for class “ident”; class definition removed from ‘dbplyr’
. The very same error also causes the installation failure and loading failure of the packages that depend ondbplyr
, as a couple of posts (#619, #688, https://community.rstudio.com/t/tidyverse-error-failed-to-load/105345) has already reported for the last few years.I installed
dbplyr
2.1.1 from CRAN and faced the error. I also remove thedbplyr
from CRAN, and reinstalled the package bydevtools::install_github("tidyverse/dbplyr")
; but the error persists. Is there any way to resolve the problem from the user side, or would you please fix this?Loading
dbplyr
failsLoading
tidyverse
fails, sincetidyverse
depends ondbplyr
SessionInfo
The text was updated successfully, but these errors were encountered: