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
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 normally. |
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:
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. |
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.
|
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 Upgrades or disable upgrades 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.
|
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. |