Skip to content
This repository has been archived by the owner on Feb 15, 2018. It is now read-only.

autocluster does not work properly with RabbitMQ 3.7.0 #120

Closed
Gsantomaggio opened this issue Dec 12, 2016 · 6 comments
Closed

autocluster does not work properly with RabbitMQ 3.7.0 #120

Gsantomaggio opened this issue Dec 12, 2016 · 6 comments

Comments

@Gsantomaggio
Copy link
Contributor

Hi,

With RabbitMQ 3.7.0 the plugin does not work properly.

I am trying to use etcd as backend and I get the following error:

BOOT FAILED
===========

Error description:
    init:do_boot/3
    init:start_em/1
    rabbit:start_it/1 line 436
    rabbit:broker_start/0 line 314
    rabbit:start_apps/1 line 513
    app_utils:manage_applications/6 line 113
    lists:foldl/3 line 1263
    rabbit:'-handle_app_error/1-fun-0-'/3 line 600
throw:{could_not_start,rabbit,
          {undef,
              [{rabbit_misc,json_decode,
                   ["{\"action\":\"get\",\"node\":{\"key\":\"/rabbitmq/default\",\"dir\":true,\"modifiedIndex\":40660,\"createdIndex\":40660}}\n"],
                   []},
               {autocluster_httpc,decode_body,2,
                   [{file,"src/autocluster_httpc.erl"},{line,184}]},
               {autocluster_httpc,parse_response,1,
                   [{file,"src/autocluster_httpc.erl"},{line,208}]},
               {autocluster_etcd,nodelist,0,
                   [{file,"src/autocluster_etcd.erl"},{line,53}]},
               {autocluster,ensure_registered,2,
                   [{file,"src/autocluster.erl"},{line,97}]},
               {autocluster,init,0,[{file,"src/autocluster.erl"},{line,33}]},
               {rabbit_boot_steps,'-run_step/2-lc$^1/1-1-',1,
                   [{file,"src/rabbit_boot_steps.erl"},{line,49}]},
               {rabbit_boot_steps,run_step,2,
                   [{file,"src/rabbit_boot_steps.erl"},{line,49}]}]}}
Log file(s) (may contain more information):
   <stdout>

15:04:26.160 [error]
Error description:
    init:do_boot/3
    init:start_em/1
    rabbit:start_it/1 line 436
    rabbit:broker_start/0 line 314
    rabbit:start_apps/1 line 513
    app_utils:manage_applications/6 line 113
    lists:foldl/3 line 1263
    rabbit:'-handle_app_error/1-fun-0-'/3 line 600
throw:{could_not_start,rabbit,
          {undef,
              [{rabbit_misc,json_decode,
                   ["{\"action\":\"get\",\"node\":{\"key\":\"/rabbitmq/default\",\"dir\":true,\"modifiedIndex\":40660,\"createdIndex\":40660}}\n"],
                   []},
               {autocluster_httpc,decode_body,2,
                   [{file,"src/autocluster_httpc.erl"},{line,184}]},
               {autocluster_httpc,parse_response,1,
                   [{file,"src/autocluster_httpc.erl"},{line,208}]},
               {autocluster_etcd,nodelist,0,
                   [{file,"src/autocluster_etcd.erl"},{line,53}]},
               {autocluster,ensure_registered,2,
                   [{file,"src/autocluster.erl"},{line,97}]},
               {autocluster,init,0,[{file,"src/autocluster.erl"},{line,33}]},
               {rabbit_boot_steps,'-run_step/2-lc$^1/1-1-',1,
                   [{file,"src/rabbit_boot_steps.erl"},{line,49}]},
               {rabbit_boot_steps,run_step,2,
                   [{file,"src/rabbit_boot_steps.erl"},{line,49}]}]}}
Log file(s) (may contain more information):
   <stdout>
{"init terminating in do_boot",{could_not_start,rabbit,{undef,[{rabbit_misc,json_decode,["{\"action\":\"get\",\"node\":{\"key\":\"/rabbitmq/default\",\"dir\":true,\"modifiedIndex\":40660,\"createdIndex\":40660}}\n"],[]},{autocluster_httpc,decode_body,2,[{file,"src/autocluster_httpc.erl"},{line,184}]},{autocluster_httpc,parse_response,1,[{file,"src/autocluster_httpc.erl"},{line,208}]},{autocluster_etcd,nodelist,0,[{file,"src/autocluster_etcd.erl"},{line,53}]},{autocluster,ensure_registered,2,[{file,"src/autocluster.erl"},{line,97}]},{autocluster,init,0,[{file,"src/autocluster.erl"},{line,33}]},{rabbit_boot_steps,'-run_step/2-lc$^1/1-1-',1,[{file,"src/rabbit_boot_steps.erl"},{line,49}]},{rabbit_boot_steps,run_step,2,[{file,"src/rabbit_boot_steps.erl"},{line,49}]}]}}}

Crash dump is being written to: erl_crash.dump...init terminating in do_boot ()
@Gsantomaggio
Copy link
Contributor Author

Starting from 3.7.0 version the json functions have been moved to the rabbit_json module and removed from rabbit_misc.

I fixed it see master...Gsantomaggio:rabbitmq-autocluster-120 ( I am going to test it)

I won't PR for now, because it breaks the compatibility with the version 3.6.x.

cc @michaelklishin

@Gsantomaggio
Copy link
Contributor Author

I fixed the problem, but I had to rewrite some JSON functions.

The current RabbitMQ JSON module supports only jsx:decode(JSON, [return_maps]).

Had to add on src/autocluster_util.erl these JSON functions that don't use [return_maps]

Note:
This is WIP, and I tested it only using etcd

screen shot 2017-01-24 at 17 19 38

@michaelklishin
Copy link
Collaborator

@Gsantomaggio if there are reasons to expland the API in 3.7.0, let us know.

@Gsantomaggio
Copy link
Contributor Author

Gsantomaggio commented Jan 24, 2017

@michaelklishin it would be useful to add these functions in rabbit_json:

  1. decode
  2. try_decode

@michaelklishin
Copy link
Collaborator

@Gsantomaggio go ahead and submit a PR (and link to this issue).

@Gsantomaggio
Copy link
Contributor Author

Closed here rabbitmq#1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants