You can run a Cloud Assistant command as expected 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 operations are complete, we recommend that you check the command execution results and states. 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. The exceptions include missing 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
View in the ECS console
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
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 Execution Status column.
In the Actions column, click View.
On the Task Completed tab of the Instances tab, view the 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 Execution failed is displayed in the Execution Status column.
In the Actions column, click View.
On the Task Failed tab of the Instances tab, view the execution results.
For information about command errors and solutions, 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 Execution Status column.
In the Actions column, click View.
On the Instances tab, view the execution results.
The following figure shows the execution results of a scheduled command task that is executed every 15 minutes.
View through Alibaba Cloud CLI
For information about how to use Alibaba Cloud CLI, see Use Alibaba Cloud CLI to manage Alibaba Cloud resources.
Call the RunCommand or InvokeCommand operation to obtain the execution ID of a command from the
InvokeId
response parameter.Specify the
InvokeId
andRegionId
parameters to query the execution result of the command. In this example, the Japan (Tokyo) region is used. To obtain theRegionId
of other regions, see Regions and zones.
Call the DescribeInvocations operation to query the execution status of the command.
aliyun ecs DescribeInvocations --RegionId ap-northeast-1 --InvokeId t-sh054h*****
Call the DescribeInvocationResults operation to query the execution results of the command.
aliyun ecs DescribeInvocationResults --RegionId ap-northeast-1 --InvokeId t-sh054h*****
View through API
Call the RunCommand or InvokeCommand operation to obtain the execution ID of a command from the
InvokeId
response parameter.Call the DescribeInvocations or DescribeInvocationResults using the values of
InvokeId
andRegionId
to query the execution result of the command.
Command errors and solutions
Common errors
Error code | Error message | Recommended solution |
InstanceNotRunning | The instance was not in the Running state while the task was being created. | Check whether the instance is running as expected. |
InstanceRestarted | The instance was restarted while the task was being executed. | Do not restart the instance while the task is being executed. |
ClientNotRunning | Cloud Assistant Agent was not running. | Cloud Assistant Agent is stopped or not installed. Perform the following operations to start or install Cloud Assistant Agent:
Note If Cloud Assistant Agent still cannot be started after you perform the preceding operations, re-install Cloud Assistant Agent. For information about how to install Cloud Assistant Agent, see Install Cloud Assistant Agent. |
ClientNetworkBlocked | The instance network environment is abnormal. |
Note
|
SecurityGroupRuleDenied | Security group rules deny access to Cloud Assistant. |
|
ClientNotResponse | Cloud Assistant Agent does not respond. | Troubleshoot the issue based on logs of Cloud Assistant Agent.
|
ClientNeedUpgrade | Cloud Assistant Agent needs to be upgraded to support a specific feature. |
|
ClientNotOnline | Cloud Assistant Agent is not connected to the server. | Restart Cloud Assistant Agent. For more information, see Start, stop, or uninstall Cloud Assistant Agent. If Cloud Assistant Agent still cannot connect to the server after Cloud Assistant Agent is restarted, submit a ticket. |
DeliveryTimeout | The Cloud Assistant server failed to send the command to Cloud Assistant Agent. | The Cloud Assistant command was not sent to the instance. We recommend that you rerun the command. If the issue persists, submit a ticket. |
ExecutionTimeout | The command execution timed out. | Extend the command execution timeout period.
|
ExecutionException | 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 command execution is complete but the exit code is not 0. | Check the command script and the command output. |
ClientRestarted | The task was interrupted due to the restart of Cloud Assistant Agent. | Re-execute the task after Cloud Assistant Agent is restarted. You can view the running status of Cloud Assistant Agent on the ECS Cloud Assistant page in the ECS console or by calling the DescribeCloudAssistantStatus operation. |
InstanceReleased | The instance was released while the task was being executed. | The task cannot be executed because the instance has been released. |
DirectoryNotExists | The specified working directory does not exist on the instance. | Create the working directory on the instance and then rerun the command. |
Errors that occur when running a command
Error code | Error message | Recommended solution |
ClientIsUpgrading | Cloud Assistant Agent was being upgraded. | Rerun the command after the upgrade of Cloud Assistant Agent is completed. You can view the running status of Cloud Assistant Agent on the ECS Cloud Assistant page in the ECS console or by calling the DescribeCloudAssistantStatus operation. |
InstanceDeregistered | The selected managed instance was deregistered. | The command cannot be run because the managed instance has been deregistered. |
InvalidSystemBuiltInParameter | Built-in environment parameters are invalid. | The built-in environment parameters are not supported. For information about built-in environment parameters, see the |
DefaultWorkingDirectoryNotAvailable | The default working directory on the instance is unavailable. | Check the default working directory on the instance:
You can specify a working directory on the ECS Cloud Assistant page in the ECS console or specify the |
CommandNotApplicable | The command type is inapplicable to the specified instances. | Different instance operating systems support different command types:
|
InvalidCommandText | The command content is invalid. | Check the command content. The command content can be plaintext or Base64-encoded. |
CommandContentDecodeError | The command content failed to be decoded. | If the command content is Base64-encoded, check whether the Base64 encoding is correct. |
AccountNotExists | The specified user does not exist in the instance. | Create the user and then rerun the command.
You can specify a user on the ECS Cloud Assistant page in the ECS console or specify the |
Errors that occur when running a command on a schedule
Error code | Error message | Recommended solution |
BadCronExpression | The specified cron expression is invalid. | Modify the cron expression. For more information, see Cron expressions. |
CronExpressionExpired | The scheduled task failed to be executed because the cron expression expired. | Specify a valid cron expression. |
InvalidGMTOffsetForTimezone | The format of the GMT offset time zone that is specified in the cron expression is invalid. | Check the format of the GMT offset time zone. Supported GMT range: GMT-12:59 to GMT+14:59. The minute field can be set to a value from 0 to 59. The hour field does not support leading zeros. |
InvalidGMTOffsetHourForTimezone | The GMT offset hour value specified in the cron expression is invalid. | Check the GMT offset hour value. Supported GMT range: GMT-12:59 to GMT+14:59. The hour field does not support leading zeros. |
InvalidGMTOffsetMinuteForTimezone | The GMT offset minute value specified in the cron expression is invalid. | Check the GMT offset minute value. The minute field can be set to a value from 0 to 59. |
TimezoneInformationCorrupt | Cloud Assistant Agent cannot parse the time zone information. The time zone file may be corrupt. |
Note If the required time zone file does not exist, create the time zone file and then rerun the command. |
InvalidRateExpression | The rate expression is invalid. | Modify the rate expression. For more information, see Cron expressions. |
RateFrequencyTooLarge | The scheduled execution frequency specified in the rate expression is higher than expected. | Set the scheduled execution frequency to up to seven days. |
InvalidAtExpression | The at expression is invalid. | Modify the at expression. For more information, see Cron expressions. |
AtExpressionExpired | The scheduled task failed to be executed because the at expression expired. | Specify a valid at expression. |
Errors that occur when running a command in a container
Error code | Error message | Recommended solution |
InvalidContainerName | The container name is invalid. | The container name can be up to 255 characters in length. The container name can contain only letters, digits, periods (.), underscores (_), and hyphens (-). The container name must start with a letter or digit. |
UnsupportedContainerRuntime | The container runtime contained in the container ID is not supported. | Cloud Assistant can be used to run commands only in containers that are managed by Kubernetes based on the Container Runtime Interface (CRI) and run within the Docker, containerd, or CRI-O container runtime. |
InvalidContainerId | The container ID is invalid. | Only 64-bit hexadecimal strings are supported. Container IDs that are prefixed with |
ContainerConnectFailed | The container cannot be connected to. | Check whether the container is running. You can run the
|
ContainerStateAbnormal | The container status is not as expected. | Check the status of the container and make sure that the container is running. You can run the |
ContainerNotFound | The container does not exist. | Check whether the ID or name of the container is valid by using one of the following methods: Method 1: Run the kubectl command
Method 2: Use Cloud Assistant Agent
For more information, see Use Cloud Assistant to run commands in containers. |
ContainerNameDuplicated | Multiple containers on the node have the same name, and the system cannot identify the correct container in which to run the command. |
|
ContainerNameAndIdNotMatch | The container ID and the container name do not match. | The specified container ID does not correspond to the specified container name. Check whether the container ID and name are correct. |
Errors that occur when running a command on a Windows instance as a non-default user (non-System user)
The following errors may occur when you run a command on a Windows instance as a non-default user (non-System user).
Error code | Error message | Recommended solution |
UserOrPasswordInvalid | The username or password is incorrect. | Check the username or password. For information about usernames and passwords, see Encryption parameters and Run Cloud Assistant commands as a regular user. |
QueryParameterStoreFailed | Parameters cannot be retrieved from CloudOps Orchestration Service (OOS) Parameter Store. | Check whether the corresponding password information exists in CloudOps Orchestration Service Parameter Store. For more information, see Encrypted parameters. |
InstanceRoleInvalid | The required instance roles are not attached to the instance. | Call the DescribeInstanceRamRole operation to check whether the required Resource Access Management (RAM) roles are attached to the instance. |
Errors that occur when stopping a command
Error code | Error message | Recommended solution |
TerminationException | The task failed to be stopped. | Check the error message in the ErrorInfo field to troubleshoot the issue or try to stop the task again. |
Errors that occur when sending a file
Error code | Error message | Recommended solution |
FileAlreadyExists | A file with the same name already exists in the destination path. | To resolve the error, use one of the following solutions:
Change the destination path or the name of the file that you want to send. |
FileNameInvalid | The file name is invalid. | Change the file name to comply with the file naming conventions of Windows or Linux operating systems by using one of the following methods:
|
FilePathInvalid | The destination path is invalid. | Change the destination path to comply with the path conventions of Windows or Linux operating systems by using one of the following methods:
|
FileAuthorityInvalid | The file permissions are invalid. | Modify the file permissions. File permissions take effect only on Linux instances. You can configure the file permissions in the same way as you configure the chmod command. |
UserGroupNotExists | The specified user group does not exist in the instance. | By default, the user group is root. Create the specified user group in the instance. Sample command: |