coatless / quarto-webr

Community developed Quarto Extension to Embed webR for HTML Documents, RevealJS, Websites, Blogs, and Books.
https://quarto-webr.thecoatlessprofessor.com/
394 stars 19 forks source link

[Bug]: Using duckdb extensions #139

Closed dicorynia closed 9 months ago

dicorynia commented 9 months ago

Bug description

When trying to install a duckdb extension I get an error.

(thanks for this very interesting project)

Steps to reproduce

---
title: "Playing with webr"
description: "R in your browser"
engine: knitr
filters: ["webr"]
webr:
  packages:
    - "duckdb"
---

```{webr-r}
dataset <- "https://static.data.gouv.fr/resources/base-prenoms-insee-format-parquet/20231121-161435/prenoms-nat2022.parquet"
cnx <- dbConnect(duckdb())

# To do once:
dbExecute(cnx, "INSTALL httpfs")

dbExecute(cnx, "LOAD httpfs")

dbSendQuery(cnx, glue("
  CREATE VIEW prenoms AS
    SELECT * 
    FROM '{dataset}'
    WHERE annais <> 'XXXX'"))

Error: rapi_execute: Failed to run query Error: IO Error: Failed to download extension "httpfs" at URL "http://extensions.duckdb.org/v0.8.1/linux_i686_gcc4/httpfs.duckdb_extension.gz" Extension "httpfs" is an existing extension.

Are you using a development build? In this case, extensions might not (yet) be uploaded. (ERROR Connection)


### Your environment

RStudio 2023.12.0+369 "Ocean Storm" Release (33206f75bd14d07d84753f965eaa24756eda97b7, 2023-12-17) for Ubuntu Jammy
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2023.12.0+369 Chrome/116.0.5845.190 Electron/26.2.4 Safari/537.36
R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 21.1

### Quarto check output

```[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.450
      Path: /usr/lib/rstudio/resources/app/bin/quarto/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.11.5 (Conda)
      Path: /home/xxx/anaconda3/bin/python
      Jupyter: 5.3.0
      Kernels: python3

(-) Checking Jupyter engine render....0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.3.2
      Path: /usr/lib/R
      LibPaths:
        - /home/xxx/R/r.iresmi.net/renv/library/R-4.3/x86_64-pc-linux-gnu
        - /home/xxx/.cache/R/renv/sandbox/R-4.3/x86_64-pc-linux-gnu/9a444a72
      knitr: 1.42
      rmarkdown: 2.21

[✓] Checking Knitr engine render......OK
coatless commented 9 months ago

@dicorynia Is there any way you could have the {duckdb} maintainers change the URL from http to https? Anything not done over https will run into errors within {webR}.

Error: IO Error: Failed to download extension "httpfs" at URL "http://extensions.duckdb.org/v0.8.1/linux_i686_gcc4/httpfs.duckdb_extension.gz"

This is also probably better suited for the main {webR} project repo as it involves a compiled binary from the main repo.

dicorynia commented 9 months ago

Thanks for the hint of going upstream (I didn't properly identify the origin of the problem). I'll check with duckdb/webr

coatless commented 9 months ago

@dicorynia it looks like this is being followed upstream. So, I'm going to close out this issue ticket. If there's something else that is needed, please feel free to re-open/ping me.