Automation Host fails to start when IP address changes

Description

When you register the Automation Host with an IP address that changes over time, such as after the Automation Host machine restarted and was allocated a new IP address, the Automation Host fails to start.

When the Automation Host fails to start due to the host's IP address being changed, it will log an error:

<time stamp> ERROR [main] MainServer:85 - ==================== BIND EXCEPTION ====================
<time stamp> ERROR [main] MainServer:86 - Please check your host/IP configuration
<time stamp> ERROR [main] MainServer:87 - ========================================================

Cause

When the Automation Host is starting, it tries to bind to the host's IP address, which is stored in agent.config file from the time you successfully register the agent host, so that you can access to the agent host UI with the URL: http://<IP address>:<port>. The binding fails if the IP address in the agent.config file is different from the actual IP address of the host machine.

Solutions

If you encounter this error, change the IP address of the Automation Host. You can change the IP address using a line command or using the qTest Automation Host UI.

Allocate a static IP address to the Automation Host (preferred solution)

Allocate a static IP address to the Automation Host so it does not change over time, and use this IP address when registering the agent host.

Change the IP address using a line command

  • On Windows:

    \path\to\agentctl-[version]> agentctl.bat config -Phost=<New IP Address>
  • On Linux or Mac:

    /path/to/agentctl-[version]$ ./agentctl config -Phost=<New IP Address>

After that, you can start the Automation Host with below command:

  • On Windows:

    \path\to\agentctl-[version]> agentctl.bat start

  • On Linux or Mac:

    /path/to/agentctl-[version]$ ./agentctl start

Change the IP address using the qTest Automation Host UI

To manually update the IP address for qTest Automation Host, access qTest Automation Host on a web browser. The IP Address field is located in the Information section. Click the Edit icon to edit the IP address. Once you enter the new address, click the green check mark icon to save the address.

For information on accessing the qTest Automation Host UI, refer to Access qTest Automation Host for Windows, Access qTest Automation Host for Mac, or Access qTest Automation Host for Linux.

Notes

This issue can be avoided if you register the Automation Host with the -Phost parameter set to localhost, like below:

  • On Windows:

    \path\to\agentctl-[version]> agentctl.bat config -Phost="localhost"
  • On Linux or Mac:

    /path/to/agentctl-[version]$ ./agentctl config -Phost="localhost"

You can then access the host from your browser using this URL: http://localhost:<port> (if you did not specify a port when registering the automation host, the default port number is 6789) at any time without worrying about the IP address.

However, a drawback for this approach is that since the Automation Host does not bind to the actual IP address, it cannot be accessed from another machine or computer in your network using an URL like this http://<IP address>:<port>