erlio / vmq_webhooks

[OBSOLETE since VerneMQ 1.0.0rc1 - now part of the main repo] VerneMQ Webhooks - Implement VerneMQ plugins as http endpoints
https://vernemq.com
Apache License 2.0
12 stars 1 forks source link

Plugin enable failing with an error #10

Closed dreson4 closed 7 years ago

dreson4 commented 7 years ago

I have cloned the project and built the application as specified, now when I try to enable it, it doesn't seem to work. This is the command that doesn't work

vmq-admin plugin enable --name=vmq_webhooks --path=/root/verne/default/plugins/vmq_webhooks/_build/default/

The error message RPC to 'VerneMQ@127.0.0.1' failed: {'EXIT', {{function_clause, [{vmq_plugin_mgr,init_plugins_cli, [[[]], ["/root/verne/default/rel/vernemq/bin/../lib/vmq_acl-0.15.2+build.1252.refcab8d43/priv", "/root/verne/default/rel/vernemq/bin/../lib/vmq_passwd-0.15.2+build.1252.refcab8d43/priv", "/root/verne/default/rel/vernemq/lib/vmq_server-0.15.2+build.1252.refcab8d43/priv"]], [{file, "/root/vernemq/_build/default/lib/vmq_plugin/src/vmq_plugin_mgr.erl"}, {line,508}]}, {vmq_plugin_mgr,load_plugins,2, [{file, "/root/vernemq/_build/default/lib/vmq_plugin/src/vmq_plugin_mgr.erl"}, {line,411}]}, {vmq_plugin_mgr,update_plugins,2, [{file, "/root/vernemq/_build/default/lib/vmq_plugin/src/vmq_plugin_mgr.erl"}, {line,356}]}, {vmq_plugin_mgr,handle_plugin_call,2, [{file, "/root/vernemq/_build/default/lib/vmq_plugin/src/vmq_plugin_mgr.erl"}, {line,184}]}, {gen_server,try_handle_call,4, [{file,"gen_server.erl"},{line,629}]}, {gen_server,handle_msg,5, [{file,"gen_server.erl"},{line,661}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"},{line,240}]}]}, {gen_server,call, [vmq_plugin_mgr, {enable_plugin,vmq_webhooks, [{paths, ["/root/verne/default/plugins/vmq_webhooks/_build/default/"]}]}, infinity]}}}

I'm running on Ubuntu 16.04.1

Vernemq instance seems to work just fine on 0.0.0.0:1883 and I can send and receive messages.

ioolkos commented 7 years ago

Hi @dreson4 thanks for reporting this. I'm surprised vmq_plugin_mgr:init_plugins_cliis causing trouble here, as we haven't touched this module in a while.

Handing this over to @dergraf or @larshesel...

larshesel commented 7 years ago

Hi @dreson4 this indeed looks strange.

Could it be a permission problem and the user running VerneMQ is not allowed to access the files of the plugin?

dreson4 commented 7 years ago

Hi @larshesel I don't think the problem is the user's permission, at first I tried with root, everything from compiling the server and the plugin, it didn't work.

Now I have tried creating a new user with sudo privileges and compiling everything from scratch, nothing works. Still the same error, I have no idea what's causing it.

I've also tried changing the listener back to 127.0.0.1 :1883 just in case. I'll keep trying.

larshesel commented 7 years ago

I just tried enabling the vmq_webhooks plugin compiled from latest master and I had no issues. Let's see if we can't figure it out anyway.

Is it always exactly the same error you are seing or do you see different errors?

Are you certain you are not running multiple VerneMQ instances at the same time (maybe an old one) - you can check this with the output of ps -ef | grep beam.

Which version of Erlang are you using and which version of VerneMQ are you using - did you compile it yourself, if so which commit?

What does the lib/vmq_plugin.conf file look like?

dreson4 commented 7 years ago

I'm surprised i'm the only one receiving this error. I have uninstalled everything, ran vernemq stop checked htop to make sure no vernemq process was running, then I have started afresh by creating new user. My ubuntu version is Ubuntu 16.05 - Xenial

I downloaded the .deb file now, because the first time I compiled myself from vernemq master. I have followed all the instructions to install from here http://vernemq.com/docs/installation/debian_and_ubuntu.html got vernemq up and running successifully.

Then I cloned the master of vmq_webhooks, ran rebar3 compile it worked with no errors, I got the _build folder.

Now upon running sudo vmq-admin plugin enable --name=vmq_webhooks --path=/home/baraka/vmq_webhooks/_build/default

I keep getting the same error. The erlang version I'm using is 18.3

This is the result when i run ps -ef | grep beam

vernemq 25890 25889 0 19:24 pts/1 00:00:01 /usr/lib/vernemq/erts-7.3/bin/beam.smp -P 256000 -A 64 -K true -W w -- -root /usr/lib/vernemq -progname vernemq -- -home /var/lib/vernemq -- -boot /usr/lib/vernemq/releases/0.15.2/vernemq -config /var/lib/vernemq/generated.configs/app.2016.12.29.19.24.35.config -setcookie vmq -name VerneMQ@127.0.0.1 -smp enable -vm_args /var/lib/vernemq/generated.configs/vm.2016.12.29.19.24.35.args -pa /usr/lib/vernemq/lib/erlio-patches -- console baraka 26327 23511 0 19:28 pts/0 00:00:00 grep --color=auto beam

This is how /lib/vmq_plugin.conf looks like {plugins,[{application,vmq_passwd,[]}, {application,vmq_acl,[]}, {module,vmq_config,[{hooks,[{change_config,change_config,1}]}]}, {module,vmq_lvldb_store, [{hooks,[{msg_store_write,msg_store_write,2}]}]}, {module,vmq_lvldb_store, [{hooks,[{msg_store_delete,msg_store_delete,2}]}]}, {module,vmq_lvldb_store, [{hooks,[{msg_store_find,msg_store_find,1}]}]}, {module,vmq_lvldb_store, [{hooks,[{msg_store_read,msg_store_read,2}]}]}]}

I'll try setting up a new server instance then see if it will work on that machine.

larshesel commented 7 years ago

Hi @dreson4 do you see similar issues on the new server instance? I still haven't been able to reproduce.

dreson4 commented 7 years ago

Hi @larshesel, sorry I forgot to update. I tried on the new server Ubuntu 14.04 and it worked perfectly, I'm using now, I still have no idea what went wrong with the Ubuntu16 one. Thanks.

larshesel commented 7 years ago

Guess that's one of the mysteries of life we'll have to live with then ;)

rolandvar commented 7 years ago

@larshesel thanks so much for your help!