genielabs / HomeGenie

HomeGenie, the programmable automation intelligence
https://homegenie.it
GNU General Public License v3.0
389 stars 155 forks source link

Scheduler Issues #271

Closed TasioX closed 8 years ago

TasioX commented 8 years ago

since upgrade from 512 to 515

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.

This happens with multiple different scheduled events including custom and built in schedules. Including @Sunset and so on. This disables the event and prevents the scripts from running. Almost all scheduled scripts will not trigger. This can be duplicated in Windows and RPI. If I assign a script to a different schedule it generally also causes the newly chosen event to fail. I even rebuild my HG from scratch and it still happens. I know others are also having similar issues.

All of my scheduled scripts are built using the Wizard Script

genemars commented 8 years ago

I did a quick test and could not reproduce the issue. I tried just "@Sunset" in a wizard script. Are you using a composite expression?

TasioX commented 8 years ago

scheduler

TasioX commented 8 years ago

image

TasioX commented 8 years ago

image

TasioX commented 8 years ago

The first image is the result once a script is scheduled. The second is the schedule in the script. The third is the program to run. Pretty standard script. No frills. "@ChronEvent" run "Philips Hue Light X" "Control on". Has worked without issue for the past year or so. I have several similar scripts that cause the same issue which is why you see multiple schedules disabled in image 1. Generally about 1 out of 5 scheduled scripts will run. Seem to sometimes change which will run if you reboot.

TasioX commented 8 years ago

Here is the event log pulled right after I did a restart on Solar Altitudes

image

TasioX commented 8 years ago

Gene, I just confirmed duplication on my system. I previously was not actually using @Sunset for any triggers. I created a new script to trigger @Sunset and turn on 2 lights. I restarted HG and @Sunset was disabled along with several of the same Solar Altitudes schedules. I did see a bit a variance in which schedules became disabled but it is clearly linked to the scripts calling on them in some way.

genemars commented 8 years ago

I just pushed a small fix to the IsScheduling method. https://github.com/genielabs/HomeGenie/commit/f3ea17d7f6aa0b8909378d11fdf170c94c932b75 Not sure if it will solve this issue. You can test either by building from source or using the prebuilt patched r516 package uploaded here: https://sourceforge.net/projects/homegenie/files/testing/

TasioX commented 8 years ago

Gene, So far so good. Had to re-enable the disabled schedules after restore from backup but then they seemed to stick. Restarted the service, and restarted JKUtils and everything seems to be holding. Let me know if you drop a windows build of this as the machine I usually run on is Windows based. Sorry I don't do much coding so building from source is a challenge. Thanks for digging into this.

TasioX commented 8 years ago

Just noticed that this build may have fixed my chrome issues from my other bug report also. I would need a windows version to test to be sure.

TasioX commented 8 years ago

In 517 this appears completely fixed.

Thanks Gene!