duckdb / duckdb-r

The duckdb R package
https://r.duckdb.org/
Other
135 stars 23 forks source link

Can't install extensions on Ubuntu because of version mismatch #623

Open fmichonneau opened 18 hours ago

fmichonneau commented 18 hours ago

With the duckdb package version 1.1.3, on Ubuntu 24.10 I see:

library(duckdb)
#> Loading required package: DBI
con <- dbConnect(duckdb())
dbExecute(con, "INSTALL spatial;")
#> Error in `duckdb_result()`:
#> ! rapi_execute: Failed to run query
#> Error: IO Error: Failed to install 'spatial'
#> The file was built for DuckDB version 'v1.1.3', but we can only load extensions built for DuckDB version '19864453f7'.
dbGetQuery(con, "PRAGMA version;")
#>   library_version  source_id
#> 1   v1.1.3-dev165 19864453f7

Created on 2024-12-03 with reprex v2.1.1

This doesn't happen with the duckdb cli:

 duckdb
v1.1.3 19864453f7
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D pragma version;
┌─────────────────┬────────────┐
│ library_version │ source_id  │
│     varchar     │  varchar   │
├─────────────────┼────────────┤
│ v1.1.3          │ 19864453f7 │
└─────────────────┴────────────┘

With the R package, it seems like the extension installer is picking up the source_id instead of the version number. I am just guessing, but I'm wondering if it's because the duckdb version bundled with the R package has the dev165 suffix?

fmichonneau commented 18 hours ago

Update: I cloned the repository locally and removed the dev165 suffix from https://github.com/duckdb/duckdb-r/blob/54bcf51832556048c290dc205531308eda0602ae/src/duckdb/src/function/table/version/pragma_version.cpp#L2 (lines 2 and 11).

After reinstalling the package from these local files, the extension can be installed.

kent37 commented 15 hours ago

I have the same error on MacOS.

kent37 commented 12 hours ago

And the same fix works for me.