Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change url for tz database #51

Merged
merged 2 commits into from
Nov 22, 2017
Merged

change url for tz database #51

merged 2 commits into from
Nov 22, 2017

Conversation

madsheep
Copy link
Contributor

This is crashing for everybody this morning since data_loader is not following redirects:

Application phoenix started on node 'node@localhost'
Application tzdata exited: exited in: Tzdata.App.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: {:error, {:shutdown, {:failed_to_start_child, Tzdata.EtsHolder, {{:badmatch, {:ok, 302, [{"Date", "Wed, 22 Nov 2017 06:13:39 GMT"}, {"X-Frame-Options", "SAMEORIGIN"}, {"Content-Security-Policy", "upgrade-insecure-requests"}, {"Location", "https://data.iana.org/time-zones/tzdata-latest.tar.gz"}, {"Cache-Control", "public, s-maxage=600, max-age=3600"}, {"Expires", "Wed, 22 Nov 2017 07:13:39 GMT"}, {"Content-Length", "0"}, {"content-type", "application/x-gzip"}, {"Server", "Apache"}, {"Strict-Transport-Security", "max-age=48211200; preload"}, {"X-Cache-Hits", "117"}, {"Connection", "keep-alive"}], #Reference<0.0.7.772>}}, [{Tzdata.DataLoader, :download_new, 1, [file: 'lib/tzdata/data_loader.ex', line: 10]}, {Tzdata.DataBuilder, :load_and_save_table, 0, [file: 'lib/tzdata/data_builder.ex', line: 9]}, {Tzdata.EtsHolder, :init, 1, [file: 'lib/tzdata/ets_holder.ex', line: 10]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 328]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}}}
            (tzdata) lib/tzdata/tzdata_app.ex:15: Tzdata.App.start/2
            (kernel) application_master.erl:273: :application_master.start_it_old/4

The included change of url is the easiest way to address it, but I suggest making this a little bit less prone to errors by using hackneys 'follow redirects' option.

@madsheep
Copy link
Contributor Author

Fixes: #50

@maennchen
Copy link

Maybe we should also pass follow_redirect: true to hackney. IANA did a 302 for the file and the library could've continued to work.

@madsheep
Copy link
Contributor Author

Didn't I mention that in the PRs description already? :P I wanted @lau to have his say before we change more but I guess this is a no-brainer improvement. Let me commit that quickly...

@maennchen
Copy link

@madsheep You‘re right. Sorry about that.

@madsheep
Copy link
Contributor Author

All good ;) let's wait for Lau to see this, meanwhile I suggest using my fork in your mix deps.

@lau lau merged commit 12c7fda into lau:master Nov 22, 2017
@lau
Copy link
Owner

lau commented Nov 22, 2017

❤️ 💚 💙 💛 💜

@lau
Copy link
Owner

lau commented Nov 22, 2017

Version 0.5.14 has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants