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

Cannot use Docker due to tzlocal.utils.ZoneInfoNotFoundError #4906

Closed
Tracked by #5705
frafra opened this issue Oct 19, 2021 · 4 comments · Fixed by #5642 · May be fixed by #4907
Closed
Tracked by #5705

Cannot use Docker due to tzlocal.utils.ZoneInfoNotFoundError #4906

frafra opened this issue Oct 19, 2021 · 4 comments · Fixed by #5642 · May be fixed by #4907
Assignees
Labels
containerization issues that relate to containers infrastructure

Comments

@frafra
Copy link
Contributor

frafra commented Oct 19, 2021

backend       | [2021-10-19 17:28:43 +0000] [9] [ERROR] Exception in worker process
backend       | Traceback (most recent call last):
backend       |   File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
backend       |     worker.init_process()
backend       |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/ggevent.py", line 162, in init_process
backend       |     super().init_process()
backend       |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 119, in init_process
backend       |     self.load_wsgi()
backend       |   File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
backend       |     self.wsgi = self.app.wsgi()
backend       |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
backend       |     self.callable = self.load()
backend       |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
backend       |     return self.load_wsgiapp()
backend       |   File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
backend       |     return util.import_app(self.app_uri)
backend       |   File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 358, in import_app
backend       |     mod = importlib.import_module(module)
backend       |   File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
backend       |     return _bootstrap._gcd_import(name[level:], package, level)
backend       |   File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
backend       |   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
backend       |   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
backend       |   File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
backend       |   File "<frozen importlib._bootstrap_external>", line 728, in exec_module
backend       |   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
backend       |   File "/usr/src/app/manage.py", line 77, in <module>
backend       |     cron = BackgroundScheduler(daemon=True)
backend       |   File "/usr/local/lib/python3.7/site-packages/apscheduler/schedulers/base.py", line 87, in __init__
backend       |     self.configure(gconfig, **options)
backend       |   File "/usr/local/lib/python3.7/site-packages/apscheduler/schedulers/base.py", line 126, in configure
backend       |     self._configure(config)
backend       |   File "/usr/local/lib/python3.7/site-packages/apscheduler/schedulers/background.py", line 29, in _configure
backend       |     super(BackgroundScheduler, self)._configure(config)
backend       |   File "/usr/local/lib/python3.7/site-packages/apscheduler/schedulers/base.py", line 697, in _configure
backend       |     self.timezone = astimezone(config.pop('timezone', None)) or get_localzone()
backend       |   File "/usr/local/lib/python3.7/site-packages/tzlocal/unix.py", line 205, in get_localzone
backend       |     _cache_tz = _get_localzone()
backend       |   File "/usr/local/lib/python3.7/site-packages/tzlocal/unix.py", line 163, in _get_localzone
backend       |     tzenv = utils._tz_from_env()
backend       |   File "/usr/local/lib/python3.7/site-packages/tzlocal/utils.py", line 125, in _tz_from_env
backend       |     ) from None
backend       | tzlocal.utils.ZoneInfoNotFoundError: 'tzlocal() does not support non-zoneinfo timezones like %s. \nPlease use a timezone in the form of Continent/City'
backend       | [2021-10-19 17:28:44 +0000] [9] [INFO] Worker exiting (pid: 9)
backend       | [2021-10-19 17:28:44 +0000] [1] [INFO] Shutting down: Master
backend       | [2021-10-19 17:28:44 +0000] [1] [INFO] Reason: Worker failed to boot.
@Aadesh-Baral
Copy link
Contributor

Thanks for the issue and PR @frafra. Can you tell me how to reproduce this issue?

@frafra
Copy link
Contributor Author

frafra commented Jun 21, 2022

@Aadesh-Baral I just tried to start the tasking manager, and it failed, since no timezone was specified. I am not sure if it still applies.

@dakotabenjamin dakotabenjamin added the containerization issues that relate to containers infrastructure label Oct 17, 2022
@tsmock
Copy link
Contributor

tsmock commented Apr 27, 2023

I'll jump in here, since I encountered the same problem in #5642.

It helped that the dependency updates actually gave me actionable information, instead of just %s.

- tzlocal.utils.ZoneInfoNotFoundError: 'tzlocal() does not support non-zoneinfo timezones like %s. \nPlease use a timezone in the form of Continent/City'
+ tzlocal.utils.ZoneInfoNotFoundError: 'tzlocal() does not support non-zoneinfo timezones like UTC # Fix timezone (do not change - see issue #3638). \nPlease use a timezone in the form of Continent/City'

This can be fixed by moving the # Fix timezone (do not change - see issue #3638) to a different line, like I did in my PR (see c092c89).

@eternaltyro
Copy link
Collaborator

Or we can try pdm add tzdata to fix this.

@eternaltyro eternaltyro self-assigned this May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containerization issues that relate to containers infrastructure
Projects
None yet
5 participants