benoitc / hackney

simple HTTP client in Erlang
Other
1.34k stars 427 forks source link

ets lookup error inside rebar3 plugin #738

Closed ziopio closed 4 months ago

ziopio commented 7 months ago

My team encountered this error while running our plugins under rebar:

Error: badarg
[{ets,lookup_element,
      [hackney_config,mod_metrics,2],
      [{error_info,#{cause => id,module => erl_stdlib_errors}}]},
 {hackney_metrics,get_engine,0,
                  [{file,"/***/_build/default/plugins/hackney/src/hackney_metrics.erl"},
                   {line,27}]},
 {hackney_connect,create_connection,5,
                  [{file,"/***/_build/default/plugins/hackney/src/hackney_connect.erl"},
                   {line,75}]},
 {hackney_connect,connect,5,
                  [{file,"/***/_build/default/plugins/hackney/src/hackney_connect.erl"},
                   {line,44}]},
 {grisp_tools_package,list_bucket,2,
                      [{file,"/***/_build/default/plugins/grisp_tools/src/grisp_tools_package.erl"},
                       {line,21}]},

The code that makes the call is this one https://github.com/grisp/grisp_tools/blob/23958f60be544986228c18b9e9d616230f7e8427/src/grisp_tools_package.erl#L20C1-L24C9 The plugin lists hackney in the applications section, therefor it should be started correctly. https://github.com/grisp/grisp_tools/blob/master/src/grisp_tools.app.src

We can only reproduce this on a single computer, we want to report this in case anyone has any suggestion on the possible cause.

benoitc commented 5 months ago

on which version of Erlang did you have this error? Do you set a custom hackney application environment n your application?

ziopio commented 4 months ago

My colleague, which was the only one experiencing this, does not remember. She also cannot reproduce it anymore. I'll close the issue. It was probably a problem related to switchng erlang versions on her machine.