You can run a Cloud Assistant command only when all requirements are met, regardless of whether you use the Elastic Compute Service (ECS) console or log on to an instance to run the command. To ensure that your intended operation is complete, we recommend that you check the command execution results and state. If executions fail, you can troubleshoot the issues based on common error messages.
Background information
When exceptions occur, different execution results and states are displayed for the command. These exceptions include a lack of dependencies, network exceptions, 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 troubleshoot the issues.
View execution results in the ECS console
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- Click the Command Execution Result tab to view execution results.
- If a command execution succeeds, you can view the command output in the execution results.
- Find a command task for which Successful is displayed in the Status column.
- In the Actions column, click View.
- In the Execution Details panel, click the Task Completed tab on the Instances tab to view execution results.
- If a command execution fails, find the error message in the execution results and troubleshoot the issue based on the error message.
- Find a command task for which Task Failed is displayed in the Status column.
- In the Actions column, click View.
- In the Execution Details panel, click the Task Failed tab on the Instances tab to view execution results.
For information about common error messages and the solutions to the errors, see the Command errors and solutions section of this topic.
- View the execution results of a scheduled task.
- Find a command task for which Waiting for execution is displayed in the Status column.
- In the Actions column, click View.
- In the Execution Details panel, view execution results on the Instances tab.
The following figure shows the execution results of a scheduled command task that is executed every 15 minutes.
- If a command execution succeeds, you can view the command output in the execution results.
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 an execution fails, you can check ErrorCode and ErrorInfo in the API responses 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 state of a command.
aliyun ecs DescribeInvocations --RegionId TheRegionId --InvokeId your-invoke-id
- Call the DescribeInvocationResults operation to query the execution results 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 | Recommended 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 as expected. |
InstanceRestarted | The error message returned because the instance was restarted while the task was being executed. | Do not restart the instance while the task is being executed. |
ClientNotRunning | The error message returned because the Cloud Assistant Agent is not running. | The Cloud Assistant Agent is stopped or not installed. Perform the following operations to install or start the Cloud Assistant Agent:
Note If the Cloud Assistant Agent is still not started after the preceding operations are performed, re-install the Cloud Assistant Agent. For more information, see Install the . |
ClientNetworkBlocked | The error message returned because the instance network environment is abnormal. |
Note
|
ClientNotResponse | The error message returned because the Cloud Assistant Agent does not respond. | Troubleshoot the issue based on logs of the Cloud Assistant Agent.
|
ClientNeedUpgrade | The error message returned because the Cloud Assistant Agent is not upgraded. | Enable auto-upgrade for the Cloud Assistant Agent or manually upgrade the Cloud Assistant Agent. For more information, see Upgrade or disable upgrades for the . |
ClientNotOnline | The error message returned because the Cloud Assistant Agent is not connected to the Cloud Assistant server. | Restart the Cloud Assistant Agent. For more information, see Start, stop, or uninstall the . If the Cloud Assistant Agent still cannot connect to the Cloud Assistant server after the client is restarted, submit a ticket. |
DeliveryTimeout | The error message returned because the Cloud Assistant server failed to send the command to the Cloud Assistant Agent. | The Cloud Assistant command is not sent to the instance. We recommend that you run the command again. If the issue 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 occurred while the command was running. | Check the error message in the ErrorInfo field. If you cannot identify the issue based on the error message, submit a ticket. |
ExitCodeNonzero | The error message returned because the command execution is complete but the exit code is not 0. | Check the command script and the command output. |