tasking-manager icon indicating copy to clipboard operation
tasking-manager copied to clipboard

Cannot use Docker due to tzlocal.utils.ZoneInfoNotFoundError

Open frafra opened this issue 3 years ago • 2 comments

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.

frafra avatar Oct 19 '21 17:10 frafra

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

Aadesh-Baral avatar Jun 18 '22 15:06 Aadesh-Baral

@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.

frafra avatar Jun 21 '22 12:06 frafra

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 c092c89a2888b9ea85c8272acf98a64788a61f70).

tsmock avatar Apr 27 '23 12:04 tsmock

Or we can try pdm add tzdata to fix this.

eternaltyro avatar May 10 '23 22:05 eternaltyro