[check] Mac: Sikuli ignores X11 DISPLAY variable on remote machine run via ssh

Bug #1370113 reported by Sher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Medium
RaiMan

Bug Description

System details are:

Host machine : OSX 10.9.2 (where i am trying to run the tests FROM)
Destination machine: OSX 10.9.2 (where I want the tests to execute ON)
Version 1.0.1

I have built the setup jar with the and IDE and without (no IDE and option of executing on the command line)

Hi, I am trying to run a sikuli script I have written from another machine (all the scripts and the jars, etc exist on the remote host...I can run them fine If i am sat at the machine)

Before running the commands i export the display...

export DISPLAY=:0.0

I ssh in, and cd into the directory and run the following command....

java -jar /Users/admin/Documents/Sikuli/sikuli-script.jar Scripts/End2End.sikuli

I see...

No X11 DISPLAY variable was set, but this program performed an operation which requires it.
 at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
 at java.awt.Window.<init>(Window.java:535)
 at java.awt.Frame.<init>(Frame.java:420)
 at java.awt.Frame.<init>(Frame.java:385)
 at javax.swing.JFrame.<init>(JFrame.java:180)
 at org.sikuli.basics.MultiFrame.<init>(MultiFrame.java:29)
 at org.sikuli.basics.SikuliX.displaySplash(SikuliX.java:109)
 at org.sikuli.basics.SikuliScript.main(SikuliScript.java:39)

I also tried....
/Applications/SikuliX-IDE.app/Contents/runIDE -r "End2End.sikuli" --args superbobc

But that gives me the same.

On another note, when I try to launch another app, i.e. TextEdit.... /Applications/TextEdit.app/Contents/MacOS/TextEdit

works fine, I can see it fire up

Revision history for this message
RaiMan (raimund-hocke) wrote : Re: [1.0.1] Sikuli ignores X11 DISPLAY variable on remote machine run via ssh

Sorry, but I cannot help you with that in the moment.

I accept it as a bug to be fixed in version 1.2 later this year.

Changed in sikuli:
status: New → In Progress
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.2.0
summary: - No X11 DISPLAY variable was set message seen when running Sikuli script
- remotely
+ [1.0.1] Sikuli ignores X11 DISPLAY variable on remote machine run via
+ ssh
summary: - [1.0.1] Sikuli ignores X11 DISPLAY variable on remote machine run via
- ssh
+ [1.0.1] Mac: Sikuli ignores X11 DISPLAY variable on remote machine run
+ via ssh
Revision history for this message
Sher (sherbhachu) wrote : Re: [1.0.1] Mac: Sikuli ignores X11 DISPLAY variable on remote machine run via ssh

Ah dang, thats a shame, even using Jenkins agents the same problem is seen. Would be nice to know if anyone has managed to get Sikuli and Jenkins running on this version of OSX and Sikuli

Revision history for this message
RaiMan (raimund-hocke) wrote :

I am running my nightly build production on a Jenkins installation on OSX server 10.9.

what is your problem, besides the headless situation?

Java AWT and Java Robot refuse to run on systems having no screen attached.
As far as I understand, simply setting the X11 display is not enough.

Revision history for this message
Sher (sherbhachu) wrote :

So all I am trying to do is run a few tests on a MAC laptop, which of course has a screen as is permanently logged in. If I can get this to work on the actual Jenkins server, which is also OSX, and permanently logged in thats fine.

I have tried wrapping up the commands in a shell script, but that didn't work either.

If I run the script manually, its fine, but its the moment Jenkins tries to execute or if I try to mimic what Jenkins is doing (i.e. launch SSH session ,etc) it just doesn't work (hence the defect).

I haven't figured out how to get Jenkins to 'execute' the command as if I were at the terminal myself.

Revision history for this message
RaiMan (raimund-hocke) wrote :

this worked for me having a ssh session to another Mac machine:

open -n -a Terminal path-to-some-executable-shellscript

this opens a new Terminal session on the remote machine and runs the given shell script.

you might prepare a script containing the java command to run the Sikuli script on the remote machine, copy it to the remote machine, make it executable and issue the open command.

Since I do not have experiences with Jenkins slaves yet, I cannot tell you how to add this to a Jenkins environment.

Revision history for this message
Sher (sherbhachu) wrote :

So, interestingly enough, that also gives me exactly the same message!

I have a script thats executable, I run it remotely, i see the X11 message, I see it also if i run it local!

Revision history for this message
RaiMan (raimund-hocke) wrote :

I am sorry, but I have to leave you alone with this problem.
No time at the moment to dive into this area, not having much experience with that.

but I googled with
java awt No X11 DISPLAY variable was set

and among tons of entries at least this entry might be interesting:
http://stackoverflow.com/questions/22353533/java-awt-headlessexception-no-x11-display-variable-was-set-error-during-maven-b

RaiMan (raimund-hocke)
Changed in sikuli:
importance: High → Medium
milestone: 2.0.0 → 2.1.0
summary: - [1.0.1] Mac: Sikuli ignores X11 DISPLAY variable on remote machine run
+ [check] Mac: Sikuli ignores X11 DISPLAY variable on remote machine run
via ssh
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.