Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWTError: Can't connect to X11 window server using 'unix:0' #14943

Closed
dsouzai opened this issue Apr 20, 2022 · 11 comments
Closed

AWTError: Can't connect to X11 window server using 'unix:0' #14943

dsouzai opened this issue Apr 20, 2022 · 11 comments

Comments

@dsouzai
Copy link
Contributor

dsouzai commented Apr 20, 2022

Failure link

https://openj9-jenkins.osuosl.org/job/Test_openjdk17_j9_sanity.functional_ppc64_aix_Personal_testList_0/82

Optional info

  • intermittent failure (yes):
  • regression or new test: N/A

Occurs periodically on AIX AOT tests; see #14894 (comment). This error has been happening for a while; opening this issue to give reviewers something to refer to in order to justify merging PRs where this error shows up in PR builds.

Failure output (captured from console output)

[2022-04-20T00:28:59.944Z]  [OUT] fontmanger LIB: libfontmanager.so
[2022-04-20T00:28:59.944Z]  [ERR] Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'unix:0' as the value of the DISPLAY variable.
[2022-04-20T00:28:59.944Z]  [ERR] 	at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
[2022-04-20T00:28:59.944Z]  [ERR] 	at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:101)
[2022-04-20T00:28:59.944Z]  [ERR] 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:692)
@pshipton
Copy link
Member

@AdamBrousseau

@AdamBrousseau
Copy link
Contributor

AdamBrousseau commented Jun 8, 2022

Number 8 appears to have X11 installed correctly. Is this intermittent or does it always fail?

@pshipton
Copy link
Member

Seeing more of these today, did something change?
https://openj9-jenkins.osuosl.org/job/Test_openjdk8_j9_sanity.functional_ppc64_aix_OpenJDK8_testList_0/35 - p8-java1-ibm04
https://openj9-jenkins.osuosl.org/job/Test_openjdk8_j9_sanity.functional_ppc64_aix_OMR_testList_0/290/ - p8-java1-ibm08

Tried a grinder and the test, when run by itself, passed on p8-java1-ibm09

@pshipton
Copy link
Member

pshipton commented Aug 30, 2022

Try more grinders https://openj9-jenkins.osuosl.org/view/Test/job/Grinder/1260/
Passed on 7, 9, 11
Failed on 8, 12

@pshipton
Copy link
Member

Number 8 appears to have X11 installed correctly.

Perhaps having X11 installed correctly isn't the problem. Is it running?

@ymanton
Copy link
Member

ymanton commented Aug 31, 2022

Saw this while testing #15683

I think the X server may not be handling client disconnections properly, or clients are not disconnecting properly on AIX.

While running a grinder I noticed that in each iteration we try to start an X server without stopping the previous one. The first test run successfully connects to the newly started X server:

[2022-08-31T06:17:06.838Z] ITERATION: 1/100
[Pipeline] sh
[2022-08-31T06:17:07.188Z] + nohup /usr/bin/X11/X -force -vfb -x abx -x dbe -x GLX -secIP 000 :0
[2022-08-31T06:17:07.189Z] :0
[Pipeline] echo
[2022-08-31T06:17:07.219Z] env.DISPLAY is unix:0

...

[2022-08-31T06:17:33.630Z] TEST TARGETS SUMMARY
[2022-08-31T06:17:33.630Z] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[2022-08-31T06:17:33.630Z] PASSED test targets:
[2022-08-31T06:17:33.630Z] 	cmdLineTester_libpathTestRtf_0
[2022-08-31T06:17:33.630Z] 
[2022-08-31T06:17:33.630Z] TOTAL: 1   EXECUTED: 1   PASSED: 1   FAILED: 0   DISABLED: 0   SKIPPED: 0
[2022-08-31T06:17:33.630Z] ALL TESTS PASSED
[2022-08-31T06:17:33.630Z] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Subsequent iterations try to start a new X server but that fails because the first is still up and listening on the port.

[2022-08-31T06:17:33.971Z] ITERATION: 2/100
[Pipeline] sh
[2022-08-31T06:17:34.292Z] + nohup /usr/bin/X11/X -force -vfb -x abx -x dbe -x GLX -secIP 000 :0
[2022-08-31T06:17:34.292Z] 
[2022-08-31T06:17:34.292Z] Fatal server error:
[2022-08-31T06:17:34.292Z] Cannot establish any listening sockets - Make sure an X server isn't already running
[Pipeline] echo
[2022-08-31T06:17:34.310Z] env.DISPLAY is unix:0

Subsequent test runs fail to connect to the original X server.

[2022-08-31T06:18:08.103Z] Test result: FAILED
[2022-08-31T06:18:08.103Z] Output from test:
[2022-08-31T06:18:08.103Z]  [OUT] com.ibm.oti.vm.bootstrap.library.path=/home/jenkins/workspace/Grinder_testList_0/openjdkbinary/j2sdk-image/jre/lib/ppc64/default:/home/jenkins/workspace/Grinder_testList_0/openjdkbinary/j2sdk-image/jre/lib/ppc64
[2022-08-31T06:18:08.103Z]  [OUT] sun.boot.library.path=/home/jenkins/workspace/Grinder_testList_0/openjdkbinary/j2sdk-image/jre/lib/ppc64/default:/home/jenkins/workspace/Grinder_testList_0/openjdkbinary/j2sdk-image/jre/lib/ppc64
[2022-08-31T06:18:08.104Z]  [OUT] java.library.path=/home/jenkins/workspace/Grinder_testList_0/openjdkbinary/j2sdk-image/jre/lib/ppc64/default:/home/jenkins/workspace/Grinder_testList_0/openjdkbinary/j2sdk-image/jre/lib/ppc64:/home/jenkins/workspace/Grinder_testList_0/openjdkbinary/j2sdk-image/jre/lib/ppc64/j9vm:/home/jenkins/workspace/Grinder_testList_0/openjdkbinary/j2sdk-image/jre/lib/ppc64:/home/jenkins/workspace/Grinder_testList_0/openjdkbinary/j2sdk-image/jre/lib/ppc64/jli:/home/jenkins/workspace/Grinder_testList_0/openjdkbinary/j2sdk-image/jre/../lib/ppc64:/opt/java8_64/jre/lib/ppc64/j9vm:/opt/java8_64/jre/lib/ppc64:/opt/java8_64/jre/lib/ppc64/jli:/opt/java8_64/jre/../lib/ppc64:/usr/lib:/usr/lib64:/usr/lib
[2022-08-31T06:18:08.104Z]  [OUT] fontmanger LIB: libfontmanager.a
[2022-08-31T06:18:08.104Z]  [ERR] Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'unix:0' as the value of the DISPLAY variable.
[2022-08-31T06:18:08.104Z]  [ERR] 	at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
[2022-08-31T06:18:08.104Z]  [ERR] 	at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
[2022-08-31T06:18:08.104Z]  [ERR] 	at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.security.AccessController.doPrivileged(AccessController.java:691)
[2022-08-31T06:18:08.104Z]  [ERR] 	at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.lang.Class.forNameImpl(Native Method)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.lang.Class.forName(Class.java:340)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
[2022-08-31T06:18:08.104Z]  [ERR] 	at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:131)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.lang.Class.forNameImpl(Native Method)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.lang.Class.forName(Class.java:340)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.awt.Toolkit$2.run(Toolkit.java:860)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.awt.Toolkit$2.run(Toolkit.java:855)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.security.AccessController.doPrivileged(AccessController.java:691)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.awt.Toolkit.getEventQueue(Toolkit.java:1736)
[2022-08-31T06:18:08.104Z]  [ERR] 	at java.awt.EventQueue.isDispatchThread(EventQueue.java:1071)
[2022-08-31T06:18:08.104Z]  [ERR] 	at javax.swing.SwingUtilities.isEventDispatchThread(SwingUtilities.java:1366)
[2022-08-31T06:18:08.104Z]  [ERR] 	at javax.swing.text.StyleContext.reclaim(StyleContext.java:454)
[2022-08-31T06:18:08.104Z]  [ERR] 	at javax.swing.text.StyleContext.addAttribute(StyleContext.java:311)
[2022-08-31T06:18:08.104Z]  [ERR] 	at javax.swing.text.StyleContext$NamedStyle.addAttribute(StyleContext.java:1501)
[2022-08-31T06:18:08.104Z]  [ERR] 	at javax.swing.text.StyleContext$NamedStyle.setName(StyleContext.java:1312)
[2022-08-31T06:18:08.104Z]  [ERR] 	at javax.swing.text.StyleContext$NamedStyle.<init>(StyleContext.java:1259)
[2022-08-31T06:18:08.104Z]  [ERR] 	at javax.swing.text.StyleContext.addStyle(StyleContext.java:107)
[2022-08-31T06:18:08.104Z]  [ERR] 	at javax.swing.text.StyleContext.<init>(StyleContext.java:87)
[2022-08-31T06:18:08.104Z]  [ERR] 	at javax.swing.text.DefaultStyledDocument.<init>(DefaultStyledDocument.java:106)
[2022-08-31T06:18:08.104Z]  [ERR] 	at org.openj9.test.libpath.Rtf.convert(Rtf.java:42)
[2022-08-31T06:18:08.104Z]  [ERR] 	at org.openj9.test.libpath.Rtf.main(Rtf.java:60)

I can't tell from the existing output what the problem is, but there might be something in the X server log, if someone can get access to it.

@pshipton
Copy link
Member

@llxia can someone take a look at this pls.

@llxia
Copy link
Contributor

llxia commented Sep 1, 2022

Sure, we will look into this.

@llxia
Copy link
Contributor

llxia commented Sep 7, 2022

I can only reproduce this issue when setting iterations as we repeatedly start an X server within each iteration. So far, I am not able to reproduce the error when repeatedly triggering new jobs on the same machine.

  • ITERATIONS=5: Grinder/27199/
    1st iteration passed and the rest failed with the expected error - Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'unix:0' as the value of the DISPLAY variable.
  • same Grinder job with ITERATIONS=1 right after and it passed: Grinder/27200

I will move x11 cmd out of the loop. And I suspect that we do not need nohup in the cmd.

llxia added a commit to llxia/openjdk-tests that referenced this issue Sep 8, 2022
- move x11 cmd outside of iterations
- remove nohup in x11 cmd
- only start x11 for BUILD_LIST=openjdk, jck and/or functional

Related: eclipse-openj9/openj9#14943

Signed-off-by: lanxia <[email protected]>
sophia-guo pushed a commit to adoptium/aqa-tests that referenced this issue Sep 9, 2022
- move x11 cmd outside of iterations
- remove nohup in x11 cmd
- only start x11 for BUILD_LIST=openjdk, jck and/or functional

Related: eclipse-openj9/openj9#14943

Signed-off-by: lanxia <[email protected]>

Signed-off-by: lanxia <[email protected]>
@llxia
Copy link
Contributor

llxia commented Sep 12, 2022

PR is delivered. Close this issue. Please reopen if the problem still occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants