more G-Labs products

Author Topic: Recursion Error with @Sunset wit upgrade to r515  (Read 2226 times)

March 29, 2016, 02:41:47 AM
Read 2226 times

HGexperimenter

  • **
  • Information
  • Jr. Member
  • Posts: 42
HomeGenie Version 1.1 beta r515 - just upgraded
I am getting an error in the log and happens every few hours.

HomeAutomation.HomeGenie   Scheduler   @Sunset   Scheduler.Error   "Too much recursion in expression '@Sunset'"

And the Wizard Script Trigger stops working.  Any ideas?

System: RaspberryPi 2
Program: Wizard script trigger:
 HomeAutomation.HomeGenie/Scheduler Scheduler.CronEvent Equals @Sunset

May be related to the new recursion check in SchedulerService.cs?

****
The program SchedulerService.cs tests:
for "else if (recursionCount >= MAX_EVAL_RECURSION)"
where  MAX_EVAL_RECURSION = 4;
so it fails the test with 4.

***
This fails on Scheduler items that are used in Wizard Scripts as a trigger.
I use it in 2 programs that are Wizard Scripts that use it as a trigger:
      <ProgramCondition>
        <Domain>HomeAutomation.HomeGenie</Domain>
        <Target>Scheduler</Target>
        <Property>Scheduler.CronEvent</Property>
        <ComparisonOperator>Equals</ComparisonOperator>
        <ComparisonValue>@SolarAltitude.Evening.Sunset.Start</ComparisonValue>
      </ProgramCondition>


Anyone else seeing this with the new version .515?

Must be related to the recursion check as it did not happen before the upgrade to .515.

« Last Edit: March 30, 2016, 07:09:32 PM by HGexperimenter »

April 04, 2016, 07:51:59 PM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer

April 04, 2016, 07:56:09 PM
Reply #2

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Please post the two expression values for @SunSet and other failing ones. You can get them from the Scheduler page.

April 04, 2016, 09:15:26 PM
Reply #3

HGexperimenter

  • **
  • Information
  • Jr. Member
  • Posts: 42
Scheduler expressions (Set by Program 34 WeatherUnderground)
Code: [Select]
Sunset: 14 19 * * *
Sunrise: 21 6 * * *
FromSunsetToSunrise: (* 20-23 * * *):(14-59 19 * * *):(* 0-5 * * *):(0-21 6 * * *)

Gene - the strange thing is that the recursion error is not consistent and seems to occur sometime just after the WeatherUnderground update.  Is it possible that there is a "collision" when the Scheduler reads the value and the WeatherUnderground updates the values?  Here is an example of Sunrise (that is not used at all by a Wizard Sketch):
Code: [Select]
2016-04-02 17:21:01.3221 Info HomeAutomation.HomeGenie.Automation 34 - Program.UiRefresh Data Updated
2016-04-02 17:21:01.3241 Info HomeAutomation.HomeGenie Scheduler @Sunrise Scheduler.Error "Too much recursion in expression '@Sunrise'"


April 06, 2016, 09:20:26 PM
Reply #4

pim555

  • ****
  • Information
  • Sr. Member
  • Posts: 143
I encounter the same issue after upgrading to r515. @Sunset/@sunrise expressions dont work anymore (I used them in a wizard script) and the log shows 'too much recursion'.

Pim

April 06, 2016, 10:47:38 PM
Reply #5

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Is it just the built-in @sunrise/@sunset or is it other expressions as well?  I only use jkutils values and haven't checked recently.  Perhaps I should verify that my HG install isn't kicking out error messages.  If it is, things are still functioning as expected like clockwork.

April 07, 2016, 12:12:55 AM
Reply #6

HGexperimenter

  • **
  • Information
  • Jr. Member
  • Posts: 42
I got this with:
@Sunset, @Sunrise: updated (I think) by WeatherUnderground
@SolarAltitude.Evening.Sunset.Start: updated by jkUtils

Clues:
Does not have to be part of a script or other trigger
Happens about every 1/2 hour, but is not *always* happening
Might be a collision when it gets updated and the scheduler is reading?
Intermittent error - could be hard to reproduce...

In the last 2 days it is stable with no errors (go figure!)

April 07, 2016, 04:30:14 PM
Reply #7

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I checked my error log and saw no issues.  I have WU and jkUtils enabled so I should be prone to the same issue.  I am running r514 currently but don't recall how far back my log goes (probably back to the installation of r514).

April 12, 2016, 05:34:31 PM
Reply #8

tasioX

  • *
  • Information
  • Newbie
  • Posts: 19
Same problem here.  Error from the logs below:

2016-04-12 09:30:33.4221 Info HomeAutomation.HomeGenie   Scheduler   @SolarAltitude.Evening.GoldenHour.Start   Scheduler.Error   "Too much recursion in expression '@SolarAltitude.Evening.GoldenHour.Start'"

This is happening with several other scheduled events most are JKUtils schedules but at least one is a custom schedule.

April 22, 2016, 10:56:55 PM
Reply #9

HGexperimenter

  • **
  • Information
  • Jr. Member
  • Posts: 42
Still happening after upgrade to: HomeGenie Version 1.1 beta r516

Does anyone have a suggestion as to how to research this?  It seems to occur when the program updates the Scheduler (Such as Weather Underground Program #34)??

This is hard to debug since it happens sporadically...


April 24, 2016, 05:50:39 PM
Reply #10

jshan

  • ***
  • Information
  • Full Member
  • Posts: 71
r515 scheduler issue, similar to described in this thread, except it's not @sunset, it's a standard schedule 30 6 * * * (6:30am every day).  It's used by a wizard script to send a control.off to the basic alarm system.  The scheduled event does not occur AND the schedule program turns itself off (goes from a tick mark to triangle-exclamation-mark).  I have tried just turning the schedule program back on, but it gets turned back off.  I've tried deleting the schedule, added a new one, edited the wizard script - same result.  Happens consistently.  In the logs, I saw one recursion error, but this failure has happened a number of times with no log error.  I have another wizard script to turn the system on at a scheduled time and it had the same issue in that it did not run and turned the schedule off once; however, with this one, I turned the schedule back on and it's been running as expected.

April 30, 2016, 10:10:22 PM
Reply #11

tasioX

  • *
  • Information
  • Newbie
  • Posts: 19
This is all fixed up in version 517 which is now available.

May 09, 2016, 08:43:38 PM
Reply #12

HGexperimenter

  • **
  • Information
  • Jr. Member
  • Posts: 42
I can confirm that the recursion error has now been fixed with the latest revision 519.
I no longer get the error and disabled scheduler events.

Gene has implemented a fix:
https://github.com/genielabs/HomeGenie/issues/271

Thanks