-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Description
The credentials service crashes with a ZoneInfoNotFoundError when handling requests because the tzdata Python package is not installed in the Docker image. This causes a 500 error on every request, including /admin.
Error
ModuleNotFoundError: No module named 'tzdata'
Which leads to:
zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key UTC'
The full chain is: Django's timezone context processor calls zoneinfo.ZoneInfo(settings.TIME_ZONE), which attempts to load timezone data via the tzdata package. Since the package is missing and the system tzdata files are apparently not available either, the lookup fails — even for UTC.
Steps to Reproduce
- Run credentials service via Tutor
- Navigate to any page (e.g.
/admin) - Observe HTTP 500 response
Environment
- Python 3.11.9
- Django (via Open edX credentials)
- Tutor v20+
Workaround
A Tutor plugin that installs tzdata into the credentials image:
from tutor import hooks
hooks.Filters.ENV_PATCHES.add_item(
(
"credentials-dockerfile-post-python-requirements",
"RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install tzdata",
)
)Suggested Fix
Add tzdata to the Python requirements for the credentials Docker image. On Python 3.9+ (especially on minimal/Alpine-style images that lack system timezone data), the tzdata package is the expected fallback for zoneinfo and should be an explicit dependency.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status