tzdata requirement missing for docker-compose #529
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
docker-compose up -d
Fails to start because tzdata is missing
I've added tzdata to the requirements/defaults.txt but i'm unsure if this is this is the appropriate requirements file it has other tz related packages so i would assume so. Adding tzinfo fixes the issue and its able to start cleanly.
django_1 | ModuleNotFoundError: No module named 'tzdata'
django_1 | # wait-for-it postgres:5432
django_1 | wait-for-it: waiting 15 seconds for postgres:5432
django_1 | wait-for-it: postgres:5432 is available after 1 seconds
django_1 | # python3 manage.py migrate
django_1 | Traceback (most recent call last):
django_1 | File "/root/.local/lib/python3.8/site-packages/backports/zoneinfo/_common.py", line 15, in load_tzdata
django_1 | return importlib_resources.open_binary(package_name, resource_name)
django_1 | File "/usr/local/lib/python3.8/importlib/resources.py", line 88, in open_binary
django_1 | package = _get_package(package)
django_1 | File "/usr/local/lib/python3.8/importlib/resources.py", line 47, in _get_package
django_1 | module = import_module(package)
django_1 | File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
django_1 | return _bootstrap._gcd_import(name[level:], package, level)
django_1 | File "", line 1014, in _gcd_import
django_1 | File "", line 991, in _find_and_load
django_1 | File "", line 961, in _find_and_load_unlocked
django_1 | File "", line 219, in _call_with_frames_removed
django_1 | File "", line 1014, in _gcd_import
django_1 | File "", line 991, in _find_and_load
django_1 | File "", line 961, in _find_and_load_unlocked
django_1 | File "", line 219, in _call_with_frames_removed
django_1 | File "", line 1014, in _gcd_import
django_1 | File "", line 991, in _find_and_load
django_1 | File "", line 973, in _find_and_load_unlocked
django_1 | ModuleNotFoundError: No module named 'tzdata'
django_1 |
django_1 | During handling of the above exception, another exception occurred:
django_1 |
django_1 | Traceback (most recent call last):
django_1 | File "manage.py", line 22, in
django_1 | main()
django_1 | File "manage.py", line 18, in main
django_1 | execute_from_command_line(sys.argv)
django_1 | File "/root/.local/lib/python3.8/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
django_1 | utility.execute()
django_1 | File "/root/.local/lib/python3.8/site-packages/django/core/management/init.py", line 420, in execute
django_1 | django.setup()
django_1 | File "/root/.local/lib/python3.8/site-packages/django/init.py", line 24, in setup
django_1 | apps.populate(settings.INSTALLED_APPS)
django_1 | File "/root/.local/lib/python3.8/site-packages/django/apps/registry.py", line 116, in populate
django_1 | app_config.import_models()
django_1 | File "/root/.local/lib/python3.8/site-packages/django/apps/config.py", line 304, in import_models
django_1 | self.models_module = import_module(models_module_name)
django_1 | File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
django_1 | return _bootstrap._gcd_import(name[level:], package, level)
django_1 | File "", line 1014, in _gcd_import
django_1 | File "", line 991, in _find_and_load
django_1 | File "", line 975, in _find_and_load_unlocked
django_1 | File "", line 671, in _load_unlocked
django_1 | File "", line 843, in exec_module
django_1 | File "", line 219, in _call_with_frames_removed
django_1 | File "/app/django_celery_beat/models.py", line 4, in
django_1 | import timezone_field
django_1 | File "/root/.local/lib/python3.8/site-packages/django_timezone_field-5.0-py3.8.egg/timezone_field/init.py", line 1, in
django_1 | from timezone_field.fields import TimeZoneField
django_1 | File "/root/.local/lib/python3.8/site-packages/django_timezone_field-5.0-py3.8.egg/timezone_field/fields.py", line 11, in
django_1 | class TimeZoneField(models.Field):
django_1 | File "/root/.local/lib/python3.8/site-packages/django_timezone_field-5.0-py3.8.egg/timezone_field/fields.py", line 41, in TimeZoneField
django_1 | default_zoneinfo_tzs = [ZoneInfo(tz) for tz in pytz.common_timezones]
django_1 | File "/root/.local/lib/python3.8/site-packages/django_timezone_field-5.0-py3.8.egg/timezone_field/fields.py", line 41, in
django_1 | default_zoneinfo_tzs = [ZoneInfo(tz) for tz in pytz.common_timezones]
django_1 | File "/root/.local/lib/python3.8/site-packages/backports/zoneinfo/_common.py", line 27, in load_tzdata
django_1 | raise ZoneInfoNotFoundError(f"No time zone found with key {key}")
django_1 | backports.zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key Pacific/Kanton'
django_1 | # wait-for-it postgres:5432
django_1 | wait-for-it: waiting 15 seconds for postgres:5432
django_1 | wait-for-it: postgres:5432 is available after 0 seconds
django_1 | # python3 manage.py migrate
django_1 | Traceback (most recent call last):
django_1 | File "/root/.local/lib/python3.8/site-packages/backports/zoneinfo/_common.py", line 15, in load_tzdata
django_1 | return importlib_resources.open_binary(package_name, resource_name)
django_1 | File "/usr/local/lib/python3.8/importlib/resources.py", line 88, in open_binary
django_1 | package = _get_package(package)
django_1 | File "/usr/local/lib/python3.8/importlib/resources.py", line 47, in _get_package
django_1 | module = import_module(package)
django_1 | File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
django_1 | return _bootstrap._gcd_import(name[level:], package, level)
django_1 | File "", line 1014, in _gcd_import
django_1 | File "", line 991, in _find_and_load
django_1 | File "", line 961, in _find_and_load_unlocked
django_1 | File "", line 219, in _call_with_frames_removed
django_1 | File "", line 1014, in _gcd_import
django_1 | File "", line 991, in _find_and_load
django_1 | File "", line 961, in _find_and_load_unlocked
django_1 | File "", line 219, in _call_with_frames_removed
django_1 | File "", line 1014, in _gcd_import
django_1 | File "", line 991, in _find_and_load
django_1 | File "", line 973, in _find_and_load_unlocked
django_1 | ModuleNotFoundError: No module named 'tzdata'
django_1 |
django_1 | During handling of the above exception, another exception occurred:
django_1 |
django_1 | Traceback (most recent call last):
django_1 | File "manage.py", line 22, in
django_1 | main()
django_1 | File "manage.py", line 18, in main
django_1 | execute_from_command_line(sys.argv)
django_1 | File "/root/.local/lib/python3.8/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
django_1 | utility.execute()
django_1 | File "/root/.local/lib/python3.8/site-packages/django/core/management/init.py", line 420, in execute
django_1 | django.setup()
django_1 | File "/root/.local/lib/python3.8/site-packages/django/init.py", line 24, in setup
django_1 | apps.populate(settings.INSTALLED_APPS)
django_1 | File "/root/.local/lib/python3.8/site-packages/django/apps/registry.py", line 116, in populate
django_1 | app_config.import_models()
django_1 | File "/root/.local/lib/python3.8/site-packages/django/apps/config.py", line 304, in import_models
django_1 | self.models_module = import_module(models_module_name)
django_1 | File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module
django_1 | return _bootstrap._gcd_import(name[level:], package, level)
django_1 | File "", line 1014, in _gcd_import
django_1 | File "", line 991, in _find_and_load
django_1 | File "", line 975, in _find_and_load_unlocked
django_1 | File "", line 671, in _load_unlocked
django_1 | File "", line 843, in exec_module
django_1 | File "", line 219, in _call_with_frames_removed
django_1 | File "/app/django_celery_beat/models.py", line 4, in
django_1 | import timezone_field
django_1 | File "/root/.local/lib/python3.8/site-packages/django_timezone_field-5.0-py3.8.egg/timezone_field/init.py", line 1, in
django_1 | from timezone_field.fields import TimeZoneField
django_1 | File "/root/.local/lib/python3.8/site-packages/django_timezone_field-5.0-py3.8.egg/timezone_field/fields.py", line 11, in
django_1 | class TimeZoneField(models.Field):
django_1 | File "/root/.local/lib/python3.8/site-packages/django_timezone_field-5.0-py3.8.egg/timezone_field/fields.py", line 41, in TimeZoneField
django_1 | default_zoneinfo_tzs = [ZoneInfo(tz) for tz in pytz.common_timezones]
django_1 | File "/root/.local/lib/python3.8/site-packages/django_timezone_field-5.0-py3.8.egg/timezone_field/fields.py", line 41, in
django_1 | default_zoneinfo_tzs = [ZoneInfo(tz) for tz in pytz.common_timezones]
django_1 | File "/root/.local/lib/python3.8/site-packages/backports/zoneinfo/_common.py", line 27, in load_tzdata
django_1 | raise ZoneInfoNotFoundError(f"No time zone found with key {key}")
django_1 | backports.zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key Pacific/Kanton'