emqx / emqx-elixir-plugin

An Example Plugin for EMQX in Elixir
https://emqx.io
23 stars 8 forks source link

no_available_configuration #16

Closed 6293 closed 3 years ago

6293 commented 3 years ago

Using develop branch

{emqx_elixir_plugin, {git, "https://github.com/emqx/emqx-elixir-plugin", {branch, "develop"}}}

solved https://github.com/emqx/emqx-elixir-plugin/issues/15, and I could build successfully.

When I tried to load the plugin, however, I got this error:

23:32:11.484 [error] [Plugins] Plugin emqx_elixir_plugin load failed with {:no_avaliable_configuration, [{:emqx_plugins, :generate_configs, 1, [file: '/Users/yudai/IdeaProjects/emqx-rel/_build/emqx/lib/emqx/src/emqx_plugins.erl', line: 237]}, {:emqx_plugins, :load_plugin, 2, [file: '/Users/yudai/IdeaProjects/emqx-rel/_build/emqx/lib/emqx/src/emqx_plugins.erl', line: 262]}, {:emqx_mgmt_api_plugins, :load, 2, [file: '/Users/yudai/IdeaProjects/emqx-rel/_build/emqx/lib/emqx_management/src/emqx_mgmt_api_plugins.erl', line: 80]}, {:minirest_handler, :dispatch, 2, [file: '/Users/yudai/IdeaProjects/emqx-rel/_build/emqx/lib/minirest/src/minirest_handler.erl', line: 84]}, {:minirest, :handle_request, 2, [file: '/Users/yudai/IdeaProjects/emqx-rel/_build/emqx/lib/minirest/src/minirest.erl', line: 112]}, {:minirest, :init, 2, [file: '/Users/yudai/IdeaProjects/emqx-rel/_build/emqx/lib/minirest/src/minirest.erl', line: 104]}, {:cowboy_handler, :execute, 2, [file: '/Users/yudai/IdeaProjects/emqx-rel/_build/emqx/lib/cowboy/src/cowboy_handler.erl', line: 41]}, {:cowboy_stream_h, :execute, 3, [file: '/Users/yudai/IdeaProjects/emqx-rel/_build/emqx/lib/cowboy/src/cowboy_stream_h.erl', line: 320]}]}

Changing emqx_elixir_plugin.conf to a raw config file emqx_elixir_plugin.config solves this problem and the plugin works with no problem.

emqx_elixir_plugin.config is something like this:

[
  {emqx_elixir_plugin, []}
].

Should we use cuttlefish in elixir plugin too?

auror commented 3 years ago

@z8674558 May I pls know how you solved Issue 15 ?

auror commented 3 years ago

@z8674558 ?

6293 commented 3 years ago

@auror Hello, sorry for late reply. I have just started to fix this issue along with https://github.com/emqx/emqx-elixir-plugin/issues/15. I will let you know when the issue is solved on the master branch.

auror commented 3 years ago

@z8674558 Thanks for the reply. Great. In the meantime, could you please share how we are addressing both the problems ?