Closed 0navarro closed 5 years ago
https://github.com/ropensci/plotly/issues/1437#issuecomment-450675463
might help you and us debug.
ropensci/plotly#1437 (comment)
might help you and us debug.
Hi etpinard, thanks for the reply.
When I run system("which orca") in the R terminal inside Docker I get:
/usr/bin/orca
When I run system("orca") I get:
Plotly's image-exporting utilities
Usage: orca [--version] [--help] <command> [<args>]
Available commands:
- graph [or plotly-graph, plotly_graph]
Generates an image of plotly graph from inputted plotly.js JSON attributes.
For more info, run `orca graph --help`.
- serve [or server]
Boots up a server with one route per available export component
For more info, run `orca serve --help`.
I added the flag debug=TRUE
to my R-shiny app like this:
withr::with_dir(download_path, orca(p, path_split[length(path_split)], debug=TRUE) )
But I get the same error message in the log file as before:
Loading required package: ggplot2
Attaching package: ‘plotly’
The following object is masked from ‘package:ggplot2’:
last_plot
The following object is masked from ‘package:stats’:
filter
The following object is masked from ‘package:graphics’:
layout
Listening on http://127.0.0.1:45137
Warning: Error in processx::run: System command error
[No stack trace available]
So I am guessing that the log file is not capturing any debug messages from the orca function. Do you have any other idea of how could I further debug this?
Moreover, after running the example with orca() in the R terminal inside Docker using the debug flag, I get a message like this:
>p <- plot_ly(x = 1:10, y = 1:10, color = 1:10)
>withr::with_dir('/var/log/', orca(p, 'plot.png', debug=TRUE))
No trace type specified:
Based on info supplied, a 'scatter' trace seems appropriate.
Read more about this trace type -> https://plot.ly/r/reference/#scatter
No scatter mode specifed:
Setting the mode to markers
Read more about this attribute -> https://plot.ly/r/reference/#scatter-mode
created index-31de0e3a-817c-4d4e-9a60-1a9e23b4ead6.html for plotly-graph component
gpu process crashed - false
Chrome version 59.0.3071.115
Electron version 1.8.4
gpu process crashed - false
Chrome version 59.0.3071.115
Electron version 1.8.4
exported plotx, in 437.799923 ms
-
leaving window open for debugging
|
done with code 0 in 439.87 ms - all task(s) completed
I hope this helps clarify the issue.
Thanks for all the info @0navarro !
Running orca with xvfb
should be enough to solve the gpu process crashed
issues:
https://github.com/plotly/orca#linux-troubleshooting-headless-server-configuration
Thanks for all the info @0navarro !
Running orca with
xvfb
should be enough to solve thegpu process crashed
issues:https://github.com/plotly/orca#linux-troubleshooting-headless-server-configuration
I am already running orca with xvfb
, using a shell script that runs the extracted orca AppImage. So, when I run cat /usr/bin/orca
I get:
xvfb-run -a /squashfs-root/app/orca "$@"
Ok. Have you tried to export a graph using orca in your docker container outside the R interface?
Ok. Have you tried to export a graph using orca in your docker container outside the R interface?
I just ran an example. When I run:
orca graph '{ "data": [{"y": [1,2,1]}] }' -o fig.png --debug=T
I get:
created index-43ff78e2-f9de-4a2d-a7b6-413e0889e22e.html for plotly-graph component
exported fig, in 756.871099 ms
leaving window open for debugging
done with code 0 in 758.36 ms - all task(s) completed
@0navarro It seems like the command ran successfully: done with code 0 in 758.36 ms - all task(s) completed
. Do you still have an issue?
@0navarro It seems like the command ran successfully:
done with code 0 in 758.36 ms - all task(s) completed
. Do you still have an issue?
Hi antoinerg, thank you for your reply.
Unfortunately, I still have the issue. While the command above ran successfully, when I try to use orca within my shiny app within Docker, I get the error mentioned in my post.
When I run orca within Docker either with the R interface or with the terminal, it works fine. However, I get the error when I try to use orca within Docker within my shiny app.
Any insight on this is highly appreciated.
Hi, I ran into a similar problem. In my case there was a problem with the input-filename in the orca function. The error occurs when you try to save the outputfile into a path which not exists. If there is a path in the filename, orca try to write into that, relatively to the current working directory.
I don't know your setup but are you sure that path_split[length(path_split)]
is just the filename without any path? The right operator to give an absolute path is -d , which you can add via more_args.
orca(p,filename, more_args = c("-d",path_to_output ))
I tried your minimal example in a docker-container without problems.
Here my Dockerfile maybe it helps:
FROM openanalytics/r-base
# system libraries of general use
RUN apt-get update && apt-get install -y \
sudo \
pandoc \
pandoc-citeproc \
libcurl4-gnutls-dev \
libcairo2-dev \
libxt-dev \
libssl-dev \
libssh2-1-dev \
libssl1.0.0
# system library dependency for the euler app
RUN apt-get update
RUN apt-get install -y libmpfr-dev
RUN R -e "install.packages('remotes', repos='https://cloud.r-project.org/')"
RUN R -e "remotes::install_github('ropensci/plotly')"
RUN R -e "remotes::install_github('rstudio/shiny',ref='v1.1.0')"
RUN R -e "install.packages(c('processx'), repos='https://cloud.r-project.org/')"
# install orca
RUN apt-get update -y
RUN apt-get install -y libudunits2-dev libproj-dev libgeos-dev libgdal-dev
RUN apt-get install -y libgtk2.0-0 libgconf-2-4 xvfb fuse desktop-file-utils
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
RUN apt-get update -y
RUN apt-get install -y google-chrome-stable
RUN wget https://github.com/plotly/orca/releases/download/v1.2.1/orca-1.2.1-x86_64.AppImage -P /home
RUN chmod 777 /home/orca-1.2.1-x86_64.AppImage
RUN /home/orca-1.2.1-x86_64.AppImage --appimage-extract
RUN printf '#!/bin/bash \nxvfb-run --auto-servernum --server-args "-screen 0 640x480x24" /squashfs-root/app/orca "$@"' > /usr/bin/orca
RUN chmod 777 /usr/bin/orca
# copy the app to the image
RUN mkdir /root/shiny
COPY app.R /root/shiny
EXPOSE 3838
CMD ["R", "-e", "shiny::runApp('/root/shiny',port=3838, host = '0.0.0.0')"]
Hi Diniodoc, thank you for you reply.
path_split[length(path_split)]
does contain only the filename, withouth any path. Moreover, I tried using the -d operator but I got the same error. I used the operator as follows:
orca(p, path_split[length(path_split)], more_args=c("-d",download_path))
so path_split[length(path_split)]
would contain the filename part of the file
argument, such as filec0d15f01af0.png
and download_path
would contain the path part given by the file
argument, such as /tmp/RtmpIGPXku
.
This works well in RStudio outside docker, but throws the error when using Docker.
I will try your Dockerfile to see if this helps and I´ll post my results.
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.
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.
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:
Moreover, when I use orca in the R terminal inside Docker to generate the same plot, it works.
Here is my dockerfile:
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.