Sometimes Sikuli fails to run on Ubuntu 20.04 --- Runner: runscript: silently fails

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

Bug Description

Sikuli version: 2.0.5
Operating System: Ubuntu 20.04 64-bit
Java: openjdk 11.0.14

Summary:
--------
We have a Jenkins automated test that runs nightly using Sikuli. Most of the time everything works just fine. Intermittently the test will fail in a peculiar way. When it fails in this manner, it looks like Sikuli fails to start properly.

Details:
--------
Our shell script is starting Sikuli as follows:
export DISPLAY=:0 && java -jar sikulixide-2.0.5.jar -v -d 3 -r $d

Where $d is the path to the Sikuli script to run.

We added the "-v -d 3" parameters in an attempt to troubleshoot this bug but now we're stuck with the output that we have and need help getting further.

I'll attach two log files showing the different output between a passed and failed run.

From the passed run:
[1021 debug] RunTime:loadLib: libJXGrabKey.so (success)
[1052 debug] HotkeyManager: add Abort Hotkey: ALT+SHIFT C (67, 9)
[1054 debug] Runner: runscript: running script: /home/user/shared/testsystem/display_api/C/testSDLGCWindow.sikuli/testSDLGCWindow.py
[1055 debug] JythonRunner: starting initialization

From the failed run:
[987 debug] RunTime:loadLib: libJXGrabKey.so (success)
[1013 debug] HotkeyManager: add Abort Hotkey: ALT+SHIFT C (67, 9)
[1483 debug] RunTime:***** final cleanup at System.exit() *****

What else can we do to help debug this issue?

Thanks

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

Can it be, that the script to run is on a device, that is not available at runtime or blocks somehow?

The difference is, that the message " Runner: runscript: running script: " does not come up, which means, that there is a silent problem on the way from startup, which leads to the termination.

I have to look into the implementation, how availability of script files is checked and documented with the -r parameter.

Revision history for this message
Devin (devinsr) wrote :

The script to run is on the local disk of the PC.

If I run Sikuli and pass in a path to a script that does not exist on the disk, then I see the following output:
[error] Runner: runscript: (256) not found: TEST.sikuli

For now, we're going to try the following:
- have each script create a file when it starts
- after "running" the script, check if the file was created
- if the file is not there, then assume that it's because of this issue
- try re-running the script up to 3 times before failing

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

to be checked

summary: - Sometimes Sikuli fails to run on Ubuntu 20.04
+ Sometimes Sikuli fails to run on Ubuntu 20.04 --- Runner: runscript:
+ silently fails
Changed in sikuli:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 2.0.6
Revision history for this message
Devin (devinsr) wrote :

Just a quick note that I saw this again today (so it is very rare but still an issue). Based on the dates and how frequently we run our tests, I'd estimate it's almost a 1 in 1,000 chance to see the issue. So this is very low priority for us.

Currently we are now on the following:
Ubuntu 22.04.3 LTS
java: openjdk 11.0.21 2023-10-17

We're still running the test script as follows:
export DISPLAY=:0 && java -jar $TEST_PATH/../sikulixide-2.0.5.jar -v -d 3 -r $TEST/

We're planning to switch from sikulixide-2.0.5.jar to sikulixapi-2.0.5.jar soon for these tests since they run remotely. I'm not sure if that would be helpful or add any additional logging.

From the failed case today:
------------
[1043 debug] Runner: added: SikulixJar [jar] text/jar
[1043 debug] Runner: added: PackedSikulix [zip] application/zip
[1044 debug] Runner: added: PackedSikulix [skl] text/skl
[1044 debug] Runner: added: Text [txt] text/text
[1045 debug] Runner: added: Sikulix [] directory/sikulix
[1045 debug] Runner: added: NetworkRunner [] NET
[1049 debug] Runner: added: Jython [py] text/jython
[1050 debug] Runner: init: class org.sikuli.script.runners.AbstractLocalFileScriptRunner: warning: not possible
[1050 debug] Runner: added: SikulixExecutableJar [executablejar] text/jar
[1052 debug] RunTime:loadlib: trying JXGrabKey
[1053 debug] RunTime:libsExport: folder exists: /home/user/.Sikulix/SikulixLibs (2.0.5 - 202103030910)
[1054 debug] RunTime:loadLib: libJXGrabKey.so (success)
[1079 debug] HotkeyManager: add Abort Hotkey: ALT+SHIFT C (67, 9)
[1533 debug] RunTime:***** final cleanup at System.exit() *****
[1541 debug] FileManager: deleteFileOrFolder:
/tmp/Sikulix_405705823
Sikuli return code: 1.
------------

From a working example:
------------
[1032 debug] Runner: added: SikulixJar [jar] text/jar
[1032 debug] Runner: added: PackedSikulix [zip] application/zip
[1033 debug] Runner: added: PackedSikulix [skl] text/skl
[1033 debug] Runner: added: Text [txt] text/text
[1034 debug] Runner: added: Sikulix [] directory/sikulix
[1034 debug] Runner: added: NetworkRunner [] NET
[1038 debug] Runner: added: Jython [py] text/jython
[1038 debug] Runner: init: class org.sikuli.script.runners.AbstractLocalFileScriptRunner: warning: not possible
[1039 debug] Runner: added: SikulixExecutableJar [executablejar] text/jar
[1041 debug] RunTime:loadlib: trying JXGrabKey
[1042 debug] RunTime:libsExport: folder exists: /home/user/.Sikulix/SikulixLibs (2.0.5 - 202103030910)
[1043 debug] RunTime:loadLib: libJXGrabKey.so (success)
[1069 debug] HotkeyManager: add Abort Hotkey: ALT+SHIFT C (67, 9)
[1071 debug] Runner: runscript: running script: /home/user/shared/testsystem/common/log_check.sikuli/log_check.py
[1071 debug] JythonRunner: starting initialization
------------

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.