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

[BUG] namespace ‘shiny’ and lazy loading failed for package #1112

Closed
DevIA05 opened this issue Oct 14, 2023 · 6 comments
Closed

[BUG] namespace ‘shiny’ and lazy loading failed for package #1112

DevIA05 opened this issue Oct 14, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@DevIA05
Copy link

DevIA05 commented Oct 14, 2023

Hello,

Describe the bug
I want to deploy the application once the project is created with docker (named: "testGolemDocker"). I get an error when I execute the command docker build -f Dockerfile --progress=plain -t testgolemdocker:latest .

#9 16.15 Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
#9 16.15   namespace ‘shiny’ 1.7.4 is being loaded, but >= 1.7.5 is required
#9 16.15 Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
#9 16.15 Execution halted
#9 16.16 ERROR: lazy loading failed for package ‘testGolemDocker’
#9 16.16 * removing ‘/usr/local/lib/R/site-library/testGolemDocker’

To Reproduce
Steps to reproduce the behavior:

  1. Rstudio: file > new project > new directory > New project wizard > Package for Shiny app using golem > create project
  2. In console: golem::add_dockerfile_with_renv(output_dir = "deploy")
  3. In terminal i execute the commands indicated in the deploy/README file:
  • docker build -f Dockerfile_base --progress=plain -t testgolemdocker_base .
  • docker build -f Dockerfile --progress=plain -t testgolemdocker:latest .
  • docker run -p 80:80 testgolemdocker:latest

log

https://tangible-slug-162.notion.site/log-new-app-golem-d76e8c185e734ae6b16ffcafeb1b02e0?pvs=4

session info

> devtools::session_info()
─ Session info ───────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.2.3 (2023-03-15 ucrt)
 os       Windows 10 x64 (build 19045)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  French_France.utf8
 ctype    French_France.utf8
 tz       Indian/Mauritius
 date     2023-10-14
 rstudio  2023.03.0+386 Cherry Blossom (desktop)
 pandoc   NAPackages ───────────────────────────────────────────────────────────────────────────────────────
 package     * version date (UTC) lib source
 assertthat    0.2.1   2019-03-21 [1] CRAN (R 4.2.3)
 attempt       0.3.1   2020-05-03 [1] CRAN (R 4.2.3)
 cachem        1.0.8   2023-05-01 [1] CRAN (R 4.2.3)
 callr         3.7.3   2022-11-02 [1] CRAN (R 4.2.3)
 cli           3.6.1   2023-03-23 [1] CRAN (R 4.2.3)
 config        0.3.2   2023-08-30 [1] CRAN (R 4.2.3)
 crayon        1.5.2   2022-09-29 [1] CRAN (R 4.2.3)
 curl          5.0.0   2023-01-12 [1] CRAN (R 4.2.3)
 desc          1.4.2   2022-09-08 [1] CRAN (R 4.2.3)
 devtools      2.4.5   2022-10-11 [1] CRAN (R 4.2.3)
 digest        0.6.33  2023-07-07 [1] CRAN (R 4.2.3)
 dockerfiler   0.2.1   2023-01-18 [1] CRAN (R 4.2.3)
 ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.2.3)
 fansi         1.0.4   2023-01-22 [1] CRAN (R 4.2.3)
 fastmap       1.1.1   2023-02-24 [1] CRAN (R 4.2.3)
 fs            1.6.3   2023-07-20 [1] CRAN (R 4.2.3)
 glue          1.6.2   2022-02-24 [1] CRAN (R 4.2.3)
 golem         0.4.1   2023-06-05 [1] CRAN (R 4.2.3)
 htmltools     0.5.6   2023-08-10 [1] CRAN (R 4.2.3)
 htmlwidgets   1.6.2   2023-03-17 [1] CRAN (R 4.2.3)
 httpuv        1.6.11  2023-05-11 [1] CRAN (R 4.2.3)
 httr          1.4.5   2023-02-24 [1] CRAN (R 4.2.3)
 jsonlite      1.8.4   2022-12-06 [1] CRAN (R 4.2.3)
 later         1.3.1   2023-05-02 [1] CRAN (R 4.2.3)
 lifecycle     1.0.3   2022-10-07 [1] CRAN (R 4.2.3)
 magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.2.3)
 memoise       2.0.1   2021-11-26 [1] CRAN (R 4.2.3)
 mime          0.12    2021-09-28 [1] CRAN (R 4.2.0)
 miniUI        0.1.1.1 2018-05-18 [1] CRAN (R 4.2.3)
 pak           0.6.0   2023-08-29 [1] CRAN (R 4.2.3)
 parsedate     1.3.1   2022-10-27 [1] CRAN (R 4.2.3)
 pillar        1.9.0   2023-03-22 [1] CRAN (R 4.2.3)
 pkgbuild      1.4.2   2023-06-26 [1] CRAN (R 4.2.3)
 pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 4.2.3)
 pkgload       1.3.3   2023-09-22 [1] CRAN (R 4.2.3)
 prettyunits   1.2.0   2023-09-24 [1] CRAN (R 4.2.3)
 processx      3.8.2   2023-06-30 [1] CRAN (R 4.2.3)
 profvis       0.3.8   2023-05-02 [1] CRAN (R 4.2.3)
 promises      1.2.1   2023-08-10 [1] CRAN (R 4.2.3)
 ps            1.7.5   2023-04-18 [1] CRAN (R 4.2.3)
 purrr         1.0.2   2023-08-10 [1] CRAN (R 4.2.3)
 R6            2.5.1   2021-08-19 [1] CRAN (R 4.2.3)
 rappdirs      0.3.3   2021-01-31 [1] CRAN (R 4.2.3)
 rcmdcheck     1.4.0   2021-09-27 [1] CRAN (R 4.2.3)
 Rcpp          1.0.10  2023-01-22 [1] CRAN (R 4.2.3)
 rematch       2.0.0   2023-08-30 [1] CRAN (R 4.2.3)
 remotes       2.4.2.1 2023-07-18 [1] CRAN (R 4.2.3)
 rhub          1.1.2   2022-08-31 [1] CRAN (R 4.2.3)
 rlang         1.1.1   2023-04-28 [1] CRAN (R 4.2.3)
 rprojroot     2.0.3   2022-04-02 [1] CRAN (R 4.2.3)
 rsconnect     1.1.0   2023-09-05 [1] CRAN (R 4.2.3)
 rstudioapi    0.15.0  2023-07-07 [1] CRAN (R 4.2.3)
 sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.2.3)
 shiny         1.7.5   2023-08-12 [1] CRAN (R 4.2.3)
 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.3)
 tibble        3.2.1   2023-03-20 [1] CRAN (R 4.2.3)
 urlchecker    1.0.1   2021-11-30 [1] CRAN (R 4.2.3)
 usethis       2.2.2   2023-07-06 [1] CRAN (R 4.2.3)
 utf8          1.2.3   2023-01-31 [1] CRAN (R 4.2.3)
 uuid          1.1-1   2023-08-17 [1] CRAN (R 4.2.3)
 vctrs         0.6.3   2023-06-14 [1] CRAN (R 4.2.3)
 whoami        1.3.0   2019-03-19 [1] CRAN (R 4.2.3)
 withr         2.5.0   2022-03-03 [1] CRAN (R 4.2.3)
 xopen         1.0.0   2018-09-17 [1] CRAN (R 4.2.3)
 xtable        1.8-4   2019-04-21 [1] CRAN (R 4.2.3)
 yaml          2.3.7   2023-01-23 [1] CRAN (R 4.2.3)

 [1] C:/Users/Idriss K/AppData/Local/R/win-library/4.2
 [2] C:/Program Files/R/R-4.2.3/library

──────────────────────────────────────────────────────────────────────────────────────────────────

Additional context
OS: windows 10 pro
docker: 4.20.1 (110738)

@DevIA05 DevIA05 added the bug Something isn't working label Oct 14, 2023
@ColinFay
Copy link
Member

hey,

You're using the default golem example ? No changes at all ?

@mikael04
Copy link

I had this problem, and I talked to this user on Stack Overflow.
After you, Colin, commented here, I tried one of the examples you provide in golem-examples and it worked.
I went back to my application and it didn't work again, so I looked at the DESCRIPTION file in my project and realized that it was requesting shiny (>= 1.4.1). I removed this restriction, ran it again, and it worked.
I don't know why my project had this restriction in the imports, but I hope it helps to find the problem or at least help this user and others have a possible solution.

@DevIA05
Copy link
Author

DevIA05 commented Oct 20, 2023

Hello,

You're using the default golem example ? No changes at all ?

Yes, I didn't add anything after creating the project

@mikael04
Copy link

Hello,

You're using the default golem example ? No changes at all ?

Yes, I didn't add anything after creating the project

Did you try to check your DESCRIPTION file?
In my case, it has the request for a version of shiny (>= 1.4.1). In my case, removing the request "(>= 1.4.1)" solve my problem.

@DevIA05
Copy link
Author

DevIA05 commented Oct 21, 2023

Hello,

Did you try to check your DESCRIPTION file?
In my case, it has the request for a version of shiny (>= 1.4.1). In my case, removing the request "(>= 1.4.1)" solve my problem.

I modified to shiny (>= 1.7.4), and it's work perfectly. Thank for your help.

@ColinFay
Copy link
Member

ColinFay commented Mar 1, 2024

Resolved, closing now :)

Thanks @mikael04

@ColinFay ColinFay closed this as completed Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants