You can run a Cloud Assistant command only when all requirements are met, regardless of whether you run the command in the Elastic Compute Service (ECS) console or after you log on to an instance. To ensure that the intended operation is complete, we recommend that you view the command execution result and status after you run a command. If the execution fails, you can identify and fix the problems based on common error messages.

Background information

When exceptions occur, different execution results and status are displayed for the command. These exceptions include the lack of dependencies, network disruptions, command semantic errors, command debugging errors, and abnormal instance status. You can use the ECS console or call an API operation to view the error messages in the execution results, and diagnose and fix the problems.

View execution results in the ECS console

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Maintenance & Monitoring > ECS Cloud Assistant.
  3. In the top navigation bar, select a region.
  4. Click the Command Execution Result tab to view the execution results.
    • If the command execution succeeds, you can view the output in the execution results.
      1. Find a record for which Successful is displayed in the Status column.
      2. In the Actions column, click View.
      3. In the Task Execution Results panel, view the Task Output section.
    • If the command execution fails, view the error messages in the execution results, and diagnose and fix the problems based on the error messages.
      1. Find a task for which Task Failed is displayed in the Status column.
      2. In the Actions column, click View.
      3. In the Task Execution Results panel, view the error messages of the task.

        For information about common error messages and the solutions to the errors, see the Command errors and solutions section.

        Error message

View execution results by using Alibaba Cloud CLI

If you use Cloud Assistant by means of Alibaba Cloud CLI or OpenAPI Explorer, you can call the DescribeInvocations or DescribeInvocationResults operation to query the execution results of Cloud Assistant commands. If the execution fails, you can refer to the ErrorCode and ErrorInfo fields for error details.

In the following examples, the DescribeInvocations and DescribeInvocationResults operations are used to describe how to use Alibaba Cloud CLI to query execution results.

  • Call the DescribeInvocations operation to query the execution status of a command.
    aliyun ecs DescribeInvocations --RegionId TheRegionId --InvokeId your-invoke-id
  • Call the DescribeInvocationResults operation to query the execution result of a command on a specific instance.
    aliyun ecs DescribeInvocationResults --RegionId TheRegionId --InstanceId i-bp1g6zv0ce8og******p --InvokeId your-invoke-id

Command errors and solutions

Error code Error message Solution
InstanceNotRunning The error message returned because the instance is not in the Running state while the task is being created. Check whether the instance is running properly.
InstanceRestarted The error message returned because the instance is restarted while the task is being executed. Do not restart the instance while the task is being executed.
ClientNotRunning The error message returned because the Cloud Assistant client is not running. The Cloud Assistant client is stopped or not installed. Perform the following operations to install or start the Cloud Assistant client:
  1. Check whether the process of the Cloud Assistant client runs normally.
    • For Linux instances, run the following command:
      ps -ef |grep aliyun-service
    • For Windows instances, check whether the aliyun_assist_service process exists in the Task Manager.
  2. If the process does not exist, start the Cloud Assistant client.
    • For Linux instances, run one of the following commands:
      #If the Linux instances support systemctl, run the following command:
      systemctl start aliyun.service
      
      #If the Linux instances do not support systemctl, run the following command:
      /etc/init.d/aliyun-service start
    • For Windows instances, start AliyunService by using the Server Manager.
Note If the Cloud Assistant client still cannot be started after the preceding operations are performed, re-install the Cloud Assistant client. For more information, see Install the Cloud Assistant client.
ClientNetworkBlocked The error message returned because the instance network environment is abnormal.
  1. Run the following command to check the network connectivity. If the network is normal, the instance ID is returned.
    curl https://{region-id}.axt.aliyun.com/luban/api/instance/instance-id
  2. If the instance ID is not returned, check the instance security groups, firewall, DNS configurations, and route table to troubleshoot the problem. You must enable TCP port 443, TCP port 80, and UDP port 53 in the outbound direction to ensure that Cloud Assistant can access the following URLs:
    • https://{region-id}.axt.aliyun.com:443/
    • http://100.100.100.200:80/
    • http://aliyun-client-assist-{region-id}.oss-{region-id}-internal.aliyuncs.com
Note {region-id} specifies the region ID of the instance. For example, if the instance resides in the China (Hangzhou) region, set this parameter to cn-hangzhou.
ClientNotResponse The error message returned because the Cloud Assistant client does not respond. Troubleshoot the problem based on logs of the Cloud Assistant client.
  1. Open the log file of the Cloud Assistant client. The following section describes the default paths of the log file:
    • Linux instances: /usr/local/share/aliyun-assist/<Version number of Cloud Assistant>/log/aliyun_assist_main.log
    • Windows instances: C:\ProgramData\aliyun\assist\<Version number of Cloud Assistant>\log\aliyun_assist_main.log
  2. Query whether the task ID exists in the log file.
    • If the task ID exists, check whether exceptions exist in the context. For example, you can check whether the command execution is complete and reported.
    • If the task ID does not exist, run the Cloud Assistant command again. If the execution fails again, we recommend that you restart the Cloud Assistant client.
      • For Linux instances, run one of the following commands:
        #If the Linux instances support systemctl, run the following command:
        systemctl restart aliyun.service
        
        #If the Linux instances do not support systemctl, run the following command:
        /etc/init.d/aliyun-service restart
      • For Windows instances, start AliyunService by using the Server Manager.
ClientNeedUpgrade The error message returned because the Cloud Assistant client is not upgraded. Enable auto upgrade for the Cloud Assistant client or manually upgrade the Cloud Assistant client. For more information, see Update or disable updates for the Cloud Assistant client.
ClientNotOnline The error message returned because the Cloud Assistant client is not connected to the Cloud Assistant server. Restart the Cloud Assistant client. For more information, see Start or stop the Cloud Assistant client. If the Cloud Assistant client still cannot connect to the Cloud Assistant server after it is restarted, submit a ticket.
DeliveryTimeout The error message returned because the Cloud Assistant server failed to send the command to the Cloud Assistant client. If the Cloud Assistant command is not sent to the instance, we recommend that you run the command again. If the problem persists, submit a ticket.
ExecutionTimeout The error message returned because the command execution has timed out. Extend the command execution timeout period.
  • If you create and run a command in the ECS console, the Timeout Period parameter is set to 60 seconds by default. Specify an appropriate value.
  • If you run a command by calling the RunCommand operation, the Timeout parameter is set to 60 seconds by default. Specify an appropriate value.
  • If you create a command by calling the CreateCommand operation and run the command by calling the InvokeCommand operation, the Timeout parameter is set to 60 seconds by default when you create the command. Specify an appropriate value when you create the command, or call the ModifyCommand operation to change the value to an appropriate value after the command is created.
ExecutionException The error message returned because an exception has occurred in command execution. Check the error message in the ErrorInfo field. If you cannot identify the problem based on the error message, submit a ticket.
ExitCodeNonzero The error message returned because the exit code of the execution is not 0 when the command is executed. Check the command script and the command output.