Connection refused connecting to https://chefserver

While connecting to Chef server by chef-client, The chef node is getting below issue.


[2018-04-05T07:34:16+00:00] INFO: *** Chef 12.21.3 ***
[2018-04-05T07:34:16+00:00] INFO: Platform: x64-mingw32
[2018-04-05T07:34:16+00:00] INFO: Chef-client pid: 3340
[2018-04-05T07:34:16+00:00] INFO: The plugin path C:\chef\ohai\plugins does not exist. Skipping…
[2018-04-05T07:34:33+00:00] ERROR: Connection refused connecting to https:///organizations/harshal/nodes/1430404_VisServer, retry 1/5
[2018-04-05T07:34:39+00:00] ERROR: Connection refused connecting to https:///organizations/harshal/nodes/1430404_VisServer, retry 2/5
[2018-04-05T07:34:45+00:00] ERROR: Connection refused connecting to https:///organizations/harshal/nodes/1430404_VisServer, retry 3/5
[2018-04-05T07:34:51+00:00] ERROR: Connection refused connecting to https:///organizations/harshal/nodes/1430404_VisServer, retry 4/5
[2018-04-05T07:34:57+00:00] ERROR: Connection refused connecting to https:///organizations/harshal/nodes/1430404_VisServer, retry 5/5
e[0m
================================================================================e[0m
e[31mChef encountered an error attempting to load the node data for "1430404_VisServer"e[0m
================================================================================e[0m

e[0mNetworking Error:e[0m
-----------------e[0m
No connection could be made because the target machine actively refused it. - Connection refused connecting to https:///organizations/harshal/nodes/1430404_VisServer, giving up
e[0m
e[0mYour chef_server_url may be misconfigured, or the network could be down.
e[0m
e[0mRelevant Config Settings:e[0m
-------------------------e[0m
chef_server_url “https:///organizations/harshal/”
e[0m
e[0mSystem Info:e[0m
------------e[0m
chef_version=12.21.3
e[0mruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]
e[0mprogram_name=C:/opscode/chef/bin/chef-client
e[0mexecutable=C:/opscode/chef/bin/chef-cliente[0m

e[0m[2018-04-05T07:35:03+00:00] ERROR: Running exception handlers
[2018-04-05T07:35:03+00:00] ERROR: Exception handlers complete
[2018-04-05T07:35:04+00:00] FATAL: Stacktrace dumped to C:/chef/cache/chef-stacktrace.out
[2018-04-05T07:35:04+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-04-05T07:35:04+00:00] FATAL: Errno::ECONNREFUSED: No connection could be made because the target machine actively refused it. - Connection refused connecting to https:///organizations/harshal/nodes/1430404_VisServer, giving up


Also you can take a look at erchef.log which I got inside the chef server machine
2018-04-03 07:56:55.138 [error] gen_server <0.1429.0> terminated with reason: socket_closed_unexpectedly
2018-04-03 07:56:55.138 [error] CRASH REPORT Process <0.1429.0> with 0 neighbours exited with reason: socket_closed_unexpectedly in gen_server:terminate/7 line 826
2018-04-03 07:56:55.138 [error] Supervisor {<0.1427.0>,amqp_connection_sup} had child at module undefined at <0.1429.0> exit with reason socket_closed_unexpectedly in context child_terminated
2018-04-03 07:56:55.138 [error] Supervisor {<0.1427.0>,amqp_connection_sup} had child at module undefined at <0.1429.0> exit with reason reached_max_restart_intensity in context shutdown
2018-04-03 07:56:55.139 [error] gen_server <0.1498.0> terminated with reason: socket_closed_unexpectedly
2018-04-03 07:56:55.139 [error] gen_server <0.1506.0> terminated with reason: {server_initiated_close,320,<<“CONNECTION_FORCED - broker forced connection closure with reason ‘shutdown’”>>}
2018-04-03 07:56:55.139 [error] CRASH REPORT Process <0.1506.0> with 0 neighbours exited with reason: {server_initiated_close,320,<<“CONNECTION_FORCED - broker forced connection closure with reason ‘shutdown’”>>} in gen_server:terminate/7 line 826
2018-04-03 07:56:55.139 [error] CRASH REPORT Process <0.1498.0> with 0 neighbours exited with reason: socket_closed_unexpectedly in gen_server:terminate/7 line 826
2018-04-03 07:56:55.139 [error] Supervisor {<0.1505.0>,amqp_channel_sup} had child at module undefined at <0.1506.0> exit with reason {server_initiated_close,320,<<“CONNECTION_FORCED - broker forced connection closure with reason ‘shutdown’”>>} in context child_terminated
2018-04-03 07:56:55.139 [error] Supervisor {<0.1505.0>,amqp_channel_sup} had child at module undefined at <0.1506.0> exit with reason reached_max_restart_intensity in context shutdown
2018-04-03 07:56:55.139 [error] Supervisor {<0.1496.0>,amqp_connection_sup} had child at module undefined at <0.1498.0> exit with reason socket_closed_unexpectedly in context child_terminated
2018-04-03 07:56:55.139 [error] Supervisor {<0.1496.0>,amqp_connection_sup} had child at module undefined at <0.1498.0> exit with reason reached_max_restart_intensity in context shutdown
2018-04-03 07:56:56.140 [warning] Could not start the network driver: econnrefused
2018-04-03 07:56:56.140 [error] gen_server <0.3122.0> terminated with reason: econnrefused in amqp_network_connection:do_connect/1 line 337
2018-04-03 07:56:56.140 [error] CRASH REPORT Process <0.3122.0> with 0 neighbours exited with reason: econnrefused in gen_server:terminate/7 line 826
2018-04-03 07:56:56.140 [error] Supervisor {<0.3120.0>,amqp_connection_sup} had child at module undefined at <0.3122.0> exit with reason econnrefused in context child_terminated
2018-04-03 07:56:56.140 [error] Supervisor {<0.3120.0>,amqp_connection_sup} had child at module undefined at <0.3122.0> exit with reason reached_max_restart_intensity in context shutdown
2018-04-03 07:56:56.140 [error] “Could not connect, scheduling reconnect.”, error: {{error,{badmatch,{error,{auth_failure_likely,{econnrefused,{gen_server,call,[<0.3122.0>,connect,infinity]}}}}},[{bunny_util,connect,1,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/gen_bunny/src/bunny_util.erl"},{line,191}]},{gen_bunny_mon,do_connect,3,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/gen_bunny/src/gen_bunny_mon.erl"},{line,192}]},{gen_bunny_mon,handle_info,2,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/gen_bunny/src/gen_bunny_mon.erl"},{line,134}]},{gen_server,try_dispatch,4,[{file,“gen_server.erl”},{line,615}]},{gen_server,handle_msg,5,[{file,“gen_server.erl”},{line,681}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,240}]}]},{connection_info,{network,{127,0,0,1},5672,{<<“actions”>>,<<“6d0516cd7492abac1fa77eb5437a32259dfe088f7829fff5b0f0f1446b9e95b2262c7617e4e1d974d78690466b0f2d1b2ac0”>>},<<"/analytics">>}}}
2018-04-03 07:56:56.140 [warning] Could not start the network driver: econnrefused
2018-04-03 07:56:56.140 [error] gen_server <0.3125.0> terminated with reason: econnrefused in amqp_network_connection:do_connect/1 line 337
2018-04-03 07:56:56.140 [error] CRASH REPORT Process <0.3125.0> with 0 neighbours exited with reason: econnrefused in gen_server:terminate/7 line 826
2018-04-03 07:56:56.141 [error] Supervisor {<0.3123.0>,amqp_connection_sup} had child at module undefined at <0.3125.0> exit with reason econnrefused in context child_terminated
2018-04-03 07:56:56.141 [error] Supervisor {<0.3123.0>,amqp_connection_sup} had child at module undefined at <0.3125.0> exit with reason reached_max_restart_intensity in context shutdown
2018-04-03 07:56:56.141 [error] “Could not connect, scheduling reconnect.”, error: {{error,{badmatch,{error,{auth_failure_likely,{econnrefused,{gen_server,call,[<0.3125.0>,connect,infinity]}}}}},[{bunny_util,connect,1,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/gen_bunny/src/bunny_util.erl"},{line,191}]},{gen_bunny_mon,do_connect,3,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/gen_bunny/src/gen_bunny_mon.erl"},{line,192}]},{gen_bunny_mon,handle_info,2,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/gen_bunny/src/gen_bunny_mon.erl"},{line,134}]},{gen_server,try_dispatch,4,[{file,“gen_server.erl”},{line,615}]},{gen_server,handle_msg,5,[{file,“gen_server.erl”},{line,681}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,240}]}]},{connection_info,{network,{127,0,0,1},5672,{<<“chef”>>,<<“1198289e794372673db73474942ece319d50d9bc15c5e1a455965c790473a95dcec5c604a3e2b22698ae0fafed9f9e028933”>>},<<"/chef">>}}}
2018-04-03 07:56:57.142 [warning] Could not start the network driver: econnrefused
2018-04-03 07:56:57.142 [error] gen_server <0.3128.0> terminated with reason: econnrefused in amqp_network_connection:do_connect/1 line 337
2018-04-03 07:56:57.142 [error] CRASH REPORT Process <0.3128.0> with 0 neighbours exited with reason: econnrefused in gen_server:terminate/7 line 826
2018-04-03 07:56:57.142 [error] Supervisor {<0.3126.0>,amqp_connection_sup} had child at module undefined at <0.3128.0> exit with reason econnrefused in context child_terminated
2018-04-03 07:56:57.142 [error] Supervisor {<0.3126.0>,amqp_connection_sup} had child at module undefined at <0.3128.0> exit with reason reached_max_restart_intensity in context shutdown
2018-04-03 07:56:57.143 [error] “Could not connect, scheduling reconnect.”, error: {{error,{badmatch,{error,{auth_failure_likely,{econnrefused,{gen_server,call,[<0.3128.0>,connect,infinity]}}}}},[{bunny_util,connect,1,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/gen_bunny/src/bunny_util.erl"},{line,191}]},{gen_bunny_mon,do_connect,3,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/gen_bunny/src/gen_bunny_mon.erl"},{line,192}]},{gen_bunny_mon,handle_info,2,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/gen_bunny/src/gen_bunny_mon.erl"},{line,134}]},{gen_server,try_dispatch,4,[{file,“gen_server.erl”},{line,615}]},{gen_server,handle_msg,5,[{file,“gen_server.erl”},{line,681}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,240}]}]},{connection_info,{network,{127,0,0,1},5672,{<<“actions”>>,<<“6d0516cd7492abac1fa77eb5437a32259dfe088f7829fff5b0f0f1446b9e95b2262c7617e4e1d974d78690466b0f2d1b2ac0”>>},<<"/analytics">>}}}
2018-04-03 07:56:57.143 [warning] Could not start the network driver: econnrefused
2018-04-03 07:56:57.143 [error] gen_server <0.3131.0> terminated with reason: econnrefused in amqp_network_connection:do_connect/1 line 337
2018-04-03 07:56:57.143 [error] CRASH REPORT Process <0.3131.0> with 0 neighbours exited with reason: econnrefused in gen_server:terminate/7 line 826
2018-04-03 07:56:57.143 [error] Supervisor {<0.3129.0>,amqp_connection_sup} had child at module undefined at <0.3131.0> exit with reason econnrefused in context child_terminated
2018-04-03 07:56:57.143 [error] Supervisor {<0.3129.0>,amqp_connection_sup} had child at module undefined at <0.3131.0> exit with reason reached_max_restart_intensity in context shutdown
2018-04-03 07:56:57.143 [error] “Could not connect, scheduling reconnect.”, error: {{error,{badmatch,{error,{auth_failure_likely,{econnrefused,{gen_server,call,[<0.3131.0>,connect,infinity]}}}}},[{bunny_util,connect,1,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/gen_bunny/src/bunny_util.erl"},{line,191}]},{gen_bunny_mon,do_connect,3,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/gen_bunny/src/gen_bunny_mon.erl"},{line,192}]},{gen_bunny_mon,handle_info,2,[{file,"/var/cache/omnibus/src/oc_erchef/_build/default/lib/gen_bunny/src/gen_bunny_mon.erl"},{line,134}]},{gen_server,try_dispatch,4,[{file,“gen_server.erl”},{line,615}]},{gen_server,handle_msg,5,[{file,“gen_server.erl”},{line,681}]},{proc_lib,init_p_do_apply,3,[{file,“proc_lib.erl”},{line,240}]}]},{connection_info,{network,{127,0,0,1},5672,{<<“chef”>>,<<“1198289e794372673db73474942ece319d50d9bc15c5e1a455965c790473a95dcec5c604a3e2b22698ae0fafed9f9e028933”>>},<<"/chef">>}}}
2018-04-03 07:56:58.143 [warning] Could not start the network driver: econnrefused


While searching for the solution, I came across two configuration variable rabbitmq[‘rabbit_mgmt_http_max_count’] with default value 100 and rabbitmq[‘rabbit_mgmt_timeout’] with default value 30000

But I am confused what value should I give to overwrite default so that Error would not come again?

It doesn't look like your client.rb contains a valid URL to your Chef Server, it is missing the hostname. Typically that file is C:/chef/client.rb on Windows.

chef server url is correct: while uploading the post, there it was not allowing a hyperlink in the post hence removed the URL:

The URL is like this: https://chefserver-hhw0403.useastad01.awssisw.com/organizations/harshal/nodes/1430403_VisServer

chef server url is correct: while uploading the post, there it was not allowing a hyperlink in the post hence removed the URL:

The URL is like this: https://chefserver-hhw0403.useastad01.awssisw.com/organizations/harshal/nodes/1430403_VisServer

So anywhere you see chef server url , It will be like above link.

Do you have other nodes successfully connecting to the Chef Server?

Can you run chef-server-ctl status and chef-server-ctl test successfully on the Chef Server?