Skip to content

etcd plugin not works with username and password #15191

@caodingpeng

Description

@caodingpeng

Describe the bug

try to use etcd plugin and config

cluster_formation.peer_discovery_backend = etcd

cluster_formation.etcd.endpoints.1 = one.etcd.eng.example.local:2379
cluster_formation.etcd.endpoints.2 = two.etcd.eng.example.local:2479
cluster_formation.etcd.endpoints.3 = three.etcd.eng.example.local:2579

cluster_formation.etcd.username = rabbitmq
cluster_formation.etcd.password = s3kR37

and got this error:

Details
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0> ** When server state  = {recover,
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>                             {statem_data,
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>                                 ["etcd:2379"],
�2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>                                 [],undefined,undefined,undefined,
�2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>                                 <<"rabbitmq">>,<<"default">>,undefined,61,
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>                                 undefined,70,"root", 
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>                                 {encrypted,
�2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>                                     <<"475vrBGKy13DRJ/+L67Wx1Ri/clDybcwoua/ht78AC9/xlfXZXaXkGDMPzyi1o2qBkB+QaRa2cP8UcDcTUtFRIByh18DhM0Z9FtBSmCPdck=">>}}}
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0> ** Reason for termination = error:function_clause
�2025-12-30 11:11:04.376769+00:00 [error] <0.287.0> ** Callback modules = [rabbitmq_peer_discovery_etcd_v3_client]
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0> ** Callback mode = [state_functions,state_enter]
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0> ** Stacktrace =
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0> **  [{rabbit_data_coercion,to_list,
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>          [{encrypted,
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>               {encrypted,
�2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>                   <<"475vrBGKy13DRJ/+L67Wx1Ri/clDybcwoua/ht78AC9/xlfXZXaXkGDMPzyi1o2qBkB+QaRa2cP8UcDcTUtFRIByh18DhM0Z9FtBSmCPdck=">>}}],
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>          [{file,"rabbit_data_coercion.erl"},{line,23}]},
�2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>      {rabbitmq_peer_discovery_etcd_v3_client,connection_options,1,
�2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>          [{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},{line,441}]},
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>      {rabbitmq_peer_discovery_etcd_v3_client,do_connect,3,
�2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>          [{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},{line,331}]},
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>      {rabbitmq_peer_discovery_etcd_v3_client,recover,3,
�2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>          [{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},{line,144}]},
�2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>      {gen_statem,loop_state_callback,11,[{file,"gen_statem.erl"},{line,3735}]},
�2025-12-30 11:11:04.376769+00:00 [error] <0.287.0>      {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,329}]}]
2025-12-30 11:11:04.376769+00:00 [error] <0.287.0> 
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>   crasher:
�2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     initial call: rabbitmq_peer_discovery_etcd_v3_client:init/1
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     pid: <0.287.0>
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     registered_name: rabbitmq_peer_discovery_etcd_v3_client
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     exception error: no function clause matching
�2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>                      rabbit_data_coercion:to_list({encrypted,
�2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>                                                    {encrypted,
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>                                                     <<"475vrBGKy13DRJ/+L67Wx1Ri/clDybcwoua/ht78AC9/xlfXZXaXkGDMPzyi1o2qBkB+QaRa2cP8UcDcTUtFRIByh18DhM0Z9FtBSmCPdck=">>}}) (rabbit_data_coercion.erl, line 23)
�2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>       in function  rabbitmq_peer_discovery_etcd_v3_client:connection_options/1 (rabbitmq_peer_discovery_etcd_v3_client.erl, line 441)
�2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>       in call from rabbitmq_peer_discovery_etcd_v3_client:do_connect/3 (rabbitmq_peer_discovery_etcd_v3_client.erl, line 331)
�2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>       in call from rabbitmq_peer_discovery_etcd_v3_client:recover/3 (rabbitmq_peer_discovery_etcd_v3_client.erl, line 144)
�2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>       in call from gen_statem:loop_state_callback/11 (gen_statem.erl, line 3735)
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     ancestors: [rabbit]
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     message_queue_len: 1
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     messages: [{'$gen_call',{<0.209.0>,
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>                                 [alias|
�2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>                                  #Ref<0.0.26755.2365690787.461701121.165893>]},
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>                                register}]
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     links: []
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     dictionary: []
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     trap_exit: false
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     status: running
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     heap_size: 10958
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     stack_size: 29
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>     reductions: 34906
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0>   neighbours:
2025-12-30 11:11:04.377088+00:00 [error] <0.287.0> 
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0> 
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0> BOOT FAILED
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0> ===========
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0> Exception during startup:
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0> 
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0> exit:{{function_clause,[{rabbit_data_coercion,to_list,[{encrypted,{encrypted,<<"475vrBGKy13DRJ/+L67Wx1Ri/clDybcwoua/ht78AC9/xlfXZXaXkGDMPzyi1o2qBkB+QaRa2cP8UcDcTUtFRIByh18DhM0Z9FtBSmCPdck=">>}}],[{file,"rabbit_data_coercion.erl"},{line,23}]},{rabbitmq_peer_discovery_etcd_v3_client,connection_options,1,[{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},{line,441}]},{rabbitmq_peer_discovery_etcd_v3_client,do_connect,3,[{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},{line,331}]},{rabbitmq_peer_discovery_etcd_v3_client,recover,3,[{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},{line,144}]},{gen_statem,loop_state_callback,11,[{file,"gen_statem.erl"},{line,3735}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,329}]}]},{gen_statem,call,[rabbitmq_peer_discovery_etcd_v3_client,register,15000]}}
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0> 
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0>     gen:do_call/4, line 270

BOOT FAILED
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0>     gen_statem:call/3, line 3250
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0>     rabbit_peer_discovery_etcd:register/0, line 83
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0>     rabbit_peer_discovery:register/1, line 1091
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0>     rabbit_peer_discovery:maybe_register/0, line 1015
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0>     rabbit_db:init/0, line 54
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0>     rabbit_boot_steps:-run_step/2-lc$^0/1-0-/2, line 53
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0>     rabbit_boot_steps:run_step/2, line 60
2025-12-30 11:11:04.381585+00:00 [error] <0.209.0> 
===========
Exception during startup:

exit:{{function_clause,[{rabbit_data_coercion,to_list,[{encrypted,{encrypted,<<"475vrBGKy13DRJ/+L67Wx1Ri/clDybcwoua/ht78AC9/xlfXZXaXkGDMPzyi1o2qBkB+QaRa2cP8UcDcTUtFRIByh18DhM0Z9FtBSmCPdck=">>}}],[{file,"rabbit_data_coercion.erl"},{line,23}]},{rabbitmq_peer_discovery_etcd_v3_client,connection_options,1,[{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},{line,441}]},{rabbitmq_peer_discovery_etcd_v3_client,do_connect,3,[{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},{line,331}]},{rabbitmq_peer_discovery_etcd_v3_client,recover,3,[{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},{line,144}]},{gen_statem,loop_state_callback,11,[{file,"gen_statem.erl"},{line,3735}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,329}]}]},{gen_statem,call,[rabbitmq_peer_discovery_etcd_v3_client,register,15000]}}

    gen:do_call/4, line 270
    gen_statem:call/3, line 3250
    rabbit_peer_discovery_etcd:register/0, line 83
    rabbit_peer_discovery:register/1, line 1091
    rabbit_peer_discovery:maybe_register/0, line 1015
    rabbit_db:init/0, line 54
    rabbit_boot_steps:-run_step/2-lc$^0/1-0-/2, line 53
    rabbit_boot_steps:run_step/2, line 60

2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0> Set stop reason to: {error,
2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                      {{function_clause,
2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                        [{rabbit_data_coercion,to_list,
2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                          [{encrypted,
2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                            {encrypted,
�2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                             <<"475vrBGKy13DRJ/+L67Wx1Ri/clDybcwoua/ht78AC9/xlfXZXaXkGDMPzyi1o2qBkB+QaRa2cP8UcDcTUtFRIByh18DhM0Z9FtBSmCPdck=">>}}],
�2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                          [{file,"rabbit_data_coercion.erl"},{line,23}]},
�2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                         {rabbitmq_peer_discovery_etcd_v3_client,
2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                          connection_options,1,
�2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                          [{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},
2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                           {line,441}]},
�2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                         {rabbitmq_peer_discovery_etcd_v3_client,do_connect,3,
�2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                          [{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},
2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                           {line,331}]},
�2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                         {rabbitmq_peer_discovery_etcd_v3_client,recover,3,
�2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                          [{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},
2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                           {line,144}]},
gen_statem,loop_state_callback,11,[debug] <0.209.0>                         {
�2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                          [{file,"gen_statem.erl"},{line,3735}]},
2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                         {proc_lib,init_p_do_apply,3,
�2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                          [{file,"proc_lib.erl"},{line,329}]}]},
2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                       {gen_statem,call,
�2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                        [rabbitmq_peer_discovery_etcd_v3_client,register,
2025-12-30 11:11:05.383169+00:00 [debug] <0.209.0>                         15000]}}}
2025-12-30 11:11:05.385098+00:00 [debug] <0.209.0> Change boot state to `stopped`
�2025-12-30 11:11:05.385874+00:00 [debug] <0.146.0> Boot state/systemd: sending non-systemd state (stopped) as status description: "Standing by"
�2025-12-30 11:11:05.386139+00:00 [notice] <0.45.0> Application rabbit exited with reason: {{{function_clause,[{rabbit_data_coercion,to_list,
[{encrypted,{encrypted,<<"475vrBGKy13DRJ/+L67Wx1Ri/clDybcwoua/ht78AC9/xlfXZXaXkGDMPzyi1o2qBkB+QaRa2cP8UcDcTUtFRIByh18DhM0Z9FtBSmCPdck=">>}}],[{file,"rabbit_data_coercion.erl"},{line,23}]},
{rabbitmq_peer_discovery_etcd_v3_client,connection_options,1,[{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},{line,441}]},{rabbitmq_peer_discovery_etcd_v3_client,do_connect,3,
[{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},{line,331}]},{rabbitmq_peer_discovery_etcd_v3_client,recover,3,[{file,"rabbitmq_peer_discovery_etcd_v3_client.erl"},{line,144}]},
{gen_statem,loop_state_callback,11,[{file,"gen_statem.erl"},{line,3735}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,329}]}]},
{gen_statem,call,[rabbitmq_peer_discovery_etcd_v3_client,register,15000]}},{rabbit,start,[normal,[]]}}
�{exit,terminating,[{application_controller,call,2,[{file,"application_controller.erl"},{line,511}]},{application,'-ensure_all_started/3-lc$^0/1-0-',1,
[{file,"application.erl"},{line,367}]},{application,ensure_all_started,3,[{file,"application.erl"},{line,367}]},{rabbit,'-start_it/1-fun-0-',1,[{file,"rabbit.erl"},{line,440}]},
{timer,tc,2,[{file,"timer.erl"},{line,595}]},{rabbit,start_it,1,[{file,"rabbit.erl"},{line,436}]},{init,start_it,1,[]},{init,start_em,1,[]}]}
�2025-12-30 11:11:05.386717+00:00 [debug] <0.45.0> Running rabbit_prelaunch:shutdown_func() as part of kernel shutdown

anyone can help?

Reproduction steps

  1. follow document https://www.rabbitmq.com/docs/3.13/cluster-formation#peer-discovery-etcd
  2. enable etcd plugin and config with username and password

Expected behavior

connect etcd faild and rabbitmq exit with error

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions