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.

error when exporting scatter3d image with orca under Xvfb

See original GitHub issue

I am trying to export scatter3d plot using orca under xvfb. 2D scatter plots are exported correctly. The error occurs only for 3d scatter plots. I will appreciate any help.

library(plotly)

p <- plot_ly(x = 1:10, y = 1:10, color = 1:10)
b <- plotly_build(p)$x[c("data", "layout")]
json <- plotly:::to_JSON(b)

write(json, file="test_1.json")

p <- plot_ly(x = 1:10, y = 1:10, z=1:10, color = 1:10)
b <- plotly_build(p)$x[c("data", "layout")]
json <- plotly:::to_JSON(b)

write(json, file="test_2.json")
test@bc6ecceb987e:~$ orca graph test_1.json -o test_1.png
test@bc6ecceb987e:~$ orca graph test_2.json -o test_2.png

done with code 1 in 154.64 ms - failed or incomplete task(s)
test@bc6ecceb987e:~$ cat `which orca`
#!/bin/bash
xvfb-run  /usr/bin/orca "$@"

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Marcin-Tabakacommented, Sep 5, 2018

Yes, I am trying to run it as a docker image. I have the following lines in a Dockerfile:

RUN apt-get update --fix-missing \
	 && apt-get install -y \
	    ca-certificates \
    	    libglib2.0-0 \
	    libxext6 \
	    libsm6  \
	    libxrender1 \
	    libxml2-dev \
            libglu1-mesa-dev \
            freeglut3-dev \
            mesa-common-dev \
            libxext-dev \
            libxrender-dev \
            libxtst-dev \
            libxss1 \
            libgconf-2-4 \
            libnss3 \
            libasound2 \
            x11vnc \
            xvfb \
            xauth \
            xfonts-base \
             libxt-dev
RUN conda install -c plotly plotly-orca
RUN cp /usr/local/bin/orca /usr/bin/orca
RUN echo '#!/bin/bash\nxvfb-run  /usr/bin/orca "$@" ' > /usr/local/bin/orca && \ 
         chmod +x /usr/local/bin/orca

This works for 2d plots but fails for 3d. I don’t know how to run xvfb as a server as you suggested. Any ideas how to modify Dockerfile to get it working? Thank you.

0reactions
WillForancommented, Jan 5, 2021

Coming here from #97. if I’m using the flag correctly, --enable-webgl does not get around the error for me (Linux 5.10.3-arch1-1) but using the 1.1.1 app image does! 1.3.1 appimage errors in the same way.

plotly::orca also works from R, but only with processx::run and not with system.

My current work around is to mv the 1.1.1 Appimage to ~/bin/orca with $HOME/bin first in $PATH

glxgears
302 frames in 5.0 seconds = 60.397 FPS

which orca
/home/foranw/.local/bin/orca

orca --version
1.3.1

orca graph '{ "data": [{"y": [1,2,1]}] }' --enable-webgl -o /tmp/test_orca.png
[284617:0105/090736.711049:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command

 ./orca-1.1.1-x86_64.AppImage graph '{ "data": [{"y": [1,2,1]}] }' -o /tmp/test_orca.png
# success!

 ./orca-1.3.1.AppImage graph '{ "data": [{"y": [1,2,1]}] }' -o /tmp/test_orca.png
[292859:0105/101120.487253:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command

plotly::orca from R produces a plot without error:

library(plotly)
orca(plot_ly(y = c(1, 2, 1), type="scatter", mode="markers"), "testme.png")

I edited the orca R function to print the command it runs (processx::run). Works in R but not in bash. I cannot find what’s different between the two environments!

processx::run("orca", c("graph", "/tmp/RtmptwshDC/file4652a73d344dc.json", "-o", "testme.png", "--format", "png", "--plotlyjs", "/home/foranw/R/x86_64-pc-linux-gnu-library/4.0/plotly/htmlwidgets/lib/plotlyjs/plotly-latest.min.js"), echo=T, spinner=T)
$status
[1] 0

$stdout
[1] ""

$stderr
[1] ""

$timeout
[1] FALSE

Using system in R gives the same error as in bash

 system("orca graph /tmp/RtmptwshDC/file4652a73d344dc.json -o testme.png --format png --plotlyjs /home/foranw/R/x86_64-pc-linux-gnu-library/4.0/plotly/htmlwidgets/lib/plotlyjs/plotly-latest.min.js ")
[290703:0105/100155.566517:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Orca error - Plotly Community Forum
The orca executable is required in order to export figures as static images, but the executable that was found at 'anaconda3/bin/orca'
Read more >
plotlywidget | Yarn - Package Manager
Install with jupyter labextension install plotlywidget in JupyterLab, otherwise just install Plotly.py and it will automatically work in Classic Notebooks.
Read more >
python-plotly-4.7.1-bp152.1.1 - SUSE Package Hub -
changes from version 4.5.2: * Fixed + Fix build errors in JupyterLab ... for using an externally managed orca server for image export...
Read more >
locate lib Orca with python - plotly - Stack Overflow
This is the error that I got: ValueError: The orca executable is required in order to export figures as static images, but the...
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 >

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