etesync / server

The Etebase server (so you can run your own)
https://www.etesync.com
GNU Affero General Public License v3.0
1.55k stars 75 forks source link

Missing package `tzdata` in `requirements.txt` #185

Open DrMaxNix opened 2 months ago

DrMaxNix commented 2 months ago

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?

tasn commented 2 months ago

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

DrMaxNix commented 2 months ago

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

Xiretza commented 2 months ago

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

tasn commented 2 months ago

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

DrMaxNix commented 2 months ago

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

tasn commented 2 months ago

It's better to not have redundant dependencies.

Xiretza commented 2 months ago

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.