TwiN / gatus

⛑ Automated developer-oriented status page
https://gatus.io
Apache License 2.0
6.43k stars 427 forks source link

New `maintenance.timezone` config requires IANA Time Zone database #848

Closed salim-b closed 2 months ago

salim-b commented 2 months ago

Describe the bug

The official Gatus container image is missing the required timezone data to be able to properly interpret timezone values.

When e.g. setting maintenance.timezone = "Europe/Zurich", Gatus panics with:

panic: invalid timezone specified or format not supported. Use IANA timezone format (e.g. America/Sao_Paulo): unknown time zone Europe/Zurich

According to the docs of time.LoadLocation:

LoadLocation looks for the IANA Time Zone database in the following locations in order:

  • the directory or uncompressed zip file named by the ZONEINFO environment variable
  • on a Unix system, the system standard installation location
  • $GOROOT/lib/time/zoneinfo.zip
  • the time/tzdata package, if it was imported

A simple apk install tzdata fixes the panic. But importing the time/tzdata would also solve the issue.

What do you see?

panic: invalid timezone specified or format not supported. Use IANA timezone format (e.g. America/Sao_Paulo): unknown time zone Europe/Zurich

What do you expect to see?

No panic.

List the steps that must be taken to reproduce this issue

Set maintenance.timezone = "Europe/Zurich".

Version

5.12.0

Additional information

No response

TwiN commented 2 months ago

I think I'd prefer going the import route if it does fix the issue

TwiN commented 2 months ago

@salim-b could you give it a try with the new latest image?

salim-b commented 2 months ago

@TwiN latest image works fine without manual tzdata install. 👌