Sikuli CGI problem

Asked by Dobri Dobrev

I am trying to call Sikuli scripts from a perl CGI script. However, when I do, I got a "homeButton.png not found on screen error". When I run it from command line (the sikuli script) it works just fine. It does not seem to be an apache permissions problem because it actually calls the script and I get an error from the script itself. The script also works when launched from the Sikuli IDE.
The annoying part is that the CGI used to work for a few days calling sikuli scripts without any issues and all of a sudden when a Sikuli script is called from CGI it cannot find any image on the screen. Also the user of the apache configuration was changed from www to the current user on the laptop, so there really should not be any problems caused by permissions.
 I am using sikuli- x1.0rc3 on a mac with the standard apache server configuration.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Dobri Dobrev
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

So the question is: does it still work without the configuration change?

If yes, then it might be a problem accessing the screen.
So you should check, what Sikuli "sees" on the screen, when the find fails using Screen.capture().

Revision history for this message
Dobri Dobrev (xoxdodoxox) said :
#2

Thanks a lot for the help.
Seems like Sikuli does not see the screen when ran from the CGI script.
The code I used is:
SCREEN=Screen(0)
SCREEN.capture()

When I call it from the IDE or terminal, I get a "select an are of the screen" prompt, while when I try to run it from CGI (same command as from terminal) I get :
TypeError: unbound method capture() must be called with Screen instance as first argument (got nothing instead)

That makes me think that Sikuli does not see the script when ran from apache CGI, but unfortunately I have no idea what could be causing that.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

yes, this is strange.

But this seems to be more a Jython problem.

just run a script with a simple
capture()

If you get the error again, pls. paste the error stack trace.

Revision history for this message
Dobri Dobrev (xoxdodoxox) said :
#4

After restarting Apache a couple of times, it started working, without me changing anything. Really weird. Nevertheless, thanks a lot of the time and effort to help me.