Skip to content
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

zoneinfo.ZoneInfo' object has no attribute 'normalize' #518

Closed
TobiasEdqvist opened this issue Feb 27, 2022 · 3 comments · Fixed by #528
Closed

zoneinfo.ZoneInfo' object has no attribute 'normalize' #518

TobiasEdqvist opened this issue Feb 27, 2022 · 3 comments · Fixed by #528
Milestone

Comments

@TobiasEdqvist
Copy link

Summary:

When starting a celery beat container with latest master the following is seen in our logs. Are we missing some dependency?

[celery-beat-container] [2022-02-27 19:21:52,007: INFO/MainProcess] beat: Starting...
[celery-beat-container] [2022-02-27 19:21:52,045: CRITICAL/MainProcess] beat raised exception <class 'AttributeError'>: AttributeError("'zoneinfo.ZoneInfo' object has no attribute 'normalize'")
[celery-beat-container] Traceback (most recent call last):
[celery-beat-container] File "/usr/local/lib/python3.10/site-packages/celery/apps/beat.py", line 105, in start_scheduler
[celery-beat-container] service.start()
[celery-beat-container] File "/usr/local/lib/python3.10/site-packages/celery/beat.py", line 645, in start
[celery-beat-container] interval = self.scheduler.tick()
[celery-beat-container] File "/usr/local/lib/python3.10/site-packages/celery/beat.py", line 343, in tick
[celery-beat-container] self.populate_heap()
[celery-beat-container] File "/usr/local/lib/python3.10/site-packages/celery/beat.py", line 317, in populate_heap
[celery-beat-container] is_due, next_call_delay = entry.is_due()
[celery-beat-container] File "/usr/local/lib/python3.10/site-packages/django_celery_beat/schedulers.py", line 136, in is_due
[celery-beat-container] return self.schedule.is_due(last_run_at_in_tz)
[celery-beat-container] File "/usr/local/lib/python3.10/site-packages/django_celery_beat/tzcrontab.py", line 45, in is_due
[celery-beat-container] rem_delta = self.remaining_estimate(last_run_at)
[celery-beat-container] File "/usr/local/lib/python3.10/site-packages/celery/schedules.py", line 610, in remaining_estimate
[celery-beat-container] return remaining(*self.remaining_delta(last_run_at, ffwd=ffwd))
[celery-beat-container] File "/usr/local/lib/python3.10/site-packages/celery/schedules.py", line 548, in remaining_delta
[celery-beat-container] now = self.maybe_make_aware(self.now())
[celery-beat-container] File "/usr/local/lib/python3.10/site-packages/celery/schedules.py", line 67, in now
[celery-beat-container] return (self.nowfun or self.app.now)()
[celery-beat-container] File "/usr/local/lib/python3.10/site-packages/django_celery_beat/tzcrontab.py", line 31, in nowfunc
[celery-beat-container] return self.tz.normalize(
[celery-beat-container] AttributeError: 'zoneinfo.ZoneInfo' object has no attribute 'normalize'

  • Celery-Beat Version: master branch as of 2022-02-27
@auvipy
Copy link
Member

auvipy commented Feb 28, 2022

we are yet to move to zoneinfo

@auvipy auvipy added this to the v2.3.0 milestone Feb 28, 2022
@AntoninRousset
Copy link

AntoninRousset commented Mar 9, 2022

I confirm.
Setting DJANGO_CELERY_BEAT_TZ_AWARE = False allow to bypass the issue.

@piraka9011
Copy link

What needs to be done to move this forward? Is it just replace pytz with zoneinfo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants