pinterest / elixometer

A light Elixir wrapper around exometer.

Home Page:https://hexdocs.pm/elixometer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Enumerable not implemented for nil" on subscription creation

kmeehl opened this issue · comments

Following the docs and trying to set up elixometer with influxDB, I get the following error on the first call to Elixometer.update_counter/2. I've not found any configuration changes that get the subscription step to succeed.

I've set up a small example repo displaying the problem: https://bitbucket.org/kmeehl/exotest

** (Protocol.UndefinedError) protocol Enumerable not implemented for nil. This protocol is implemented for: Date.Range, File.Stream, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, List, Map, MapSet, Range, Stream
            (elixir) lib/enum.ex:1: Enumerable.impl_for!/1
            (elixir) lib/enum.ex:116: Enumerable.reduce/3
            (elixir) lib/enum.ex:1832: Enum.map/2
            (elixometer) lib/elixometer.ex:352: Elixometer.create_subscription/1
            (elixometer) lib/elixometer.ex:309: Elixometer.handle_call/3
            (stdlib) gen_server.erl:636: :gen_server.try_handle_call/4
            (stdlib) gen_server.erl:665: :gen_server.handle_msg/6
            (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
    (elixir) lib/gen_server.ex:774: GenServer.call/3
    (elixometer) lib/elixometer.ex:293: Elixometer.ensure_registered/2
    (elixometer) lib/updater.ex:79: Elixometer.Updater.do_update/1
    (elixir) lib/enum.ex:675: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir) lib/enum.ex:675: Enum.each/2
    (elixometer) lib/updater.ex:50: Elixometer.Updater.handle_info/2
    (stdlib) gen_server.erl:616: :gen_server.try_dispatch/4
    (stdlib) gen_server.erl:686: :gen_server.handle_msg/6
Last message: {:mail, #PID<0.279.0>, [{:counter, "Exoteststartcount", 1, nil}], 1, 0}

Hi @kmeehl, unfortunately there is backwards incompatible change in exometer core 1.5. You'll need 1.4 for now.

Thanks! I'll try 1.4. Is this documented somewhere, and I just missed it?

Hi @fishcakez, I've tried changing my deps to use exometer ~> 1.4, but I'm seeing the same problem. Can you please describe what my deps should look like in full to get this working? Here's what I have currently:

{:elixometer, "~> 1.2"},
{:exometer_core, "~> 1.4"},
{:exometer_influxdb, "~> 0.5.7"},
{:setup, github: "uwiger/setup", manager: :rebar, override: true},
{:pobox, "~> 1.0"},
{:edown, "0.8.1", override: true},

i too stumbled across this; unfortunately, this means that currently there is no way to use elixometer with erlang 20 as exometer_core 1.4 is incompatible with that erlang version or am i mistaken?

@kmeehl @mzdrahal as far as I know elixometer 1.2.1 should work with Elixir 1.4.5 and OTP 20 if you have lager as mix dep override entry:

 {:lager, ">= 3.2.1", override: true}

Note I made a mistake previously and meant ~> 1.4.0 for exometer_core but that is the version requirement of elixometer 1.2.1 so a dep entry is not required.

Unfortunately Elixometer does not have a release that is compatible with Elixir 1.5 but master is.

This is fixed by #94.