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

Getting error when use in docker #38

Closed
ugurdar opened this issue Sep 13, 2023 · 5 comments
Closed

Getting error when use in docker #38

ugurdar opened this issue Sep 13, 2023 · 5 comments

Comments

@ugurdar
Copy link

ugurdar commented Sep 13, 2023

Hi,

I have a Shiny app which is rendering a .Rmd file. Firstly, I got this Warning: Error in : pandoc version 1.12.3 or higher is required and was not found (see the help page ?rmarkdown::pandoc_available).then I try to install pandoc with R package

I added this into my dockerfile:

RUN R -e "install.packages('pandoc')"
RUN R -e "install.packages('gh')"

also I created a Rscript

library(pandoc)
pandoc_install("3.1.1")

Now I'm getting this error:

✔ Pandoc version 3.1.1 installed.
✔ Version '3.1.1' is now the active one.
Killed
Warning in system(paste(shQuote(path), "--version"), intern = TRUE) :
  running command ''/root/.local/share/r-pandoc/3.1.1/pandoc' --version' had status 137

I'm using Mac M1. How can I solve it any idea?

@cderv
Copy link
Owner

cderv commented Sep 13, 2023

I have a Shiny app which is rendering a .Rmd file. Firstly, I got this Warning: Error in : pandoc version 1.12.3 or higher is required and was not found (see the help page ?rmarkdown::pandoc_available).

You need a Pandoc to render a Rmd document with rmarkdown.

It seems you are in Docker, so best way to install Pandoc in your environment is to install the latest binary available using the package manager, or from github release. See https://pandoc.org/installing.html#linux

This will avoid the need to have gh or pandoc R package only to install Pandoc. You don't need to for your app or the rendering. So best is to install Pandoc without them, following the standard way.

Warning in system(paste(shQuote(path), "--version"), intern = TRUE) :
running command ''/root/.local/share/r-pandoc/3.1.1/pandoc' --version' had status 137

About this, it seems somehow that the command pandoc --version did not work. It would be useful to run it without R and see what you get in terminal.

I'm using Mac M1.

Are you inside Docker ? or on your M1 ? Not sure to follow...

@ugurdar
Copy link
Author

ugurdar commented Sep 13, 2023

I'm on my M1. I'm newbie on docker. I added RUN apt-get update -y && apt-get install -y pandocbut I'm getting this

=> ERROR [2/4] RUN apt-get update -y && apt-get install -y pandoc        20.0s
------                                                                          
 > [2/4] RUN apt-get update -y && apt-get install -y pandoc:                    
0.895 Get:2 http://deb.debian.org/debian testing InRelease [156 kB]             
1.099 Get:3 http://deb.debian.org/debian testing-updates InRelease [45.1 kB]    
1.105 Ign:4 https://eddelbuettel.github.io/ppaR400 ./ InRelease                 
1.172 Get:5 http://deb.debian.org/debian-security testing-security InRelease [43.5 kB]
1.258 Get:6 http://deb.debian.org/debian experimental InRelease [99.8 kB]
1.293 Hit:7 https://eddelbuettel.github.io/ppaR400 ./ Release
1.338 Get:1 http://deb.debian.org/debian sid InRelease [195 kB]
1.396 Ign:8 https://eddelbuettel.github.io/ppaR400 ./ Release.gpg
4.270 Get:9 http://deb.debian.org/debian experimental/main amd64 Packages.diff/Index [63.3 kB]
4.345 Ign:9 http://deb.debian.org/debian experimental/main amd64 Packages.diff/Index
4.408 Get:10 http://deb.debian.org/debian experimental/main amd64 Packages [436 kB]
5.585 Get:11 http://deb.debian.org/debian sid/main amd64 Packages.diff/Index [63.6 kB]
5.600 Ign:11 http://deb.debian.org/debian sid/main amd64 Packages.diff/Index
5.668 Get:12 http://deb.debian.org/debian sid/main amd64 Packages [9,587 kB]
15.19 Reading package lists...
20.00 E: Repository 'http://deb.debian.org/debian testing InRelease' changed its 'Codename' value from 'bookworm' to 'trixie'
20.00 E: Repository 'http://deb.debian.org/debian testing-updates InRelease' changed its 'Codename' value from 'bookworm-updates' to 'trixie-updates'
20.00 E: Repository 'http://deb.debian.org/debian-security testing-security InRelease' changed its 'Codename' value from 'bookworm-security' to 'trixie-security'
------
Dockerfile:7
--------------------
   5 |     
   6 |     
   7 | >>> RUN apt-get update -y && apt-get install -y pandoc
   8 |     
   9 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update -y && apt-get install -y pandoc" did not complete successfully: exit code: 100

My dockerfile:

FROM my-user-name/my-container:version

RUN apt-get update -y && apt-get install -y pandoc

COPY shiny-app /app

WORKDIR /app

EXPOSE 3838

CMD ["R", "-e", "shiny::runApp('/app', host = '0.0.0.0', port = 3838)"]

@cderv
Copy link
Owner

cderv commented Sep 13, 2023

This is a docker issue really. I don't know which version of Debian you are using. The issue you see is probably because of older Debian compare to configuration and repo update

Example of quick search for error message https://syslog.me/2023/06/12/welcome-bookworm-and-how-to-continue-running-apt-get-update/

So you need to use a more recent Debian or adapt you dockerfile to use the older one.

@ugurdar
Copy link
Author

ugurdar commented Sep 14, 2023

Yes it's docker issue. It's about base docker image. I had amd64/r-base docker image and couldn't install pandoc. I created my app with rocker/r-ver and added this into my dockerfile

RUN apt-get update && apt-get install -y pandoc

this line and it solved the issue. Thank you!

@cderv
Copy link
Owner

cderv commented Sep 14, 2023

Glad it worked ! Thanks for the update

@cderv cderv closed this as completed Sep 14, 2023
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