Immediately terminated embedded scripts?

Forum rules

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo

Posted on
Sun Sep 02, 2012 8:57 pm
alistair offline
Posts: 109
Joined: Jul 14, 2006

Immediately terminated embedded scripts?

I'm running Indigo 5.1.5. I've got the below script in Indigo:

import urllib2

urllib2.urlopen("http://172.25.1.4:49451/data_request?id=lu_action&output_format=xml&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=3")


....which should make a web service call to lock a door. However, it *immediately* terminates with the warning:

Error because embedded scripts execute sequentially they must complete their execution within 10 seconds.
Error modify the script to exit quickly or convert it to an external file (not embedded).
Stopping embedded script executor host (pid 483)
Script Error embedded script: <urlopen error (4, 'Interrupted system call')>
Script Error Exception Traceback (most recent call shown last):

embedded script, line 3, at top level
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 124, in urlopen
return _opener.open(url, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 381, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 399, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 360, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 1118, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.py", line 1093, in do_open
raise URLError(err)
URLError: <urlopen error (4, 'Interrupted system call')>


....which implies it ran for more than 10s, but it didn't.

Any ideas?

-Alistair

Posted on
Mon Sep 03, 2012 8:04 am
matt (support) offline
Site Admin
User avatar
Posts: 21426
Joined: Jan 27, 2003
Location: Texas

Re: Immediately terminated embedded scripts?

I just tried it with a good URL and an unreachable IP address. It worked as expected. The good URL returned immediately without errors (the urlopen succeeded), and the bad URL tried for 10 seconds then I got the same error you saw when the IndigoServer shut it down.

Perhaps your action was executed more than once, and the first action timed out after 10 seconds which happened to be when you executed it again? Embedded scripts execute asynchronously (serially, one-after-another), which makes it hard to know exactly how long a script has been executing if it had to wait for other scripts to finish (or fail) before it started.

BTW, if you are using MiCasaVerde with Indigo, then have you checked out this Indigo plugin?

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests