brunobrr / bdc

Check out the vignettes with detailed documentation on each module of the bdc package
https://brunobrr.github.io/bdc
GNU General Public License v3.0
23 stars 7 forks source link

Versioning issues with DuckDB in bdc_query_names_taxadb() #233

Closed SEveringham closed 2 years ago

SEveringham commented 2 years ago

It seems this may be an issue similar to other issues mentioned but when running bdc_query_name_taxadb() I get a long error message about reading database version numbers:


resolvedspplistitis <- bdc_query_names_taxadb(sci_name=specieslist, db = "itis", suggestion_distance = 0.9)

Error: rapi_startup: Failed to open database: IO Error: Trying to read a database file with version number 31, but we can only read version 33.
The database file was created with an older version of DuckDB.

The storage of DuckDB is not yet stable; newer versions of DuckDB cannot read old database files and vice versa.
The storage will be stabilized when version 1.0 releases.

For now, we recommend that you load the database file in a supported version of DuckDB, and use the EXPORT DATABASE command followed by IMPORT DATABASE on the current version of DuckDB.

My session info:

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.1

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] parallel  stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] job_0.3.0         rgnparser_0.2.0   doParallel_1.0.17 iterators_1.0.14  foreach_1.5.2     bdc_1.1.2         ggbeeswarm_0.6.0 
 [8] magrittr_2.0.3    taxize_0.9.100    forcats_0.5.1     stringr_1.4.0     readr_2.1.2       tidyr_1.2.0       tibble_3.1.8     
[15] ggplot2_3.3.6     tidyverse_1.3.2   purrr_0.3.4       dplyr_1.0.9       readxl_1.4.0     

loaded via a namespace (and not attached):
  [1] googledrive_2.0.0        colorspace_2.0-3         ellipsis_0.3.2           class_7.3-20             rgdal_1.5-30            
  [6] rprojroot_2.0.3          fs_1.5.2                 httpcode_0.3.0           rstudioapi_0.13          proxy_0.4-27            
 [11] DT_0.23                  fansi_1.0.3              lubridate_1.8.0          xml2_1.3.3               codetools_0.2-18        
 [16] contentid_0.0.15         bold_1.2.0               knitr_1.39               jsonlite_1.8.0           broom_1.0.0             
 [21] dbplyr_2.2.1             rgeos_0.5-9              oai_0.3.2                compiler_4.2.1           httr_1.4.3              
 [26] backports_1.4.1          assertthat_0.2.1         fastmap_1.1.0            lazyeval_0.2.2           gargle_1.2.0            
 [31] cli_3.3.0                duckdb_0.4.0             prettyunits_1.1.1        htmltools_0.5.3          tools_4.2.1             
 [36] gtable_0.3.0             glue_1.6.2               rappdirs_0.3.3           Rcpp_1.0.9               cellranger_1.1.0        
 [41] CoordinateCleaner_2.0-20 raster_3.5-21            vctrs_0.4.1              crul_1.2.0               ape_5.6-2               
 [46] nlme_3.1-158             conditionz_0.1.0         xfun_0.31                rvest_1.0.2              lifecycle_1.0.1         
 [51] sys_3.4                  googlesheets4_1.0.0      terra_1.5-21             zoo_1.8-10               scales_1.2.0            
 [56] hms_1.1.1                qs_0.25.3                curl_4.3.2               geosphere_1.5-14         taxadb_0.1.5            
 [61] reshape_0.8.9            stringi_1.7.8            e1071_1.7-11             rgbif_3.7.2              rlang_1.0.4             
 [66] pkgconfig_2.0.3          evaluate_0.15            lattice_0.20-45          sf_1.0-7                 htmlwidgets_1.5.4       
 [71] tidyselect_1.1.2         here_1.0.1               plyr_1.8.7               R6_2.5.1                 generics_0.1.3          
 [76] DBI_1.1.3                arkdb_0.0.15             pillar_1.8.0             haven_2.5.0              whisker_0.4             
 [81] withr_2.5.0              units_0.8-0              sp_1.5-0                 modelr_0.1.8             crayon_1.5.1            
 [86] uuid_1.1-0               KernSmooth_2.23-20       utf8_1.2.2               RApiSerialize_0.1.0      tzdb_0.3.0              
 [91] progress_1.2.2           rnaturalearth_0.1.0      grid_4.2.1               data.table_1.14.2        reprex_2.0.1            
 [96] digest_0.6.29            classInt_0.4-7           openssl_2.0.2            RcppParallel_5.1.5       munsell_0.5.0           
[101] stringfish_0.15.7        beeswarm_0.4.0           vipor_0.4.5              askpass_1.1 

Any help would be appreciated!

kguidonimartins commented 2 years ago

Thanks for reporting, @SEveringham!

This error seems to be an issue after updating the {duckbd} package. You can solve this by running:

fs::dir_delete(taxadb:::taxadb_dir())

Then, rerun your query:

resolvedspplistitis <- bdc_query_names_taxadb(sci_name=specieslist, db = "itis", suggestion_distance = 0.9)

Please, let us know if these steps solve your problem.

SEveringham commented 2 years ago

Thanks for your help, That's now working and running fine!

kguidonimartins commented 2 years ago

If you have any problems, open this issue again.