Shiny-server and x11

702 views
Skip to first unread message

Luca Fenu

unread,
Feb 8, 2013, 5:46:32 AM2/8/13
to shiny-...@googlegroups.com
Hi, shiny-ers!

We've managed to install and configure the shine-server to run on our linux server. My scripts run fine and the UI page is presented properly, but the graphics do not show - instead an error is reported:

ERROR: *X11 is not available.

We tracked this down to the lack of a proper X-server on the machine, so we configured shiny-server to print  using a virtual
framebuffer X (Xvfb). We modified the shiny-server startup script to run
Xvfb and export DISPLAY=:3.1 - this worked fine for other softwares running on the machine.

ws1 ~ # ps -ef | grep Xvfb
shiny     5205     1  0 15:10 ?        00:00:00 /usr/bin/Xvfb :3 -screen 1
800x600x16

Even when I explicitly defined the DISPLAY variable in the server.R like this: 
Sys.setenv(DISPLAY = ":3.1")
It didn't work and the error permains. In a last ditch attempt, I even tried to set 
options(bitmapType="cairo")
which I saw was a suggestion for a somewheat related problem in another thread.

None of this fixes seems to work. Any idea on where I'm going wrong?

Many thanks to whomever may point me in the right direction.

Luca

Winston Chang

unread,
Feb 8, 2013, 11:15:00 AM2/8/13
to shiny-...@googlegroups.com
Some graphics packages, such as rgl, require X, but regular graphics should work without X. Do the example apps work properly for you?

If you could share some information about your server and your shiny app, that would help to diagnose the problem.

-Winston



--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Anders Lövgren

unread,
Feb 11, 2013, 11:14:00 AM2/11/13
to shiny-...@googlegroups.com
Hi,

I think this is solved now. 

The server is running Gentoo Linux (2.1 from /etc/gentoo-release). The package dev-lang/R (2.15.2) was installed without the X and png use flags. Adding these use flags in /etc/portage/package.use and recompiling R fixed it.

Theres still an error message '`hmax` must be a non-negative value', but I think its unrelated.

Cheers, Anders

Luca Fenu

unread,
Feb 12, 2013, 5:39:55 AM2/12/13
to shiny-...@googlegroups.com
Hi,

Yes, the hmax error has to do with shiny trying to plot before the data is actually there.

I think it is working now, although I seem to get another error too - but I'll work on that...

Thanks to both, 

Luca

Jeff Allen

unread,
Feb 27, 2013, 8:20:20 PM2/27/13
to shiny-...@googlegroups.com
As Winston mentioned, you shouldn't need X running to do base graphics, but if you are doing something fancier like RGL that does require XVFB, here's one way to do it:

http://trestletechnology.net/2013/02/graphical-tools-rgl-on-a-headless-shiny-server/

Luca Fenu

unread,
Feb 28, 2013, 4:35:13 AM2/28/13
to shiny-...@googlegroups.com
Thanks, Jeff.

I am indeed working on a new script and would like to use rgl for data visualisation, either orienting the view ad-hoc and exporting to pdf/png for download (for which I already have the code), or interactively exporting somehow to webGL. If I can get the later working nicely with shiny (I alreade saw some examples in this forum) I'll post the link or upload them to glimmer for others to play/learn...

Cheers,

Luca.

--
You received this message because you are subscribed to a topic in the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/shiny-discuss/zUrCmABVbPo/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to shiny-discus...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages