What Are the Troubleshooting Methods for Host and Proxy Connectivity Verification Failures
Host connectivity verification failures can be handled by the following host types:
Linux Hosts
- Verify whether the IP address, username, and password are correct.
- Check whether the port enabled on the target host is an SSH port (port 22 by default).
How to enable the port:
- Enable the firewall.
systemctl start firewalld.service systemctl stop firewalld.service #Disable the firewall.
- Enable the port.
firewall-cmd --zone=public --add-port=22/tcp --permanent
--zone #Application zone.
--add-port=22/tcp #Port, in the format of port number/communication protocol.
--permanent #Takes effect permanently. If this parameter does not exist, it becomes invalid after the system is restarted.
- Restart the firewall.
firewall-cmd --reload
- Enable the firewall.
- Check the network status.
Run the tcpdump command to check the network connection.
tcpdump -n "tcp port 22 and host xxx.xxx.xxx.xxx" #This command is executed on the local PC to check whether the execution host is connected. xxx.xxx.xxx.xxx indicates the public IP address of CodeArts Deploy.
#Or
tcpdump -n "tcp port 22" | grep -v "xxx.xxx.xxx.xxx" #This command is executed on the local PC to check whether the host is connected. xxx.xxx.xxx.xxx indicates the IP address of the target host.
If no command output is displayed, the network connection is normal.
The public IP addresses of CodeArts Deploy are as follows:
Singapore: 114.119.185.21 Sao Paulo: 159.138.214.24 Mexico: 122.8.183.54 110.238.80.148 Santiago: 119.8.154.190 Türkiye: 101.44.36.238 Riyadh: 101.46.48.174 Cairo: 101.46.64.14 Johannesburg: 159.138.166.36
- Choose Settings > General > Basic Resources from the main menu. Click the cluster name to go to its details page. In the host list, verify the target host connectivity and check whether the server has established SSH connections to this host. The following information indicates that the server has established SSH connections to this host.
Cause analysis:
- SSH connections exist between the server and the target host.
The target host is not configured properly or tcpdump is not installed.
Perform the following operations to check the host configurations:
- For details, see Configuring the IP Address Blacklist and Whitelist in the User Guide.
- Run the following command to check whether a firewall is configured (iptables is used as an example):
iptables -L
- No SSH connections exist between the server and the target host.
The target host is unreachable because the network may have access restrictions.
Check whether the source and destination IP addresses are restricted by the firewall, and check the SSH protocol configurations.
- SSH connections exist between the server and the target host.
- Check permissions on the SSH key file.
Log in to the host as the root user and run the following commands to check permissions on the SSH key file:
cd /root/.ssh
ll
Check whether the file permission is rw.
If the file permission is incorrect, run the following command to modify it:
chmod 600 File name.
- Check the operations on the ${HOME} directory. If the user who carries the host connectivity verification fails to operate the ${HOME} directory, do as follows:
- Check whether the disk where the ${HOME} directory of the host is located is full.
- Run the df -h command to check whether the disk where the ${HOME} directory is located is full.
- Run the ll -ld ${HOME} and lsattr -d ${HOME} commands to check the permission setting and hidden attributes of the ${HOME} directory of the user.
- Check whether the user has the read and write permissions on the ${HOME} directory.
Run the chmod and chattr commands to grant the user the permissions required to read from and write into the ${HOME} directory.
- Check whether the user's default shell is set to nologin mode.
- Run the grep username /etc/passwd command. Replace "username" with the actual user name to be checked.
- In the file, if /usr/sbin/nologin or /sbin/nologin is displayed in the shell column of a user, the user is set to the nologin mode.
- If the user is in nologin mode, run the sudo usermod -s /bin/bash username command to allow the user to log in. Replace "username" with the actual user name.
- Check whether the disk where the ${HOME} directory of the host is located is full.
- If the connectivity test of a proxy associated with a host fails or an error message indicating that the host connection timed out, locate the fault by performing the following operations.
- Test the connectivity of the proxy host.
- Run the following command to check whether AllowTcpForwarding has been enabled for SSH on the proxy host:
grep "AllowTcpForwarding" /etc/ssh/sshd_config
If the value is no, set it to yes and run the following command to restart the sshd service:
service sshd restart
Self-Hosted Resource Pool
- Check whether the agent pool of the host cluster to which the host belongs is available.
- Click the name of the host cluster. On the host cluster details page that is displayed, click Manage Resource Pools.
- Go to the Agent Pool page and check the status.
- If the status is Offline, delete the agent and reinstall it.
- If the status is Disabled, enable the agent in the Operation column and verify the connectivity again.
- If the status is Offline, delete the agent and reinstall it.
- Click the name of the host cluster. On the host cluster details page that is displayed, click Manage Resource Pools.
- Click Connectivity Verification Result. If a script execution error is displayed, perform the following operations to troubleshoot it. (If no script execution error is displayed, skip this step.)
Cause analysis:
The self-hosted resource pool needs to use Docker to pull images. The script execution error occurs because Docker is not installed in the self-hosted resource pool or cannot be used properly. You can perform the following operations to troubleshoot the error:
Troubleshooting method
- Run the following command to check whether Docker is installed:
docker --version
If the version number is displayed in the command output, Docker has been installed.
If no version number is displayed in the command output, Docker is not installed.
If Docker is not installed, install it by referring to Installing/Uninstalling Docker, and then perform the following operations to verify the connectivity:- Log in to CodeArts Deploy, and click the target application name to access the target project.
- Choose Settings > General > Basic Resources. The Host Clusters page is displayed by default.
- Click the name of the target cluster. On the cluster details page that is displayed, click Proxy Hosts or Target Host.
- Click in the same row as the host, and modify the host information to verify the host again in the dialog box displayed.
- Run the following command to check whether Docker can be used properly:
docker images
If the preceding information is displayed, Docker can be used properly. Otherwise, you need to uninstall Docker, and reinstall it by referring to Installing/Uninstalling Docker.
- Run the following command to check whether Docker is installed:
Windows Hosts
- Verify whether the IP address, username, and password are correct.
- Configure a proxy host.For details, see Configuring a Proxy Host in the User Guide..
- Enable the WinRM function. For details, see Configuring a Target Host in the User Guide.
- Run the following command on PowerShell to check whether the WinRM function has been enabled:
winrm e winrm/config/listener
- Check whether the Windows firewall allows external hosts to access the WinRM service.
Cloud Hosts
Locate the fault in the same way as you would do for a Windows or Linux host. Configure the security group for the cloud host to allow access from the public IP addresses of CodeArts Deploy. (For details, see Prerequisites for Creating a Host Cluster in the User Guide.)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot