erlio / vmq_diversity

[OBSOLETE since VerneMQ 1.0.0rc1 - now part of the main repo] A VerneMQ Plugin Builder Toolkit
https://vernemq.com
26 stars 5 forks source link

Error compiling on Ubuntu 14.04 #6

Closed krvarma closed 8 years ago

krvarma commented 8 years ago

I am having some issues compiling on Ubuntu 14.04, Following error is showing on the console, could someone help me to get it compiled?

===> Compiling bson
===> Compiling /root/vmq_diversity/_build/default/lib/bson/src/bson_binary.erl failed
/root/vmq_diversity/_build/default/lib/bson/src/bson_binary.erl:40: syntax error before: '{'

Complete console output

root@dvice:~/vmq_diversity# sudo ./rebar3 compile
===> Verifying dependencies...
===> Fetching clique ({pkg,<<"clique">>,<<"3.0.1">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/clique-3.0.1.tar is up to date, reusing it
===> Fetching emysql ({git,"git://github.com/djustinek/Emysql.git",
                                  "fa7c94b5237a56cec6d75c3d3b1e51060426e099"})
===> WARNING: It is recommended to use {branch, Name}, {tag, Tag} or {ref, Ref}, otherwise updating the dep may not work as expected.
===> Fetching epgsql ({pkg,<<"epgsql">>,<<"3.1.1">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/epgsql-3.1.1.tar is up to date, reusing it
===> Fetching eredis ({pkg,<<"eredis">>,<<"1.0.8">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/eredis-1.0.8.tar is up to date, reusing it
===> Fetching hackney ({pkg,<<"hackney">>,<<"1.6.0">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/hackney-1.6.0.tar is up to date, reusing it
===> Fetching jsx ({pkg,<<"jsx">>,<<"2.8.0">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/jsx-2.8.0.tar is up to date, reusing it
===> Fetching lager ({pkg,<<"lager">>,<<"3.0.2">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/lager-3.0.2.tar is up to date, reusing it
===> Fetching luerl ({git,"git://github.com/rvirding/luerl.git",
                                 {branch,"develop"}})
===> Fetching mongodb ({git,"git://github.com/comtihon/mongodb-erlang.git",
                                   {tag,"v0.7.9"}})
===> Package <<"rebar_ct">> not found. Fetching registry updates and trying again...
===> Updating package registry...
===> Writing registry to /root/.cache/rebar3/hex/default/registry
===> Generating package index...
===> [cloudi_service_oauth1:1.5.1] Only existing version of cloudi_service_db_riak is 1.3.3 which does not match constraint ~> 1.5.1. Using anyway, but it is not guaranteed to work.
===> Writing index to /root/.cache/rebar3/hex/default/packages.idx
===> Plugin rebar_ct not available. It will not be used.
===> Fetching poolboy ({pkg,<<"poolboy">>,<<"1.5.1">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/poolboy-1.5.1.tar is up to date, reusing it
===> Fetching vmq_commons ({git,
                                      "git://github.com/erlio/vmq_commons.git",
                                      {branch,"master"}})
===> Fetching bson ({git,"git://github.com/vintenove/bson-erlang",
                                {branch,"master"}})
===> Fetching certifi ({pkg,<<"certifi">>,<<"0.4.0">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/certifi-0.4.0.tar is up to date, reusing it
===> Fetching cuttlefish ({pkg,<<"cuttlefish">>,<<"2.0.7">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/cuttlefish-2.0.7.tar is up to date, reusing it
===> Fetching goldrush ({pkg,<<"goldrush">>,<<"0.1.7">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/goldrush-0.1.7.tar is up to date, reusing it
===> Fetching idna ({pkg,<<"idna">>,<<"1.2.0">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/idna-1.2.0.tar is up to date, reusing it
===> Fetching metrics ({pkg,<<"metrics">>,<<"1.0.1">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/metrics-1.0.1.tar is up to date, reusing it
===> Fetching mimerl ({pkg,<<"mimerl">>,<<"1.0.2">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/mimerl-1.0.2.tar is up to date, reusing it
===> Fetching pbkdf2 ({git,"https://github.com/basho/erlang-pbkdf2.git",
                                  {tag,"2.0.0"}})
===> Fetching ssl_verify_fun ({pkg,<<"ssl_verify_fun">>,<<"1.1.0">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/ssl_verify_fun-1.1.0.tar is up to date, reusing it
===> Fetching getopt ({pkg,<<"getopt">>,<<"0.8.2">>})
===> Insecure HTTPS request (peer verification disabled), please update to OTP 17.4 or later
===> Version cached at /root/.cache/rebar3/hex/default/packages/getopt-0.8.2.tar is up to date, reusing it
===> Skipping lager (from {pkg,<<"lager">>,<<"3.0.2">>}) as an app of the same name has already been fetched
===> Compiling mimerl
===> Compiling goldrush
===> Compiling lager
===> Compiling getopt
===> Compiling cuttlefish
===> Building escript...
===> Compiling clique
===> Compiling pbkdf2
===> Compiling certifi
===> Compiling jsx
===> Compiling ssl_verify_fun
===> Compiling metrics
===> Compiling idna
===> Compiling hackney
===> Compiling emysql
Generating "include/crypto_compat.hrl" ...
...supports cryto:hash/2
...writing "include/crypto_compat.hrl"
===> Compiling bson
===> Compiling /root/vmq_diversity/_build/default/lib/bson/src/bson_binary.erl failed
/root/vmq_diversity/_build/default/lib/bson/src/bson_binary.erl:40: syntax error before: '{'

/root/vmq_diversity/_build/default/lib/bson/src/bson_binary.erl:4: function get_map/1 undefined
/root/vmq_diversity/_build/default/lib/bson/src/bson_binary.erl:36: spec for undefined function bson_binary:get_map/1
/root/vmq_diversity/_build/default/lib/bson/src/bson_binary.erl:36: type map() undefined
/root/vmq_diversity/_build/default/lib/bson/src/bson_binary.erl:51: illegal guard expression
/root/vmq_diversity/_build/default/lib/bson/src/bson_binary.erl:53: illegal guard expression
/root/vmq_diversity/_build/default/lib/bson/src/bson_binary.erl:78: illegal guard expression
/root/vmq_diversity/_build/default/lib/bson/src/bson_binary.erl:92: function get_map/1 undefined

root@dvice:~/vmq_diversity#
ioolkos commented 8 years ago

Hi @krvarma thanks for letting us know about this!

I just correctly compiled a fresh clone on Erlang OTP 18.3. In general we're not yet ready for OTP 19 (compiling will fail with another error there though).

What Erlang version are you using?

krvarma commented 8 years ago

@ioolkos thanks for quick reply, it was OTP 19, let me install 18.3 and compile.

I will update my progress here.

Thanks!

krvarma commented 8 years ago

Thanks @ioolkos, I successfully compiled the code but I am having another issue (I know it is a stupid issue, sorry)

How do I enable it using vmq-admin, it is showing error, my command is

vmq-admin plugin enable --name vmq_diversity --path root/vmq_diversity/_build/default/

Then I tried this also

vmq-admin plugin enable --name vmq_diversity --path root/vmq_diversity/_build/default/lib/vmq_diversity/

ioolkos commented 8 years ago

Hm, the first command looks totally OK.

What is the actual error?

ioolkos commented 8 years ago

What could be the problem is that realeases up to 0.12.5 used Erlang 17.5. Release 0.13.1 uses OTP 18, so should be compatible with a OTP 18 compiled version of vmq_diversity.

krvarma commented 8 years ago

The error is

root@dvice:~# vmq-admin plugin enable --name vmq_diversity --path /root/vmq_diversity/_build/default/
Invalid value: "/root/vmq_diversity/_build/default/" for flag: path
root@dvice:~#
krvarma commented 8 years ago

I am on Ubuntu 14.04 and using VerneMQ 0.13.1 and OTP 18 to compile vmq_diversity

ioolkos commented 8 years ago

Huh, strange. In the vmq_diversity folder what is your 'pwd'?

krvarma commented 8 years ago

I didn't understand that, I haven't set set any password, is that what you are asking?

ioolkos commented 8 years ago

I apologise for being unclear. I meant to ask what your actual path to the directory is? is it 100% correct as given in --path?

krvarma commented 8 years ago

Yes, I am sure it is the folder, following is the ls output of that folder, may be it will be you better understand it

root@dvice:~/vmq_diversity/_build/default# ls
bin  lib
root@dvice:~/vmq_diversity/_build/default#
ioolkos commented 8 years ago

OK. I currently have no explanation why this doesn't work.

krvarma commented 8 years ago

Shall we copy he bin files to some other folder and ty, if yes, could you please tell me what all files I wanted to copy?

larshesel commented 8 years ago

It is not necessary to copy the files anywhere.

It's a strange issue you have. My current setup is a vernemq compiled with erlang 18.3 and vmq_diversity is also compiled with that erlang version and I can enable the plugin without any issues:

$ _build/default/rel/vernemq/bin/vmq-admin plugin enable --name=vmq_diversity --path /home/lhc/dev/erl.io/vmq_diversity/_build/default/
Done

The issues for the error you see (invalid value ... for flag path) can be either that the absolute path to the plugin is incorrect or because the user VerneMQ is running as doesn't have permissions to read the folder.

Can you please double-check everything once more? Can the user running the vernemq access the plugin directory and all permissions are OK?

Thanks, Lars

krvarma commented 8 years ago

Thank you @ioolkos and @larshesel!, I just download remvoed the old vernemq vmq_diversity and compiled both afresh. Its working now. Don't know what happened to the old one.

Anyway it's happy ending :)

Thanks you all agian!