rabbitmq / rabbitmq-auth-backend-http

HTTP-based authorisation and authentication for RabbitMQ
Other
199 stars 72 forks source link

Cannot configure "http_method" within new config format #61

Closed decaz closed 6 years ago

decaz commented 6 years ago

I'm trying to run RabbitMQ 3.7.0 with auth_http.http_method = post config setting, but I'm getting the following error:

Config file generation failed 13:19:51.969 [error] You've tried to set auth_http.http_method, but there is no setting with that name.
13:19:51.969 [error]   Did you mean one of these?
13:19:51.989 [error]     auth_http.topic_path
13:19:51.989 [error]     auth_http.user_path
13:19:51.989 [error]     auth_http.vhost_path
13:19:51.989 [error] Error generating configuration in phase transform_datatypes
13:19:51.989 [error] Conf file attempted to set unknown variable: auth_http.http_method

Is this configuration option is deprecated or renamed?

michaelklishin commented 6 years ago

Neither, it's simply not in the schema.

decaz commented 6 years ago

@michaelklishin I have updated RabbitMQ up to the version 3.7.1 and tried again, but there is an error:

2017-12-22 08:37:44.474 [error] <0.2917.0> STOMP error frame sent:
Message: "Processing error"
Detail: "Processing error"
Server private detail: {{function_clause,[{amqp_gen_connection,terminate,[{{case_clause,{badrpc,{'EXIT',{{badmatch,post},[{rabbit_auth_backend_http,do_http_req,2,[{file,"src/rabbit_auth_backend_http.erl"},{line,122}]},{rabbit_auth_backend_http,http_req,3,[{file,"src/rabbit_auth_backend_http.erl"},{line,106}]},{rabbit_auth_backend_http,user_login_authentication,2,[{file,"src/rabbit_auth_backend_http.erl"},{line,42}]},{rabbit_access_control,try_authenticate,3,[{file,"src/rabbit_access_control.erl"},{line,88}]},{rabbit_access_control,'-check_user_login/2-fun-0-',4,[{file,"src/rabbit_access_control.erl"},{line,74}]},{lists,foldl,3,[{file,"lists.erl"},{line,1263}]},{rabbit_direct,connect,5,[{file,"src/rabbit_direct.erl"},{line,101}]},{rpc,local_call,3,[{file,"rpc.erl"},{line,321}]}]}}}},[{amqp_direct_connection,connect,4,[{file,"src/amqp_direct_connection.erl"},{line,151}]},{amqp_gen_connection,handle_call,3,[{file,"src/amqp_gen_connection.erl"},{line,171}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,636}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,665}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]},{<0.2919.0>,{amqp_params_direct,<<"username">>,<<"password">>,<<"vhost">>,rabbit@rabbitmq,{amqp_adapter_info,{172,18,0,3},15671,{172,18,0,1},41288,<<"172.18.0.1:41288 -> 172.18.0.3:15671">>,{'Web STOMP',"1.2"},[{channels,1},{channel_max,1},{frame_max,0},{client_properties,[{<<"product">>,longstr,<<"STOMP client">>}]},{state,running},{ssl,true},{ssl_protocol,'tlsv1.2'},{ssl_key_exchange,ecdhe_rsa},{ssl_cipher,aes_128_gcm},{ssl_hash,null}]},[]}}],[{file,"src/amqp_gen_connection.erl"},{line,239}]},{gen_server,try_terminate,3,[{file,"gen_server.erl"},{line,648}]},{gen_server,terminate,10,[{file,"gen_server.erl"},{line,833}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]},{gen_server,call,[<0.2920.0>,connect,60000]}}
2017-12-22 08:37:44.474 [error] <0.2920.0> ** Generic server <0.2920.0> terminating
** Last message in was connect
** When Server state == {<0.2919.0>,{amqp_params_direct,<<"username">>,<<"password">>,<<"vhost">>,rabbit@rabbitmq,{amqp_adapter_info,{172,18,0,3},15671,{172,18,0,1},41288,<<"172.18.0.1:41288 -> 172.18.0.3:15671">>,{'Web STOMP',"1.2"},[{channels,1},{channel_max,1},{frame_max,0},{client_properties,[{<<"product">>,longstr,<<"STOMP client">>}]},{state,running},{ssl,true},{ssl_protocol,'tlsv1.2'},{ssl_key_exchange,ecdhe_rsa},{ssl_cipher,aes_128_gcm},{ssl_hash,null}]},[]}}
** Reason for termination ==
** {function_clause,[{amqp_gen_connection,terminate,[{{case_clause,{badrpc,{'EXIT',{{badmatch,post},[{rabbit_auth_backend_http,do_http_req,2,[{file,"src/rabbit_auth_backend_http.erl"},{line,122}]},{rabbit_auth_backend_http,http_req,3,[{file,"src/rabbit_auth_backend_http.erl"},{line,106}]},{rabbit_auth_backend_http,user_login_authentication,2,[{file,"src/rabbit_auth_backend_http.erl"},{line,42}]},{rabbit_access_control,try_authenticate,3,[{file,"src/rabbit_access_control.erl"},{line,88}]},{rabbit_access_control,'-check_user_login/2-fun-0-',4,[{file,"src/rabbit_access_control.erl"},{line,74}]},{lists,foldl,3,[{file,"lists.erl"},{line,1263}]},{rabbit_direct,connect,5,[{file,"src/rabbit_direct.erl"},{line,101}]},{rpc,local_call,3,[{file,"rpc.erl"},{line,321}]}]}}}},[{amqp_direct_connection,connect,4,[{file,"src/amqp_direct_connection.erl"},{line,151}]},{amqp_gen_connection,handle_call,3,[{file,"src/amqp_gen_connection.erl"},{line,171}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,636}]},{gen_server,...},...]},...],...},...]}
** Client <0.2917.0> stacktrace
** [{gen,do_call,4,[{file,"gen.erl"},{line,169}]},{gen_server,call,3,[{file,"gen_server.erl"},{line,210}]},{rabbit_stomp_processor,start_connection,3,[{file,"src/rabbit_stomp_processor.erl"},{line,638}]},{rabbit_stomp_processor,do_login,7,[{file,"src/rabbit_stomp_processor.erl"},{line,587}]},{rabbit_stomp_processor,'-process_connect/3-fun-0-',6,[{file,"src/rabbit_stomp_processor.erl"},{line,279}]},{rabbit_stomp_processor,process_request,3,[{file,"src/rabbit_stomp_processor.erl"},{line,236}]},{rabbit_ws_client,process_received_bytes,4,[{file,"src/rabbit_ws_client.erl"},{line,222}]},{rabbit_ws_client,handle_cast,2,[{file,"src/rabbit_ws_client.erl"},{line,105}]}]
2017-12-22 08:37:44.475 [error] <0.2920.0> CRASH REPORT Process <0.2920.0> with 0 neighbours crashed with reason: no function clause matching amqp_gen_connection:terminate({{case_clause,{badrpc,{'EXIT',{{badmatch,post},[{rabbit_auth_backend_http,do_http_req,2,[{file,...},...]},...]}}}},...}, {<0.2919.0>,{amqp_params_direct,<<"username">>,<<"password">>,...}}) line 239
2017-12-22 08:37:44.475 [error] <0.2918.0> Supervisor {<0.2918.0>,amqp_connection_sup} had child connection started with amqp_gen_connection:start_link(<0.2919.0>, {amqp_params_direct,<<"username">>,<<"password">>,...}) at <0.2920.0> exit with reason no function clause matching amqp_gen_connection:terminate({{case_clause,{badrpc,{'EXIT',{{badmatch,post},[{rabbit_auth_backend_http,do_http_req,2,[{file,...},...]},...]}}}},...}, {<0.2919.0>,{amqp_params_direct,<<"username">>,<<"password">>,...}}) line 239 in context child_terminated
2017-12-22 08:37:44.476 [error] <0.2918.0> Supervisor {<0.2918.0>,amqp_connection_sup} had child connection started with amqp_gen_connection:start_link(<0.2919.0>, {amqp_params_direct,<<"username">>,<<"password">>,...}) at <0.2920.0> exit with reason reached_max_restart_intensity in context shutdown

The configuration is:

auth_backends.1 = internal
auth_backends.2 = http

auth_http.http_method   = post
auth_http.user_path     = http://some_url
auth_http.vhost_path    = http://some_url
auth_http.resource_path = http://some_url
michaelklishin commented 6 years ago

See #62. We are considering doing a very quick 3.7.2.

michaelklishin commented 6 years ago

3.7.2 is out.

decaz commented 6 years ago

@michaelklishin thanks!