ironmansoftware / universal-automation

Universal Automation is the PowerShell-first automation platform.
https://ironmansoftware.com/universal-automation/
MIT License
24 stars 4 forks source link

Easy scheduling not working (time zone not found) #15

Closed PorreKaj closed 4 years ago

PorreKaj commented 4 years ago

Describe the Issue

Disclaimer: I don't know if a cron schedule works either.

I scheduled a script for Every 15 minutes, but in the 'upcomming' tab, it says "Jan 1, 0001 12:00 AM" as next execution

debug console gives me:

[15:00:032019-12-05 03:00:03 [ERROR] (Hangfire.Server.RecurringJobScheduler) Recurring job '1' can't be scheduled due to an error and will be disabled.
System.TimeZoneNotFoundException
The time zone ID 'Europe/Paris' was not found on the local computer.
   at System.TimeZoneInfo.FindSystemTimeZoneById(String id)
   at Hangfire.RecurringJobEntity..ctor(String recurringJobId, IDictionary`2 recurringJob, ITimeZoneResolver timeZoneResolver, DateTime now)

To Reproduce

Be in EU timezone Create script Schedule script

adamdriscoll commented 4 years ago

Hmmm weird. I've seen this before and thought I fixed it. I'll take a look today!

adamdriscoll commented 4 years ago

Ah. I missed a spot where I needed to configure the "time zone resolver" to use NodaTime rather than the system time zones. Resolved in tonight's build.

adamdriscoll commented 4 years ago

Interesting info: Time zone configurations are crazy and they are different between Unix\Windows. Also, if you use the default Ubuntu docker container it doesn't contain ANY time zone configurations. Hence the need to introduce a time zone database like NodaTime to resolve timezones that work cross platform.