plantuml in pure environment does not find X11

  • Open
  • quality assurance status badge
Details
4 participants
  • Dr. Arne Babenhauserheide
  • Efraim Flashner
  • Maxime Devos via web
  • Maxime Devos
Owner
unassigned
Submitted by
Dr. Arne Babenhauserheide
Severity
normal
D
D
Dr. Arne Babenhauserheide wrote on 15 Feb 2021 13:52
(address . bug-guix@gnu.org)
87r1lh4hnp.fsf@web.de
Dear Guix hackers,

when installing plantuml in a pure environment, it throws an java.awt.AWTError: Can't connect to X11 window server using ':1' as the value of the DISPLAY variable.

To reproduce:

$ guix environment --ad-hoc --pure plantuml -- plantumlNo protocol specified
Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':1' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1181)
at net.sourceforge.plantuml.FileFormat.<clinit>(FileFormat.java:93)
at net.sourceforge.plantuml.Option.<init>(Option.java:97)
at net.sourceforge.plantuml.Run.main(Run.java:93)

When I leave out --pure, it works, so I assume that a dependency on X11
might be missing.

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken
-----BEGIN PGP SIGNATURE-----

iQJEBAEBCAAuFiEE801qEjXQSQPNItXAE++NRSQDw+sFAmAqbpsQHGFybmVfYmFi
QHdlYi5kZQAKCRAT741FJAPD68v5D/47XbLRl/kYcSw/UDP1b++agr1/Mnz2UNfK
8Zn8xFr33tUrq7aQJbCFKQ2fn1GyRB+jrR5KB6uEEnSmBD4X19pOVaOrcq+OTRLV
+Xk0C69WO49tJxtR7nhIYZR+pq1JM7UUZCwnpDBhXo549GfIjFWNk6xHmNF3y7PA
kyD0e24P/7D2RZPDt900jdmKeEgPTYLgxu2pz/20ntNJqOXXio+5BmcX+6uXLxIw
ESPHSKjY+jW2W3PTUm+MwC3orltSHj7a0VODaesBpLuSvO+zxQTSVBu8Iopes2EV
iv9Ta/OS28aaM1wzcHth8pPSKmy9byE6yYddcqcbeIzwcbfSpI4Hs2AjY1FdxRD+
c595kW8nJvC5uCEv76dwg082WThH1cpHANyvwJlJR/IcsDU+8OyXRHtxTI/DgnHU
eUUTZdfBKqzgPLOIAVwtV3Q+W1bP9763NLVKaNSpvL1km1Xx+Dj03HtiFRqBB8eB
5riPY9C5OHUgTBixXX+xoF9DIUMWE1jtowcMur/fTDupwlrkjt2YQOrcKKW0SBC0
A07IyqbLVNQa4BB2x1Hj9Gxoz8hOaRMVwfhehY8Cz3ezuxszggnn85LhlGCBL90g
/qfXM/FZH9Cy6MZaFFPhSIGgh6uB2AQ+eeKeH5KcsepPOcN4PVhfNdlzf7L3hLqz
3Q9QpDY2gIjEBAEBCAAuFiEE3Si95tmHXKvOSosd3M8NswvBBUgFAmAqbqAQHGFy
bmVfYmFiQHdlYi5kZQAKCRDczw2zC8EFSO3KA/4gjJqEmDhvPd1/Is+l7uxd5Xlp
fJ/oCLsEPjIzxe7u0AanjR4GzP+su34dLRKDjhxu8xyXpX3batQwz9LMJEM4KMMh
P7ELAsAFfKTLbEbHGWRDSSJq8KIDIOg0WG7v+UtQYcYsIVj/97lXptxMTqu+gMRx
f+ydFUtZChb9u8I9fA==
=qw63
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 15 Feb 2021 16:11
952377df529e4b18265dc84fd5367c91bef0a80b.camel@telenet.be
On Mon, 2021-02-15 at 13:52 +0100, Dr. Arne Babenhauserheide wrote:
Toggle quote (4 lines)
> Dear Guix hackers,
>
> when installing plantuml in a pure environment, it throws an java.awt.AWTError: Can't connect to X11 window server using ':1' as the value of the DISPLAY variable.

Is the environment variable XAUTHORITY set?
Compare the value inside the environment and outside the environment.

Perhaps "XAUTHORITY" should be added to %precious-variables in
guix/scripts/environment.scm. An untested patch is attached,
I'll test it now.

Greetings,
Maxime.
From 7eac4f5a427fb094865ece58c3509606264884b0 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 15 Feb 2021 16:07:37 +0100
Subject: [PATCH] scripts: preserve XAUTHORITY in pure environments

(XXX untested)


* guix/scripts/environment.scm
(%precious-variables): add 'XAUTHORITY'
---
guix/scripts/environment.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index f4d12f89bf..656294d29d 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -53,7 +53,7 @@
;; Protect some env vars from purification. Borrowed from nix-shell.
(define %precious-variables
- '("HOME" "USER" "LOGNAME" "DISPLAY" "TERM" "TZ" "PAGER"))
+ '("HOME" "USER" "LOGNAME" "XAUTHORITY" "DISPLAY" "TERM" "TZ" "PAGER"))
(define %default-shell
(or (getenv "SHELL") "/bin/sh"))
--
2.30.0
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYCqPOhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lnVAQC9q0wyLWLY87HQCa5GqwyU7BIF
D+Dz1MElMipDBcbg6QD/Q82PfEa0hyZ/3b24i4Ibb6ZX3ADx9f/x4jOjZ2fqswI=
=oYzW
-----END PGP SIGNATURE-----


M
M
Maxime Devos via web wrote on 15 Feb 2021 16:18
plantuml in pure environment does not find X11
(address . 46532@debbugs.gnu.org)
7f9bd98fca60.131d81dee0929a6a@guile.gnu.org
self-proposed patch works for me
E
E
Efraim Flashner wrote on 16 Feb 2021 10:32
(name . Dr. Arne Babenhauserheide)(address . arne_bab@web.de)(address . 46532@debbugs.gnu.org)
YCuRKQTv/GhzfIUo@3900XT
On Mon, Feb 15, 2021 at 01:52:42PM +0100, Dr. Arne Babenhauserheide wrote:
Toggle quote (26 lines)
> Dear Guix hackers,
>
> when installing plantuml in a pure environment, it throws an java.awt.AWTError: Can't connect to X11 window server using ':1' as the value of the DISPLAY variable.
>
> To reproduce:
>
> $ guix environment --ad-hoc --pure plantuml -- plantumlNo protocol specified
> Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':1' as the value of the DISPLAY variable.
> at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
> at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
> at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:264)
> at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
> at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
> at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1181)
> at net.sourceforge.plantuml.FileFormat.<clinit>(FileFormat.java:93)
> at net.sourceforge.plantuml.Option.<init>(Option.java:97)
> at net.sourceforge.plantuml.Run.main(Run.java:93)
>
> When I leave out --pure, it works, so I assume that a dependency on X11
> might be missing.
>

I have the following scriptlet that someone shared for running eolie in
a container. I'm guessing it could be modified to run platuml if needed.


--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
guix environment \
--preserve='^DISPLAY$' --container --network \
--expose=/etc/machine-id \
--expose=/etc/ssl/certs/ \
--share=$HOME/.local/share/eolie/=$HOME/.local/share/eolie/ \
--share=/tmp/.X11-unix/=/tmp/.X11-unix/ \
--share=$HOME/.Xauthority=$HOME/.Xauthority \
--ad-hoc eolie nss-certs dbus -- eolie
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmArkSkACgkQQarn3Mo9
g1EAKhAAsQLd3I+Pn9SPEO4d1nvYSA/e08rgXbi0jvG7kJQof8/s5X2OXxY2e7+w
OKG78wbm8WAnRqRi34MwlcfqhR0mUMLHzjzASqK6sXFy1PK15fkh3tSsaA41C6zC
YkvD8So/wGwncv9uswgFLT4YFOGCZSCkneBvO0W+psAiUEcZ8Vr8So7FYVwCQuNx
cLF0opCQnNWjdzbbE43YosK9rCmZOUD5nVUlmJL4EpBTbEUkzs+j8rAvWqv2u/J4
kf+xMJ3bQBrzrmKR6DTRi+3Oc73lGiVHPLXqKUnzxtIWW2dzfJ6fcLZDguEzdFva
1BI8VaZPgEWPSuI8bBGcwoGyEtOT2rFSAJvGewYOB+CLjQkCTSkZb9bjpYeuRTLr
Jxy6rbre007nBiJTpzZyvCPnYkz+snHNv1ET8xhVORSV+EBoNTGh0CgW/wh9rAWp
O9bHtYvIvgGrONET5r1O99rzykp125dZMFxbaF9yaHSLr/zgFnV2oQozWkyIL7St
ZmhrE67v57GgWAN8xH4bfRNS1xUPamBkCpdp5Vljqmq9+PtyDg7KjRtKIEnIP1a6
8ChimVBnWFmf0w2gspkfdavyuew+S5CqPu6pNzLCld2RiKzOjkvzahK8SjhMwWVY
/SU8eg4O1iHG/dvTDcox6g3oqVr8HuCrSLsITvKf0WHcpEDYSv4=
=3zSt
-----END PGP SIGNATURE-----


?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 46532@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 46532
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch