elixir-inspector / ua_inspector

User agent parser library
Apache License 2.0
125 stars 23 forks source link

UAInspector.Downloader.download() stop working #23

Closed tatiesmars closed 4 years ago

tatiesmars commented 4 years ago

When calling UAInspector.Downloader.download() from iex it keep failing

here is the log:

iex(2)> UAInspector.Downloader.download()
[info] Child :default of Supervisor :hackney_sup started
Pid: #PID<0.625.0>
Start Call: :hackney_pool.start_link(:default, [name: :default])
** (BadMapError) expected a map, got: nil
    (elixir 1.11.0) lib/map.ex:469: Map.get(nil, "map", "")
    (ua_inspector 2.1.0) lib/ua_inspector/downloader/short_code_map_converter.ex:17: UAInspector.Downloader.ShortCodeMapConverter.extract/3
    (ua_inspector 2.1.0) lib/ua_inspector/downloader.ex:81: anonymous fn/1 in UAInspector.Downloader.download/1
    (elixir 1.11.0) lib/enum.ex:786: Enum."-each/2-lists^foreach/1-0-"/2
    (ua_inspector 2.1.0) lib/ua_inspector/downloader.ex:48: UAInspector.Downloader.download/0

Maybe it's related to change from https://raw.githubusercontent.com/matomo-org/device-detector/master/regexes

edit: mix ua_inspector.download is also not working

mneudert commented 4 years ago

Orrrr... and at this very moment I notice that the automatic tests verifying the database compatibility are broken for like 3 weeks and I missed the email :sob:

The error you see however is due to a change in the code base merged like 4 hours ago that broke the short code extraction. Until I have a solid patch for that you can limit the downloader to the last known release before that change:

config :ua_inspector, remote_release: "3.13.1"

If you are otherwise using a default configuration for the source files (no custom remote_path) that should get you back to a working release.

mneudert commented 4 years ago

There is now a version 2.2.0 on hex with a fixed download configuration (pinned to aforementioned 3.13.1). Support for the already release v4 database of matomo-org/device-detector will be done in an upcoming major release.