David Wolfskill
2014-Feb-25 18:36 UTC
[R] png-generation from script (non-X11 env) now broken?
Since ... hmmm.. May 2012, I've had a cron-initiated script running monthly to extract some data and generate some numeric tables and plots (in PNG format). In its "normal" mode, the script automagically sends its results to a small handful of managers on the first of each month. Out of self-defense, I set up a "preview" run several days before the real one; the preview doesn't go quite as high in the management chain. This morning, I found a message in my mailbox from such a preview run: | Error in .External2(C_X11, paste("png::", filename, sep = ""), g$width, : | unable to start device PNG | Calls: gen_build_histogram -> png | In addition: Warning message: | In png(filename = fn, height = height, width = width, units = "in", : | unable to open connection to X11 display '' | Execution halted [This was running R-3.0.2_1 in FreeBSD/amd64 9.2-STABLE r262323M/262357:902506, built Sun Feb 23 05:14:37 PST 2014.] I admit that I haven't been following changes in R very closely -- the script had been running reliably for over a year, and it's not one of the fires I've been fighting recently. But the implication -- that png() was suddenly[1] changed so that it requires the ability to connect to an X11 display -- seemed peculiar enough that I would have thought a quick search would lead me to soe discussion of a change of this magnitude, rationale, and what folks might do to mitigate the effects. Based on one message I found (from 02 Mar 2008!), I did take a look at "help png" output, and saw the reference there to bitmap(). I tried ... hacking ... my functions to use "bitmap(fn, ...)" instead of "png(filename = fn, ...)", but that looks as if it's leading me astray: | Error in strwidth(legend, units = "user", cex = cex, font = text.font) : | family 'mono' not included in postscript() device | Calls: gen_build_histogram -> legend -> strwidth | Execution halted So... what's someone who wants to use R to generate PNG-format files from an environment that is bereft of X11 to do? 1: "Suddenly" because it *had* been working up to 01 Feb 2014, at least. [I'll be happy to sumamrize responses that aren't sent to the list.] Peace, david -- David H. Wolfskill r at catwhisker.org Taliban: Evil cowards with guns afraid of truth from a 14-year old girl. See http://www.catwhisker.org/~david/publickey.gpg for my public key. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 964 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20140225/cec993d7/attachment.bin>
Hi, You can try to use cairo instead of png. IT doesn?t require X. try putting this line in a Rprofile file : options(bitmapType="cairo") Massimo. On Feb 25, 2014, at 1:36 PM, David Wolfskill <r at catwhisker.org> wrote:> Since ... hmmm.. May 2012, I've had a cron-initiated script running > monthly to extract some data and generate some numeric tables and > plots (in PNG format). > > In its "normal" mode, the script automagically sends its results > to a small handful of managers on the first of each month. Out of > self-defense, I set up a "preview" run several days before the real > one; the preview doesn't go quite as high in the management chain. > > This morning, I found a message in my mailbox from such a preview run: > > | Error in .External2(C_X11, paste("png::", filename, sep = ""), g$width, : > | unable to start device PNG > | Calls: gen_build_histogram -> png > | In addition: Warning message: > | In png(filename = fn, height = height, width = width, units = "in", : > | unable to open connection to X11 display '' > | Execution halted > > [This was running R-3.0.2_1 in FreeBSD/amd64 9.2-STABLE > r262323M/262357:902506, built Sun Feb 23 05:14:37 PST 2014.] > > I admit that I haven't been following changes in R very closely -- > the script had been running reliably for over a year, and it's not > one of the fires I've been fighting recently. > > But the implication -- that png() was suddenly[1] changed so that it > requires the ability to connect to an X11 display -- seemed peculiar > enough that I would have thought a quick search would lead me to soe > discussion of a change of this magnitude, rationale, and what folks > might do to mitigate the effects. > > Based on one message I found (from 02 Mar 2008!), I did take a look at > "help png" output, and saw the reference there to bitmap(). I tried ... > hacking ... my functions to use "bitmap(fn, ...)" instead of > "png(filename = fn, ...)", but that looks as if it's leading me astray: > > | Error in strwidth(legend, units = "user", cex = cex, font = text.font) : > | family 'mono' not included in postscript() device > | Calls: gen_build_histogram -> legend -> strwidth > | Execution halted > > > So... what's someone who wants to use R to generate PNG-format files > from an environment that is bereft of X11 to do? > > > 1: "Suddenly" because it *had* been working up to 01 Feb 2014, at least. > > [I'll be happy to sumamrize responses that aren't sent to the list.] > > Peace, > david > -- > David H. Wolfskill r at catwhisker.org > Taliban: Evil cowards with guns afraid of truth from a 14-year old girl. > > See http://www.catwhisker.org/~david/publickey.gpg for my public key. > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Hi David, Did you see https://stat.ethz.ch/pipermail/r-help/2010-March/231778.html ? What does capabilities() tell you? Best, Ista On Tue, Feb 25, 2014 at 1:36 PM, David Wolfskill <r at catwhisker.org> wrote:> Since ... hmmm.. May 2012, I've had a cron-initiated script running > monthly to extract some data and generate some numeric tables and > plots (in PNG format). > > In its "normal" mode, the script automagically sends its results > to a small handful of managers on the first of each month. Out of > self-defense, I set up a "preview" run several days before the real > one; the preview doesn't go quite as high in the management chain. > > This morning, I found a message in my mailbox from such a preview run: > > | Error in .External2(C_X11, paste("png::", filename, sep = ""), g$width, : > | unable to start device PNG > | Calls: gen_build_histogram -> png > | In addition: Warning message: > | In png(filename = fn, height = height, width = width, units = "in", : > | unable to open connection to X11 display '' > | Execution halted > > [This was running R-3.0.2_1 in FreeBSD/amd64 9.2-STABLE > r262323M/262357:902506, built Sun Feb 23 05:14:37 PST 2014.] > > I admit that I haven't been following changes in R very closely -- > the script had been running reliably for over a year, and it's not > one of the fires I've been fighting recently. > > But the implication -- that png() was suddenly[1] changed so that it > requires the ability to connect to an X11 display -- seemed peculiar > enough that I would have thought a quick search would lead me to soe > discussion of a change of this magnitude, rationale, and what folks > might do to mitigate the effects. > > Based on one message I found (from 02 Mar 2008!), I did take a look at > "help png" output, and saw the reference there to bitmap(). I tried ... > hacking ... my functions to use "bitmap(fn, ...)" instead of > "png(filename = fn, ...)", but that looks as if it's leading me astray: > > | Error in strwidth(legend, units = "user", cex = cex, font = text.font) : > | family 'mono' not included in postscript() device > | Calls: gen_build_histogram -> legend -> strwidth > | Execution halted > > > So... what's someone who wants to use R to generate PNG-format files > from an environment that is bereft of X11 to do? > > > 1: "Suddenly" because it *had* been working up to 01 Feb 2014, at least. > > [I'll be happy to sumamrize responses that aren't sent to the list.] > > Peace, > david > -- > David H. Wolfskill r at catwhisker.org > Taliban: Evil cowards with guns afraid of truth from a 14-year old girl. > > See http://www.catwhisker.org/~david/publickey.gpg for my public key. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Jeff Newmiller
2014-Feb-25 19:10 UTC
[R] png-generation from script (non-X11 env) now broken?
This is really not new... Google is your friend... http://bit.ly/1fCUnQH... or read FAQ 7.19. The fact that this "changed" for you seems more like something changed on your end... did your admin remove X11 from your system? --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. On February 25, 2014 10:36:29 AM PST, David Wolfskill <r at catwhisker.org> wrote:>Since ... hmmm.. May 2012, I've had a cron-initiated script running >monthly to extract some data and generate some numeric tables and >plots (in PNG format). > >In its "normal" mode, the script automagically sends its results >to a small handful of managers on the first of each month. Out of >self-defense, I set up a "preview" run several days before the real >one; the preview doesn't go quite as high in the management chain. > >This morning, I found a message in my mailbox from such a preview run: > >| Error in .External2(C_X11, paste("png::", filename, sep = ""), >g$width, : >| unable to start device PNG >| Calls: gen_build_histogram -> png >| In addition: Warning message: >| In png(filename = fn, height = height, width = width, units = "in", >: >| unable to open connection to X11 display '' >| Execution halted > >[This was running R-3.0.2_1 in FreeBSD/amd64 9.2-STABLE >r262323M/262357:902506, built Sun Feb 23 05:14:37 PST 2014.] > >I admit that I haven't been following changes in R very closely -- >the script had been running reliably for over a year, and it's not >one of the fires I've been fighting recently. > >But the implication -- that png() was suddenly[1] changed so that it >requires the ability to connect to an X11 display -- seemed peculiar >enough that I would have thought a quick search would lead me to soe >discussion of a change of this magnitude, rationale, and what folks >might do to mitigate the effects. > >Based on one message I found (from 02 Mar 2008!), I did take a look at >"help png" output, and saw the reference there to bitmap(). I tried >... >hacking ... my functions to use "bitmap(fn, ...)" instead of >"png(filename = fn, ...)", but that looks as if it's leading me astray: > >| Error in strwidth(legend, units = "user", cex = cex, font >text.font) : >| family 'mono' not included in postscript() device >| Calls: gen_build_histogram -> legend -> strwidth >| Execution halted > > >So... what's someone who wants to use R to generate PNG-format files >from an environment that is bereft of X11 to do? > > >1: "Suddenly" because it *had* been working up to 01 Feb 2014, at >least. > >[I'll be happy to sumamrize responses that aren't sent to the list.] > >Peace, >david
David Wolfskill
2014-Feb-25 22:33 UTC
[R] [SOLVED -- my fault] png-generation from script (non-X11 env) now broken?
On Tue, Feb 25, 2014 at 10:36:29AM -0800, David Wolfskill wrote:> ... > This morning, I found a message in my mailbox from such a preview run: > > | Error in .External2(C_X11, paste("png::", filename, sep = ""), g$width, : > | unable to start device PNG > | Calls: gen_build_histogram -> png > | In addition: Warning message: > | In png(filename = fn, height = height, width = width, units = "in", : > | unable to open connection to X11 display '' > | Execution halted > > [This was running R-3.0.2_1 in FreeBSD/amd64 9.2-STABLE > r262323M/262357:902506, built Sun Feb 23 05:14:37 PST 2014.] > ...The above is no longer a problem. After a variety of approaches, I decided to rebuild the graphics/png, graphics/cairo, and all of the R-* ports on the machine. A summary: ===>>> The following actions were performed: Re-installation of png-1.5.18 Re-installation of cairo-1.10.2_7,2 Re-installation of R-3.0.2_1 Re-installation of R-cran-DBI-0.2.7_3 Re-installation of R-cran-RColorBrewer-1.0.5_11 Re-installation of R-cran-RMySQL-0.9.3_8 Re-installation of R-cran-colorspace-1.2.4_2 Re-installation of R-cran-dichromat-2.0.0_4 Re-installation of R-cran-digest-0.6.4 Re-installation of R-cran-iterators-1.0.6_7 Re-installation of R-cran-itertools-0.1.1_11 Re-installation of R-cran-plyr-1.8_5 Re-installation of R-cran-proto-0.3.10_5 Re-installation of R-cran-stringr-0.6.2_5 Re-installation of R-cran-reshape2-1.2.2_5 Re-installation of R-cran-munsell-0.4.2_2 Re-installation of R-cran-labeling-0.2_2 Re-installation of R-cran-scales-0.2.3_5 Re-installation of R-cran-gtable-0.1.2_5 Re-installation of R-cran-ggplot2-0.9.3.1_4 Re-installation of R-cran-zoo-1.7.10_2 ===>>> Exiting Folowing that, I trried running the script in an xterm without DISPLAY defined; it worked as it had before. As I type, I'm running it out of cron, and it's creating PNG files.... Evidently, I screwed up an update within the last few weeks, so my allegation that this was something that had changed in R was not true. I apologize if I mislead or offended anyone: I was wrong. And "thank you" again to those who tried to help. Peace, david (back to cloaked mode) -- David H. Wolfskill r at catwhisker.org Taliban: Evil cowards with guns afraid of truth from a 14-year old girl. See http://www.catwhisker.org/~david/publickey.gpg for my public key. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 964 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20140225/932540a8/attachment.bin>
MacQueen, Don
2014-Feb-26 16:32 UTC
[R] png-generation from script (non-X11 env) now broken?
This is mostly a guess... At the end of January, your script succeeded. Your OS was "built Sun Feb 23 05:14:37 PST 2014." Your script failed on Feb 26. You probably had not made any changes to R between the end of January and Feb 26 (I don't see any mention of having done so, and R does not update itself -- unless you have some OS level package manager that does it for you; I wouldn't know about that). At this point, I'd wonder if the OS update on 2/23 changed come libraries that R relies on for png graphics. Perhaps you need to rebuild R, so that it uses the changed/updated OS libraries. Hopefully that OS update did not completely remove libraries that R depends on for png. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 2/25/14 10:36 AM, "David Wolfskill" <r at catwhisker.org> wrote:>Since ... hmmm.. May 2012, I've had a cron-initiated script running >monthly to extract some data and generate some numeric tables and >plots (in PNG format). > >In its "normal" mode, the script automagically sends its results >to a small handful of managers on the first of each month. Out of >self-defense, I set up a "preview" run several days before the real >one; the preview doesn't go quite as high in the management chain. > >This morning, I found a message in my mailbox from such a preview run: > >| Error in .External2(C_X11, paste("png::", filename, sep = ""), g$width, > : >| unable to start device PNG >| Calls: gen_build_histogram -> png >| In addition: Warning message: >| In png(filename = fn, height = height, width = width, units = "in", : >| unable to open connection to X11 display '' >| Execution halted > >[This was running R-3.0.2_1 in FreeBSD/amd64 9.2-STABLE >r262323M/262357:902506, built Sun Feb 23 05:14:37 PST 2014.] > >I admit that I haven't been following changes in R very closely -- >the script had been running reliably for over a year, and it's not >one of the fires I've been fighting recently. > >But the implication -- that png() was suddenly[1] changed so that it >requires the ability to connect to an X11 display -- seemed peculiar >enough that I would have thought a quick search would lead me to soe >discussion of a change of this magnitude, rationale, and what folks >might do to mitigate the effects. > >Based on one message I found (from 02 Mar 2008!), I did take a look at >"help png" output, and saw the reference there to bitmap(). I tried ... >hacking ... my functions to use "bitmap(fn, ...)" instead of >"png(filename = fn, ...)", but that looks as if it's leading me astray: > >| Error in strwidth(legend, units = "user", cex = cex, font = text.font) >: >| family 'mono' not included in postscript() device >| Calls: gen_build_histogram -> legend -> strwidth >| Execution halted > > >So... what's someone who wants to use R to generate PNG-format files >from an environment that is bereft of X11 to do? > > >1: "Suddenly" because it *had* been working up to 01 Feb 2014, at least. > >[I'll be happy to sumamrize responses that aren't sent to the list.] > >Peace, >david >-- >David H. Wolfskill r at catwhisker.org >Taliban: Evil cowards with guns afraid of truth from a 14-year old girl. > >See http://www.catwhisker.org/~david/publickey.gpg for my public key.