tconbeer / harlequin

The SQL IDE for Your Terminal.
https://harlequin.sh
MIT License
3.65k stars 83 forks source link

Windows timezone download fails harlequin, version 1.24.1 on windows 11 #652

Open paulrobello opened 1 week ago

paulrobello commented 1 week ago

Before Proceeding, please acknowledge:

Describe the bug windows 1st fails to download / use timezone database

To Reproduce run harlequin without any params

Expected behavior App should download tz db and start up

Actual behavior Application raises the following error Rule Mexico 1931 only - April 30 0:00 1:00 D Mexico 1931 1931 Jan/01 00:00:00 00:00:00 ╭─ Harlequin Timezone Support ──────────────────────────────────────────────╮ │ Harlequin could not find a timezone database, which it needs to support Apache Arrow's timestamptz features. It is downloading one now (it │ │ will only do this once). For more info, see https://harlequin.sh/docs/troubleshooting/timezone-windows │ ╰──────────────────────────────────────────────────────────────────╯ Rule Mexico 1931 only - April 30 0:00 1:00 D Mexico 1931 1931 Jan/01 00:00:00 00:00:00 ╭─ Harlequin Timezone Error ───────────────────────────────────────────────────╮ │ Harlequin was not able to download a timezone database. Without a timezone database, Harlequin may crash if you attempt to load timestamptz │ │ values into the results viewer. To use Harlequin anyway, set the --no-download-tzdata option. │ │ For more info, see https://harlequin.sh/docs/troubleshooting/timezone-windows │ │ Download failed with the following exception: │ │ oops: bad dow name: il │ ╰─────────────────────────────────────────────────────────────────────╯ Contributing Are you interested in contributing a fix?

What is the output of harlequin --version? harlequin, version 1.24.1

Installed Adapters:

What other options are you using when invoking Harlequin? (If you are using a profile, please add relevant items from your profile here).

No extra options

Can you tell us more about your system?

How did you install Harlequin?

tconbeer commented 1 week ago

Thanks for the report; this was mentioned in a PR last week, and there is some more background here: https://github.com/tconbeer/harlequin/pull/646#issuecomment-2367746145

The tl;dr is that the lastest TZ database contains an error.

The current workarounds are:

  1. Run harlequin with the --no-download-tzdata option (with the caveats in the error message)
  2. Manually download and extract an IANA TZ database that is NOT 2024b. Harlequin checks the following locations for such a database: %USERPROFILE%\Downloads\tzdata, %USERPROFILE%\AppData\Local\harlequin\harlequin\tzdata
  3. Manually edit the downloaded file at %USERPROFILE%\AppData\Local\harlequin\harlequin\tzdata\northamerica and replace all instances of the word April with Apr (there is only 1 entry in the actual code, but there are many instance in comments that can be replaced safely)