When entering the 'esxcli' command, IO error: [Errno 111] Connection refused
search cancel

When entering the 'esxcli' command, IO error: [Errno 111] Connection refused

book

Article ID: 321875

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • "esxcli" commands failed with error "IO error: [Errno 111] Connection refused".



Environment

VMware vSphere Esxi 8.x

VMware vSphere Esxi 7.x

VMware vSphere Esxi 6.5

VMware vSphere Esxi 6.7

Cause

rhttpproxy service doesn't working on ESXi host.

Resolution

From ESXi

1. Check the rhttpproxy service status :
#/etc/init.d/rhttpproxy status

2. If rhttpproxy service is stopped, start the rhttpproxy service :
#/etc/init.d/rhttpproxy start

3. if starting the service fails, check the rhttpproxy.log 

4. Example error message :
"no proxy config file specified. stopping rhttpproxy"

5. Open the rhttpproxy configuration file 
#vi /etc/vmware/rhttpproxy/config.xml

6. Change the http or https port number to the correct value.

<proxy>
<!-- default location of the proxy config file -->
<endpoints>/etc/vmware/rhttpproxy/endpoints.conf</endpoints>
<!-- HTTP port to be used by the reverse proxy -->
<httpPort>50080</httpPort>                              <<<<< Change Port number
<!-- HTTPS port to be used by the reverse proxy -->
<httpsPort>443</httpsPort>
</proxy>


Workaround:
Identify the incorrect location in the 'config.xml' file and make the necessary corrections and restart the services.

Example :
1. Identify the incorrect value in the 'config.xml' file and correct it :

From :
<proxy>
<!-- default location of the proxy config file -->
<endpoints>/etc/vmware/rhttpproxy/endpoints.conf</endpoints>
<!-- HTTP port to be used by the reverse proxy -->
<httpPort>50080</httpPort>                              <<<<<
<!-- HTTPS port to be used by the reverse proxy -->
<httpsPort>443</httpsPort>
</proxy>



To :
<proxy>
<!-- default location of the proxy config file -->
<endpoints>/etc/vmware/rhttpproxy/endpoints.conf</endpoints>
<!-- HTTP port to be used by the reverse proxy -->
<httpPort>80</httpPort>                              <<<<<
<!-- HTTPS port to be used by the reverse proxy -->
<httpsPort>443</httpsPort>
</proxy>


2. Restart the service :
#services.sh restart

Fix 2:
 
If the values appear correct, replace 'etc/vmware/rhttpproxy/config.xml' on the problematic Host with the same file from a working host with the same build.

Additional Information

Impact/Risks:
Cannot execute esxcli commands on ESXi host.