bcgov / rems

An R package to access data from British Columbia's Environmental Monitoring System
Apache License 2.0
19 stars 5 forks source link

connect_historic_db() error caused by unsupported DuckDB storage version #75

Closed KeithTStory closed 1 year ago

KeithTStory commented 1 year ago
SessionInfo() output:
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Upon opening a connection to the historic database with connect_historic_db(), I encounter the following error:

Error: rapi_startup: Failed to open database: IO Error: Trying to read a database file with version number 38, but we can only read version 41.
The database file was created with DuckDB version v0.5.0 or v0.5.1.

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.

See the storage page for more information: https://duckdb.org/internals/storage

Is there intention to update the historic database with a newer version of DuckDB? Querying the database prior to downloading the data is a very important feature.

KarHarker commented 1 year ago

Hi Keith,

This happened to someone else the other day and they just needed to do a package re-installation. I would recommend running: rems:::burn_it_down() in your console first – this will delete your existing caches. I hope that helps and please reach out if it still is giving you trouble.