server icon indicating copy to clipboard operation
server copied to clipboard

Missing package `tzdata` in `requirements.txt`

Open DrMaxNix opened this issue 1 year ago • 7 comments

When installing required packages via pip3 install -r requirements.txt on Alpine, I get this error when trying to access the /admin page:

...

  File "/usr/lib/python3.12/zoneinfo/_common.py", line 24, in load_tzdata
    raise ZoneInfoNotFoundError(f"No time zone found with key {key}")
zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key UTC'

It was easily fixed by installing the tzdata package:

pip3 install tzdata

Maybe it should be added to the requirements.txt file? Why is it not included although it seems to be auto-generated?

DrMaxNix avatar Sep 02 '24 20:09 DrMaxNix

Yeah, it's weird that it's not included by default. Maybe it's an alpine thing? I'm not sure. It definitely works elsewhere (including our docker image).

tasn avatar Sep 02 '24 20:09 tasn

Maybe it's because your docker image is based on python:3.11.0-alpine and I'm starting with alpine:latest and installing python on top..?

DrMaxNix avatar Sep 02 '24 20:09 DrMaxNix

On Arch, this isn't a problem because zoneinfo uses the system zoneinfo files (in /usr/share/zoneinfo/) before falling back to the tzdata module (which means python -c 'import zoneinfo; zoneinfo.ZoneInfo("foo/bar")' also fails with ModuleNotFoundError: No module named 'tzdata').

Xiretza avatar Sep 02 '24 20:09 Xiretza

@Xiretza, how should we solve this? Conditional dep in Alpine (is that possible?), or something else?

tasn avatar Sep 02 '24 21:09 tasn

Why does it have to be conditional? Is there a problem with it being a dependency on all platforms?

DrMaxNix avatar Sep 02 '24 21:09 DrMaxNix

It's better to not have redundant dependencies.

tasn avatar Sep 02 '24 23:09 tasn

In my opinion this shouldn't be etesync's problem at all, this is a problem with Alpine's python installation. If python -c 'import zoneinfo; zoneinfo.ZoneInfo("UTC")' fails on a fresh install, then the python install is broken.

Xiretza avatar Sep 03 '24 05:09 Xiretza