New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scheduled Jobs > Crontab corresponds to UTC #3349
Comments
Not sure if I should tack onto this issue, but this is problematic for DST as well. The job continues to run at UTC time and is therefore 1 hour later now that we have sprung forward 1 hour. |
Looks like this could be as simple as from django.utils import timezone
return schedules.crontab(
minute=minute,
hour=hour,
day_of_month=day_of_month,
month_of_year=month_of_year,
day_of_week=day_of_week,
nowfun=timezone.now,
) |
@mattmiller87 how are you setting |
I am updating the nautobot_config.py using the TIME_ZONE environment variable. such as: |
Let's document all the places where the timezone settings come into play and a note that we recommend UTC for consistency. |
Just off the top of my head
|
I have reproduced this problem and have that environment available for review. Two tests created:
|
This sounds like it will be deep inside of beat. If there is no easy solution here, I am inclined to document this as an edge case and say that if you change the system timezone, you need to update your scheduled jobs, because changing the system timezone is just such a rare thing to do in the first place. |
The issue arose when DST occurred and the job ran at the same UTC time; not adhering to the scheduled time. |
Spoke with @mattmiller87 today. It looks like an old cookie was missing the volume mapping I'm going to do one more test to simulate a distributed deployment to see how beat handles that:
|
Confirmed that cron jobs will run in whatever time zone is configured in the |
Thanks!! That helps describe the some of the challenges i have seen on Slack over the years. |
Environment
Steps to Reproduce
Expected Behavior
The job should be scheduled to run at 9am EST
Observed Behavior
The job runs at 9am UTC
The text was updated successfully, but these errors were encountered: