lau / tzdata

tzdata for Elixir. Born from the Calendar library.
MIT License
303 stars 71 forks source link

:tzdata_release_updater terminating. 2nd argument: not a tuple #148

Closed instancer-kirik closed 1 month ago

instancer-kirik commented 1 month ago
[debug] Tzdata data downloaded. Release version 2024b.
[error] GenServer :tzdata_release_updater terminating
** (ArgumentError) errors were found at the given arguments:

  * 2nd argument: not a tuple

    :erlang.element(1, :error)
    (tzdata 1.1.1) lib/tzdata/util.ex:223: Tzdata.Util.to_int/1
    (tzdata 1.1.1) lib/tzdata/parser.ex:38: Tzdata.Parser.process_rule/1
    (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
    (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
    (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
    (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
    (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
    (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
    (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
    (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
    (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
    (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
    (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
    (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
    (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
    (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
    (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
    (tzdata 1.1.1) lib/tzdata/parser.ex:86: Tzdata.Parser.process_zone/5
    (tzdata 1.1.1) lib/tzdata/parser.ex:24: Tzdata.Parser.process_tz_list/1
Last message: :check_if_time_to_update
State: []

I did start off with my config as config :tzdata, :data_dir, "priv/tzdata" which also had this error on mix phx.server and is now

config :tzdata, :autoupdate, :disabled # Disable automatic updates of tzdata because crashy
config :elixir, :time_zone_database, Tzdata.TimeZoneDatabase
config :tzdata, :data_dir, "priv/tzdata"
treshenry commented 1 month ago

Yep, just saw the same after updating.

[error] GenServer :tzdata_release_updater terminating
** (ArgumentError) errors were found at the given arguments:

  * 2nd argument: not a tuple

    :erlang.element(1, :error)
    (tzdata 1.1.1) lib/tzdata/util.ex:223: Tzdata.Util.to_int/1
namxam commented 1 month ago

It seems this have been an issue which is marked as resolved, but isn't. From what I understood by a quick glance, the source data might have changed and causes issues. #143

lau commented 1 month ago

@namxam Is this after upgrading to tzdata v1.1.2 ?

namxam commented 1 month ago

Honestly I don't know, because the error is handled gracefully. I just noticed it in a project I am not working on often. I know I updated a few dependencies but I am not sure if tzdata was among it. I will check when I am back at my computer.

barttenbrinke commented 1 month ago

Was greeted with the same error this morning, Upgrading from tzdata 1.1.1 => 1.1.2 fixed this for me.

chauhan471 commented 1 month ago

Was greeted with the same error this morning, Upgrading from tzdata 1.1.1 => 1.1.2 fixed this for me.

Thanks it saved me some time.

treshenry commented 1 month ago

I think the tzdata dep in our project is actually coming from here: https://github.com/bitwalker/timex/blob/c45b9a734074ac2a56355ec52ebf931b932223b7/mix.exs#L58. Our lock file says 1.1.1 so I'll update and see if that resolves it.

lau commented 1 month ago

This should be fixed in the v1.1.2 release: https://github.com/lau/tzdata/commit/e63fc28c02d79dec9ea56e6cecf721f595a18495

treshenry commented 1 month ago

Woot!

image
hebbo commented 3 weeks ago

~anyone else still seeing this error even after updating to 1.1.2?~

treshenry commented 3 weeks ago

You shouldn't be seeing this error as of 1.1.2. Check and make sure your mix.lock is showing :tzdata, "1.1.2" in case you had some sort of dep shenanigans @hebbo.

hebbo commented 3 weeks ago

You shouldn't be seeing this error as of 1.1.2. Check and make sure your mix.lock is showing :tzdata, "1.1.2" in case you had some sort of dep shenanigans @hebbo.

Thanks @treshenry you are right. After writing the post we realised we actually never deployed the update in Production. False alarm.