Skip to content
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

webshot.js returned failure value: 1 #115

Open
ThierryO opened this issue Feb 1, 2023 · 3 comments
Open

webshot.js returned failure value: 1 #115

ThierryO opened this issue Feb 1, 2023 · 3 comments

Comments

@ThierryO
Copy link

ThierryO commented Feb 1, 2023

I'm having a similar issue as #112 when rendering a Rmarkdown file with leaflet() to pdf. Rendering the minimal example below returns the error Error in (function (url = NULL, file = "webshot.png", vwidth = 992, vheight = 744, : webshot.js returned failure value: 1. I've installed the latest version from CRAN and ran webshot::install_phantomjs(force = TRUE).

---
title: "Webshot test"
output: pdf_document
---

```{r leaflet, fig.cap = "webshot test"}
library(leaflet)
leaflet() |>
  setView(lat = 50.75695, lng = 4.00905, zoom = 15) |>
  addTiles()
```
─ Session info ─────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.2.2 Patched (2022-11-10 r83330)
 os       Ubuntu 22.04.1 LTS
 system   x86_64, linux-gnu
 ui       RStudio
 language nl_BE:nl
 collate  nl_BE.UTF-8
 ctype    nl_BE.UTF-8
 tz       Europe/Brussels
 date     2023-02-01
 rstudio  2022.12.0+354 Elsbeth Geranium (desktop)
 pandoc   2.19.2 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────────────
 package           * version  date (UTC) lib source
 base64enc           0.1-3    2015-07-28 [1] CRAN (R 4.2.0)
 bslib               0.4.2    2022-12-16 [1] CRAN (R 4.2.2)
 cachem              1.0.6    2021-08-19 [1] CRAN (R 4.2.0)
 callr               3.7.3    2022-11-02 [1] CRAN (R 4.2.1)
 cli                 3.6.0    2023-01-09 [1] CRAN (R 4.2.2)
 colorspace          2.0-3    2022-02-21 [1] CRAN (R 4.2.0)
 commonmark          1.8.1    2022-10-14 [1] CRAN (R 4.2.1)
 crosstalk           1.2.0    2021-11-04 [1] CRAN (R 4.2.0)
 digest              0.6.31   2022-12-11 [1] CRAN (R 4.2.2)
 ellipsis            0.3.2    2021-04-29 [1] CRAN (R 4.2.0)
 evaluate            0.19     2022-12-13 [1] CRAN (R 4.2.2)
 fansi               1.0.4    2023-01-22 [1] CRAN (R 4.2.2)
 farver              2.1.1    2022-07-06 [1] CRAN (R 4.2.1)
 fastmap             1.1.0    2021-01-25 [1] CRAN (R 4.2.0)
 fs                  1.5.2    2021-12-08 [1] CRAN (R 4.2.0)
 ggplot2             3.4.0    2022-11-04 [1] CRAN (R 4.2.2)
 glue                1.6.2    2022-02-24 [1] CRAN (R 4.2.0)
 gridExtra           2.3      2017-09-09 [1] CRAN (R 4.2.0)
 gtable              0.3.1    2022-09-01 [1] CRAN (R 4.2.1)
 highr               0.10     2022-12-22 [1] CRAN (R 4.2.2)
 htmltools           0.5.4    2022-12-07 [1] CRAN (R 4.2.2)
 htmlwidgets         1.6.1    2023-01-07 [1] CRAN (R 4.2.2)
 isoband             0.2.7    2022-12-20 [1] CRAN (R 4.2.2)
 jquerylib           0.1.4    2021-04-26 [1] CRAN (R 4.2.0)
 jsonlite            1.8.4    2022-12-06 [1] CRAN (R 4.2.2)
 knitr               1.41     2022-11-18 [1] CRAN (R 4.2.2)
 labeling            0.4.2    2020-10-20 [1] CRAN (R 4.2.0)
 lattice             0.20-45  2021-09-22 [1] CRAN (R 4.2.0)
 lazyeval            0.2.2    2019-03-15 [1] CRAN (R 4.2.0)
 leaflet             2.1.1    2022-03-23 [1] CRAN (R 4.2.0)
 leaflet.providers   1.9.0    2019-11-09 [1] CRAN (R 4.2.0)
 lifecycle           1.0.3    2022-10-07 [1] CRAN (R 4.2.1)
 magrittr            2.0.3    2022-03-30 [1] CRAN (R 4.2.0)
 markdown            1.4      2022-11-16 [1] CRAN (R 4.2.2)
 MASS                7.3-58.1 2022-08-03 [1] CRAN (R 4.2.1)
 Matrix              1.5-3    2022-11-11 [1] CRAN (R 4.2.2)
 memoise             2.0.1    2021-11-26 [1] CRAN (R 4.2.0)
 mgcv                1.8-41   2022-10-21 [1] CRAN (R 4.2.1)
 mime                0.12     2021-09-28 [1] CRAN (R 4.2.0)
 munsell             0.5.0    2018-06-12 [1] CRAN (R 4.2.0)
 nlme                3.1-161  2022-12-15 [1] CRAN (R 4.2.2)
 pillar              1.8.1    2022-08-19 [1] CRAN (R 4.2.1)
 pkgconfig           2.0.3    2019-09-22 [1] CRAN (R 4.2.0)
 png                 0.1-8    2022-11-29 [1] CRAN (R 4.2.2)
 processx            3.8.0    2022-10-26 [1] CRAN (R 4.2.1)
 ps                  1.7.2    2022-10-26 [1] CRAN (R 4.2.1)
 R6                  2.5.1    2021-08-19 [1] CRAN (R 4.2.0)
 rappdirs            0.3.3    2021-01-31 [1] CRAN (R 4.2.0)
 raster              3.6-13   2023-01-07 [1] CRAN (R 4.2.2)
 RColorBrewer        1.1-3    2022-04-03 [1] CRAN (R 4.2.0)
 Rcpp                1.0.10   2023-01-22 [1] CRAN (R 4.2.2)
 rlang               1.0.6    2022-09-24 [1] CRAN (R 4.2.1)
 rmarkdown           2.19     2022-12-15 [1] CRAN (R 4.2.2)
 sass                0.4.4    2022-11-24 [1] CRAN (R 4.2.2)
 scales              1.2.1    2022-08-20 [1] CRAN (R 4.2.1)
 sp                  1.6-0    2023-01-19 [1] CRAN (R 4.2.2)
 stringi             1.7.12   2023-01-11 [1] CRAN (R 4.2.2)
 stringr             1.5.0    2022-12-02 [1] CRAN (R 4.2.2)
 terra               1.6-47   2022-12-02 [1] CRAN (R 4.2.2)
 tibble              3.1.8    2022-07-22 [1] CRAN (R 4.2.1)
 tinytex             0.43     2022-12-13 [1] CRAN (R 4.2.2)
 utf8                1.2.2    2021-07-24 [1] CRAN (R 4.2.0)
 vctrs               0.5.1    2022-11-16 [1] CRAN (R 4.2.2)
 viridis             0.6.2    2021-10-13 [1] CRAN (R 4.2.0)
 viridisLite         0.4.1    2022-08-22 [1] CRAN (R 4.2.1)
 webshot             0.5.4    2022-09-26 [1] CRAN (R 4.2.2)
 withr               2.5.0    2022-03-03 [1] CRAN (R 4.2.0)
 xfun                0.36     2022-12-21 [1] CRAN (R 4.2.2)
 yaml                2.3.6    2022-10-18 [1] CRAN (R 4.2.1)

 [1] /home/thierry/R/x86_64-pc-linux-gnu-library/4.0
 [2] /usr/local/lib/R/site-library
 [3] /usr/lib/R/site-library
 [4] /usr/lib/R/library

───────────────────────────────────────────────────────────────────────────────────
@ThierryO
Copy link
Author

ThierryO commented Feb 1, 2023

The basic check fails add suggested here fails too.

> library(webshot)
> webshot("https://www.r-project.org/", "r.png")
Error in webshot("https://www.r-project.org/", "r.png") : 
  webshot.js returned failure value: 1

@vkehayas
Copy link

> library(webshot)
> webshot("https://www.r-project.org/", "r.png")
Auto configuration failed
139826745849792:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(libproviders.so): libproviders.so: cannot open shared object file: No such file or directory
139826745849792:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
139826745849792:error:0E07506E:configuration file routines:MODULE_LOAD_DSO:error loading dso:conf_mod.c:285:module=providers, path=providers
139826745849792:error:0E076071:configuration file routines:MODULE_RUN:unknown module name:conf_mod.c:222:module=providers
Error in webshot("https://www.r-project.org/", "r.png") : 
  webshot.js returned failure value: 1
> packageVersion("webshot")
[1] ‘0.5.2

(Same with version 0.5.4)

Related to ariya/phantomjs#15449. It appears that phantomjs is not maintained anymore.

Following https://stackoverflow.com/a/72679175/6888231, this solution solves the issue for me

Sys.setenv(OPENSSL_CONF="/dev/null")

The reason is the updated OpenSSL of my system.

@ThierryO
Copy link
Author

Sys.setenv(OPENSSL_CONF="/dev/null")

This solution works for me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants