Page 5 of 6

PostPosted: Sun Nov 08, 2009 2:45 pm
by BillC
That worked as well. I assume the log (and the results/events in script editor) will be empty until the target script dies?

PostPosted: Sun Nov 08, 2009 3:06 pm
by berkinet
BillC wrote:
That worked as well. I assume the log (and the results/events in script editor) will be empty until the target script dies?
Right. You can test it by killing the process. enter: ps ax|grep PhoneValet in the terminal. The process ID (PID) will be in column 1. Then just do: kill <PID>. For example: kill 1527

So, now you just need to go back to Indigo and figure out why you could not get your script to start from inside Indigo. Maybe the support guys will see something I did not. But, you might try:
Code: Select all
set cmdOut to do shell script "/Library/Application Support/Perceptive Automation/Test/testscpt-watcher.sh &"
log cmdOut
Then look in your Indigo log to see what was recorded. Maybe there will be a hint there.

PostPosted: Sun Nov 08, 2009 3:40 pm
by BillC
berkinet wrote:
Then look in your Indigo log to see what was recorded. Maybe there will be a hint there.

Indigo log shows a null entry:
Code: Select all
2009-11-08 16:34:56   Script   

PostPosted: Sun Nov 08, 2009 4:08 pm
by berkinet
Well. Try this. Add a line to the shell script so that it produces some output when it runs...
Code: Select all
#!/bin/sh
while [ true ]
do
   echo "Script Started"
   /usr/bin/osascript "/Library/Application Support/Perceptive Automation/Test/PhoneValet Background Script.scpt"
   echo "Script Finished"
   EXCODE=$?
   DATE='date'
   /usr/bin/osascript "/Library/Application Support/Perceptive Automation/Test/indigoLogger.scpt PhoneValet Background Script.scpt $EXCODE"
done
exit 0
You should then see "Script Started" and maybe "Script Ended" in your out.log file. That will let you know you at least got to the line above where the PhoneValet script is run.

If you try this, remove the "set cmdOut" to from the AS command line, also remove the log cmdOut. If you don't remove the set, Indigo will hang waiting for output.

PostPosted: Sun Nov 08, 2009 4:54 pm
by jay (support)
berkinet wrote:
Well. Try this. Add a line to the shell script so that it produces some output when it runs...
Code: Select all
#!/bin/sh
while [ true ]
do
   echo "Script Started"
   /usr/bin/osascript "/Library/Application Support/Perceptive Automation/Test/PhoneValet Background Script.scpt"
   echo "Script Finished"
   EXCODE=$?
   DATE='date'
   /usr/bin/osascript "/Library/Application Support/Perceptive Automation/Test/indigoLogger.scpt PhoneValet Background Script.scpt $EXCODE"
done
exit 0
You should then see "Script Started" and maybe "Script Ended" in your out.log file. That will let you know you at least got to the line above where the PhoneValet script is run.

If you try this, remove the "set cmdOut" to from the AS command line, also remove the log cmdOut. If you don't remove the set, Indigo will hang waiting for output.


I suspect the problem is the spaces in the script file name...

Event Log error

PostPosted: Wed Nov 11, 2009 10:07 am
by JeffS
Jay-

I'm the one that started the whole PhoneValet variables not updating thing...

This morning, I happened to notice the following in the Indigo Event Log:

Nov 11, 2009 5:40:09 AM
Error script error: in file "PhoneValet Attachments.scpt"
Error script error: PhoneValet got an error: AppleEvent timed out. (-1712)
Error error dispatching event to attachment script (-1753)


So I performed the "ps" command, and the script had stopped.

Hopefully this tells you something.

Take care!

Jeff

Re: Event Log error

PostPosted: Wed Nov 11, 2009 10:45 am
by jay (support)
JeffS wrote:
Jay-

I'm the one that started the whole PhoneValet variables not updating thing...

This morning, I happened to notice the following in the Indigo Event Log:

Nov 11, 2009 5:40:09 AM
Error script error: in file "PhoneValet Attachments.scpt"
Error script error: PhoneValet got an error: AppleEvent timed out. (-1712)
Error error dispatching event to attachment script (-1753)


So I performed the "ps" command, and the script had stopped.

Hopefully this tells you something.

Take care!

Jeff


Thanks for the info. Was PhoneValet running also? That error sorta implies that PhoneValet wasn't responding to apple events for some reason...

Full "ps" command results

PostPosted: Wed Nov 11, 2009 10:54 am
by JeffS
Jay-

The full results for the "ps" command:

Jeff$ ps -axwww | grep Indigo
144 ?? 1:49.62 /Library/Application Support/Perceptive Automation/Indigo 4/IndigoServer.app/Contents/MacOS/IndigoServer
153 ?? 3:48.21 /Applications/Indigo 4.app/Contents/MacOS/Indigo 4 -psn_0_57358
173 ?? 1:30.56 python /Library/Application Support/Perceptive Automation/Indigo 4/IndigoWebServer/IndigoWebServer.py -i1176 -w8176 -cfn
174 ?? 0:55.67 python /Library/Application Support/Perceptive Automation/Indigo 4/IndigoSqlClient/IndigoSqlClient.py -i1176
13488 ttys000 0:00.00 grep Indigo


PhoneValet is running, and taking calls. I could do a full restart and show you the results again if it would help.

Jeff

Re: Full "ps" command results

PostPosted: Wed Nov 11, 2009 11:49 am
by jay (support)
JeffS wrote:
Jay-

The full results for the "ps" command:

Jeff$ ps -axwww | grep Indigo
144 ?? 1:49.62 /Library/Application Support/Perceptive Automation/Indigo 4/IndigoServer.app/Contents/MacOS/IndigoServer
153 ?? 3:48.21 /Applications/Indigo 4.app/Contents/MacOS/Indigo 4 -psn_0_57358
173 ?? 1:30.56 python /Library/Application Support/Perceptive Automation/Indigo 4/IndigoWebServer/IndigoWebServer.py -i1176 -w8176 -cfn
174 ?? 0:55.67 python /Library/Application Support/Perceptive Automation/Indigo 4/IndigoSqlClient/IndigoSqlClient.py -i1176
13488 ttys000 0:00.00 grep Indigo


PhoneValet is running, and taking calls. I could do a full restart and show you the results again if it would help.

Jeff


Nah, unfortunately it wouldn't. We're still stumped why these scripts are just quitting.

PostPosted: Fri Jan 01, 2010 9:03 am
by BillC
I finally got around to getting berkinet's scripts to work, and captured the error code when the PhoneValet script died. I don't think it's going to help much..."0" is a normal exit....at least his coding provides a way to automatically restart the background scripts.


Code: Select all
2009-12-28 19:41:01   Background Script   Script PhoneValetBackgroundScript.scpt died with exit code 0 and was restarted
2009-12-28 19:41:01   Script   PhoneValet Background Script started

PostPosted: Fri Jan 01, 2010 12:01 pm
by jay (support)
BillC wrote:
I finally got around to getting berkinet's scripts to work, and captured the error code when the PhoneValet script died. I don't think it's going to help much..."0" is a normal exit....at least his coding provides a way to automatically restart the background scripts.


Code: Select all
2009-12-28 19:41:01   Background Script   Script PhoneValetBackgroundScript.scpt died with exit code 0 and was restarted
2009-12-28 19:41:01   Script   PhoneValet Background Script started


Exactly what I found - nothing. It seems to have slowed in terms of how often they die, but it still is happening about once a week - and it's almost always ALL of my background scripts. We're looking at adding more process management to scripts that live in the background scripts folder for the next major revision of Indigo.

Re: Indigo-PhoneValet Integration

PostPosted: Tue Mar 09, 2010 8:53 am
by BillC
New behavior (sort of): I'm seeing this, triggered by a new message, and cycled at ~20 sec intervals until I changed the message flag:
Code: Select all
Mar 9, 2010 9:39:12 AM
  PhoneValet         New voicemail from: XXXXXX
  Background Script  Script PhoneValetBackgroundScript.scpt died with exit code 0 and was restarted
  Script             PhoneValet Background Script started

Mar 9, 2010 9:39:35 AM
  Background Script  Script PhoneValetBackgroundScript.scpt died with exit code 0 and was restarted
  Script             PhoneValet Background Script started

Mar 9, 2010 9:39:56 AM
  Background Script  Script PhoneValetBackgroundScript.scpt died with exit code 0 and was restarted
  Script             PhoneValet Background Script started
 
Mar 9, 2010 9:40:17 AM /same entries/

Mar 9, 2010 9:40:38 AM /same entries/

Mar 9, 2010 9:40:59 AM /same entries/

Mar 9, 2010 9:41:20 AM /same entries/

Mar 9, 2010 9:41:41 AM /same entries/

Mar 9, 2010 9:42:01 AM /same entries/

Mar 9, 2010 9:42:22 AM /same entries/

Mar 9, 2010 9:42:44 AM /same entries/

Mar 9, 2010 9:43:05 AM /same entries/

Mar 9, 2010 9:43:26 AM /same entries/

Mar 9, 2010 9:43:47 AM /same entries/

Any more ideas?

Re: Indigo-PhoneValet Integration

PostPosted: Tue Mar 09, 2010 9:58 am
by jay (support)
Nope. We're really quite baffled why it happens and what causes it. Have you rebooted? It looks to me like something quite bad is going on in your case.

Re: Indigo-PhoneValet Integration

PostPosted: Wed Mar 10, 2010 7:34 am
by BillC
Yeah, weird, isn't it? That server (it's a mini still running OS X 10.5, by the way) was rebooted about a week ago. I'm going to reboot again. May try going to Snow Leopard, too.

Bug swatted!

PostPosted: Sun Aug 01, 2010 11:00 am
by BillC
Jay et al...

Finally got around to troubleshooting this (again!) and found the error that causes the script to die, plus another bug. It only was crashing when an unplayed message was present.

This line in the Phone Valet Background Script from the library:
Code: Select all
tell application "Play Sound" to play (alias alertSound) repeat (theNewCallCount - 1) at volume alertSoundVolume

needs to read:
Code: Select all
tell application "Play Sound" to play (alertSound) repeat (theNewCallCount) - 1 at volume alertSoundVolume


The "alias" was causing a "File not found" error. Moving the "-1" outside the parentheses cured the crash. Wish I was more fluent in Applescript....I think I'd have spotted that earlier.