question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I get "Error in processx::run: System command error" when using orca inside Docker

See original GitHub issue

I am using orca inside a downloadHandler function in an R-Shiny app inside Docker. When I click on the download button to generate and dowonload a plot I get disconnected from the session. Moreover, on the log file I get: Warning: Error in processx::run: System command error

I am using xvfb-run to run orca with a script like this: xvfb-run -a /squashfs-root/app/orca "$@"

Here is a minimal example of the shiny app:

library(shiny)
library(plotly)

ui <- fluidPage(   
         downloadButton('plot_download', 'Download plot')    
)
server <- function(input, output) {
  output$plot_download <- downloadHandler(
    filename = function(){
        plot_file_name<-'plot.png'
    },
    content = function(file) {

      path_split<-unlist(strsplit(file,'/'))
      
      download_path<-paste(path_split[1:length(path_split)-1],collapse='/')
      
      p <- plot_ly(x = 1:10, y = 1:10, color = 1:10)
      
      withr::with_dir(download_path, orca(p, path_split[length(path_split)]))
      
    })}
shinyApp(ui = ui, server = server)

Moreover, when I use orca in the R terminal inside Docker to generate the same plot, it works.

Here is my dockerfile:

# Install R version 3.5
FROM r-base:3.5.0

# Install Ubuntu packages
RUN apt-get update && apt-get install -y \
    sudo \
    gdebi-core \
    pandoc \
    pandoc-citeproc \
    libcurl4-gnutls-dev \
    libcairo2-dev/unstable \
    libxt-dev \
    libssl-dev \
    libpq-dev \
    libgtk2.0-bin \
    libx11-xcb1 \
    libxtst6 \
    libgconf-2-4 \
    libnss3 \
    libasound2 \
    xvfb

# Download and install ShinyServer (latest version)
RUN wget --no-verbose https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-12.04/x86_64/VERSION -O "version.txt" && \
    VERSION=$(cat version.txt)  && \
    wget --no-verbose "https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-12.04/x86_64/shiny-server-$VERSION-amd64.deb" -O ss-latest.deb && \
    gdebi -n ss-latest.deb && \
    rm -f version.txt ss-latest.deb
    
# Install R packages that are required
RUN R -e "install.packages(c('shiny', 'devtools', 'processx'), repos='http://cran.rstudio.com/')"

RUN R -e "devtools::install_github('ropensci/plotly')"

COPY orca_xvfb.sh /srv/shiny-server/orca_xvfb.sh
RUN chmod +x /srv/shiny-server/orca_xvfb.sh

# Download install orca (plotly library to download plots)
RUN wget --no-verbose -P /srv/shiny-server/ "https://github.com/plotly/orca/releases/download/v1.2.1/orca-1.2.1-x86_64.AppImage"
RUN chmod +x /srv/shiny-server/orca-1.2.1-x86_64.AppImage
RUN .//srv/shiny-server/orca-1.2.1-x86_64.AppImage --appimage-extract
RUN ln -s /srv/shiny-server/orca_xvfb.sh /usr/bin/orca
# Copy configuration files into the Docker image
COPY shiny-server.conf  /etc/shiny-server/shiny-server.conf
COPY /app /srv/shiny-server/

# Make the ShinyApp available at port 80
EXPOSE 80

# Copy further configuration files into the Docker image
COPY shiny-server.sh /usr/bin/shiny-server.sh

CMD ["/usr/bin/shiny-server.sh"]

I am using the github version of plotly. If I use the CRAN version and I try to download the plot, I get an error message saying that I need a mapbox token.

I really appreciate any help on this.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
0navarrocommented, May 21, 2019

Hello, I finally figured it out.

The problem was that the default user that runs the shiny app from the server, shiny, did not have access to the files in /squashfs-root/app/orca. At first I didn´t notice this because the message in the log file does not give any clue about permissions.

Anyway, I fixed the issue by running chown shiny:shiny -R /squashfs-root/ . I hope this helps.

0reactions
afrachionicommented, May 19, 2019

Hello! I’m having a similar issue on a headless Ubuntu machine where I’m trying to set up orca to make plotly figures offline:

$ xvfb-run -a orca graph --verbose test_fig.json 
Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"
gpu process crashed - false
          Chrome version 73.0.3683.121
          Electron version 5.0.1

The process just hangs there after printing this message. orca --version is 1.2.1. Happy to provide any additional information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix and Debug Docker Containers Like a Superhero
Take the container's default command and attempt to run it again. A “command not found” error message will appear.
Read more >
save plotly images from Rstudio in docker, get error ! System ...
I have RStudio in docker, and am trying to save a plotly image using orca. I installed orca following python 3.x - Docker...
Read more >
How To Use docker exec to Run Commands in ... - DigitalOcean
The No such container error means the specified container does not exist, and may indicate a misspelled container name. Use docker ps to...
Read more >
How to execute a shell script that has mount command inside ...
After building docker from dockerfile, I run the docker in privileged mode and execute this shell script as it contains mount commands. Now...
Read more >
Solving common issues — ORCA tutorials 5.0 documentation
A quite common initial source of error when trying to run ORCA is that ... The PATH and LD_LIBRARY_PATH are variables that your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found