lau / tzdata

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

Tzdata.ReleaseUpdater argument error #88

Open dabaer opened 4 years ago

dabaer commented 4 years ago

Hello,

Erlang/OTP 22 [erts-10.5] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1]

IEx 1.9.4 (compiled with Erlang/OTP 22)
{
    "hackney": {:hex, :hackney, "1.15.2", "07e33c794f8f8964ee86cebec1a8ed88db5070e52e904b8f12209773c1036085"},
    "timex": {:hex, :timex, "3.6.1", "efdf56d0e67a6b956cc57774353b0329c8ab7726766a11547e529357ffdc1d56"},
    "tzdata": {:hex, :tzdata, "1.0.2", "6c4242c93332b8590a7979eaf5e11e77d971e579805c44931207e32aa6ad3db1"}
}

I've been getting an error every time my project tries to update the timezone database, for a few weeks now.

** (ArgumentError) argument error
    (stdlib) :ets.lookup_element(:hackney_config, :mod_metrics, 2)
    /proj/deps/hackney/src/hackney_metrics.erl:26: :hackney_metrics.get_engine/0
    /proj/deps/hackney/src/hackney_connect.erl:78: :hackney_connect.create_connection/5
    /proj/deps/hackney/src/hackney_connect.erl:47: :hackney_connect.connect/5
    /proj/deps/hackney/src/hackney.erl:333: :hackney.request/5
    (tzdata) lib/tzdata/http_client/hackney.ex:17: Tzdata.HTTPClient.Hackney.head/3
    (tzdata) lib/tzdata/data_loader.ex:46: Tzdata.DataLoader.last_modified_of_latest_available/1
    (tzdata) lib/tzdata/release_updater.ex:81: Tzdata.ReleaseUpdater.loaded_tzdata_matches_remote_last_modified?/0
    (tzdata) lib/tzdata/release_updater.ex:42: Tzdata.ReleaseUpdater.poll_for_update/0

I've run into a dead end debugging this as the Tzdata.HTTPClient.Hackney module uses the callback system I'm not familiar with.

I also don't see any similar issues created, so I'm thinking this is some sort of configuration error on my part. Do you perhaps have an idea why this is erroring?

aptinio commented 4 years ago

This happens to me too, but intermittently. I have the same versions of Erlang, Elixir, tzdata and hackney as @dabaer.

Jcambass commented 4 years ago

Can confirm that this happens.

gushonorato commented 4 years ago

I had the same issue and I solved starting hackney before tzdata.

def application do
    [
     ...,
      extra_applications: [:logger, :runtime_tools, :hackney, :tzdata]
    ]
  end