Executing a Cloud Assistant command is similar to running a command after logging in to an instance. A command succeeds only if all prerequisites are met. After running a command, check its execution result and status to verify that the operation completed successfully. If the execution fails, you can use the error message to diagnose and resolve the issue.
Background information
A command can have different execution statuses and results due to various issues, such as missing dependencies on an ECS instance, network anomalies, command syntax errors, script debugging failures, or an abnormal instance state. You can view the error information in the execution results on the console or using an API to diagnose and resolve the issue.
View execution results
Console
In the top navigation bar, select the region and resource group of the resource that you want to manage.
On the Command Execution Result tab, view the command execution results.
If the command was successful, view the output in the execution results.
Find the execution result with a Successful status.
In the Actions column, click View.
On the Instances page, go to the Task Completed tab to view the result.

If the command failed, view the error message in the execution results to diagnose and resolve the issue.
Find the command execution result with an Execution Status of Execution failed.
In the Actions column, click View.
On the Execution failed tab of the Instances page, view the error message.
For common error messages and recommended solutions, see Common execution failure errors and recommended solutions.

View the output of a scheduled task.
Find the command execution result with an Execution Status of Scheduled.
In the Actions column, click View.
On the Instances page, view the command execution result.
CLI
For instructions on how to use Alibaba Cloud CLI, see Use Alibaba Cloud CLI to manage Alibaba Cloud resources.
Obtain the command execution ID (InvokeId) from the response of the RunCommand or InvokeCommand operation.
Enter the InvokeId and the region ID (RegionId) of the ECS instance to query the command execution result. The following example uses the China (Shanghai) region. For the IDs of other regions, see Regions and zones.
Call the
DescribeInvocationsoperation to view the execution status of the command.aliyun ecs DescribeInvocations --RegionId cn-shanghai --InvokeId t-sh054h*****Call the
DescribeInvocationResultsoperation to view the execution result of the command.aliyun ecs DescribeInvocationResults --RegionId cn-shanghai --InvokeId t-sh054h******
API
Obtain the command execution ID (InvokeId) from the response of the RunCommand or InvokeCommand operation.
In the DescribeInvocations or DescribeInvocationResults operation, enter the InvokeId and the region ID of the ECS instance to query the command execution result.
Execution failure errors and recommended solutions
Common errors
Error code | Error message | Recommended solution |
InstanceNotRunning | The instance was not in the running state when the task was created. | Make sure that the instance is running. |
InstanceRestarted | The instance was restarted during task execution. | Do not restart the instance during task execution. |
ClientNotRunning | The Cloud Assistant Agent is not running. | The Cloud Assistant Agent is stopped or not installed. Start or install the Cloud Assistant Agent.
Note If the Cloud Assistant Agent still fails to start, you can reinstall it. For more information, see Install the Cloud Assistant Agent. |
ClientNetworkBlocked | The network environment of the instance is abnormal. |
Note
|
SecurityGroupRuleDenied | A security group rule denies access to the Cloud Assistant service. |
|
ClientNotResponse | The Cloud Assistant Agent did not respond. | Check the logs of the Cloud Assistant Agent.
|
ClientNeedUpgrade | The Cloud Assistant Agent needs to be upgraded to support the specified feature. |
|
ClientNotOnline | The Cloud Assistant Agent is not connected to the server. | Restart the Cloud Assistant Agent. For more information, see Stop and uninstall the Cloud Assistant Agent. |
DeliveryTimeout | The Cloud Assistant server failed to send the task to the Cloud Assistant Agent. | The Cloud Assistant command has not been sent to the instance. Run the command again. |
ExecutionTimeout | The command execution timed out. | Extend the command execution timeout period as needed.
|
ExecutionException | An exception occurred during command execution. | View the detailed error message in the ErrorInfo field. |
ExitCodeNonzero | The command finished executing, but the exit code of the command process is not 0. | Check the script content and the output of the command. |
ClientRestarted | The task was interrupted because the Cloud Assistant Agent was restarted. | Run the command again after the restart is complete. You can view the running status of the Cloud Assistant Agent in the Cloud Assistant console or by calling the DescribeCloudAssistantStatus operation. |
InstanceReleased | The instance was released during command execution. | The command cannot be executed because the instance was released during execution. |
DirectoryNotExists | The specified working directory does not exist in the instance. | Create the specified working directory in the instance, and then run the command. |
Running commands
Error code | Error message | Recommended solution |
ClientIsUpgrading | The Cloud Assistant Agent is being upgraded. | Run the command again after the upgrade is complete. You can view the running status of the Cloud Assistant Agent in the Cloud Assistant console or by calling the DescribeCloudAssistantStatus operation. |
InstanceDeregistered | The managed instance has been unregistered. | The command cannot be executed because the managed instance was already unregistered. |
InvalidSystemBuiltInParameter | The built-in environment parameter is invalid. | The specified built-in environment parameter is not supported. For more information about built-in environment parameters, see the description of the |
DefaultWorkingDirectoryNotAvailable | The default working directory in the instance is not available. | Check the default working directory in the instance:
You can also specify a working directory when you run the command. You can specify the directory in the Cloud Assistant console or using the |
CommandNotApplicable | The command type is not applicable to the specified instance. | The operating systems supported by each command type are as follows:
|
InvalidCommandText | The command content is invalid. | Check the command content. The content can be in plaintext or Base64-encoded. |
CommandContentDecodeError | Failed to decode the command content. | If the command content is Base64-encoded, check whether the encoding is correct. |
AccountNotExists | The specified user does not exist in the instance. | Create the specified user in the instance before you run the command.
You can also specify another existing user to run the command. You can specify the user in the Cloud Assistant console or using the |
Running scheduled commands
Error code | Error message | Recommended solution |
BadCronExpression | The specified cron expression is invalid. | Modify the cron expression. For more information, see Clock-based scheduling. |
CronExpressionExpired | The cron expression has expired. The corresponding scheduled task will not be executed. | Do not specify an expired cron expression when you run the command. |
InvalidGMTOffsetForTimezone | The format of the GMT offset time zone specified in the cron expression is invalid. | Check the format of the GMT offset time zone. The supported GMT range is GMT-12:59 to GMT+14:59. The minute can be any value from 0 to 59. Leading zeros are not supported for the hour. |
InvalidGMTOffsetHourForTimezone | The GMT offset hour value specified in the cron expression is invalid. | Check the hour value of the GMT offset time zone. The supported GMT range is GMT-12:59 to GMT+14:59. Leading zeros are not supported for the hour. |
InvalidGMTOffsetMinuteForTimezone | The GMT offset minute value specified in the cron expression is invalid. | Check the minute value of the GMT offset time zone. The minute can be any value from 0 to 59. |
TimezoneInformationCorrupt | The Cloud Assistant Agent cannot parse the time zone information because the time zone file is corrupted or for other reasons. |
Note If the corresponding time zone file does not exist, create the correct time zone file before you run the command. |
InvalidRateExpression | The Rate expression is invalid. | Modify the Rate expression. For more information, see Fixed interval execution. |
RateFrequencyTooLarge | The scheduled execution frequency specified in the Rate expression is too high. | The scheduled execution frequency cannot be longer than 7 days. |
InvalidAtExpression | The timestamp (At expression) is invalid. | Modify the timestamp. For more information, see Run a command only once at a specified time. |
AtExpressionExpired | The timestamp (At expression) has expired. The corresponding scheduled task will not be executed. | Do not specify an expired timestamp when you run the command. |
Running commands in containers
Error code | Error message | Recommended solution |
InvalidContainerName | The container name is invalid. | The container name must start with a digit or a letter. It can contain only digits, uppercase and lowercase letters, periods (.), underscores (_), and hyphens (-). The name cannot exceed 255 characters in length. |
UnsupportedContainerRuntime | The container runtime included in the container ID is not supported. | Only containers that are managed by Kubernetes through the Container Runtime Interface (CRI) and run on docker, containerd, or cri-o container runtimes are supported. |
InvalidContainerId | The container ID is invalid. | Only 64-bit hexadecimal strings are supported. You can add the |
ContainerConnectFailed | Cannot connect to the container. | Check whether the container is running. You can use
|
ContainerStateAbnormal | The container status is abnormal. | Check the container status. You can run commands using Cloud Assistant only on running containers. You can use |
ContainerNotFound | The container does not exist. | Check whether a container with the specified name or ID exists. Method 1: Use kubectl Method 2: Use the Cloud Assistant Agent For more information, see Use Cloud Assistant to run commands in a container. |
ContainerNameDuplicated | The node has containers with the same name. The container on which to run the command cannot be identified. |
|
ContainerNameAndIdNotMatch | The container ID and container name do not match. | The specified container ID and container name do not correspond to the same container. Check whether the container ID and container name are correct. |
Running commands as a non-default user (System) on a Windows instance
The following issues may occur when you run commands as a non-default user (not System) on a Windows instance.
Error code | Error message | Recommended solution |
UserOrPasswordInvalid | The username or password is incorrect. | The username or the password for the user is incorrect. For more information about usernames and passwords, see Encrypted parameters and Set a regular user to run Cloud Assistant commands. |
QueryParameterStoreFailed | Failed to pull parameters from Parameter Store. | Check whether the corresponding password information exists in the parameter store of CloudOps Orchestration Service. For more information, see Encrypted parameters. |
InstanceRoleInvalid | The instance role is not granted to the instance. | Call the DescribeInstanceRamRole operation to check whether the corresponding RAM role exists on the instance. |
Stopping commands
Error code | Error message | Recommended solution |
TerminationException | Failed to stop the task. | View the detailed error message in the ErrorInfo field, or retry stopping the task. |
Sending files
Error code | Error message | Recommended solution |
FileAlreadyExists | A file with the same name exists in the same path. | You can resolve this issue in one of the following ways:
Change the destination path or the name of the file that you want to send. |
FileNameInvalid | The file name is invalid. | Adjust the file name to comply with the file naming conventions of the Windows or Linux operating system.
|
FilePathInvalid | The file path is invalid. | Adjust the file path to comply with the file path conventions of the Windows or Linux operating system.
|
FileAuthorityInvalid | The file permissions are invalid. | Adjust the file permissions. This setting takes effect only on Linux instances and is configured in the same way as the chmod command. |
UserGroupNotExists | The specified user group does not exist in the instance. | The default user group is root. Create the corresponding user group in the Linux instance. Example command: |
FAQ
Q: Why do I see garbled characters when I use Cloud Assistant to run a PowerShell script on a Windows server and the output contains Chinese characters?
A: This occurs because the PowerShell environment used by Cloud Assistant does not default to UTF-8. As a result, non-ASCII characters, such as Chinese, are misinterpreted and appear garbled.
There are two solutions:
Modify the script content: At the beginning of your script, add code to force UTF-8 output encoding.
In Windows Server 2022 environments, Cloud Assistant handles Chinese character encoding correctly by default, so you do not need to set the UTF-8 encoding.
Add the following code at the beginning of your PowerShell script:
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 Write-Output "Testing Chinese output..."Modify the bootstrap program: In the advanced options of Cloud Assistant, modify the underlying command that runs the script to automatically set the encoding before execution.
Enter the following code in the Luncher field for the Cloud Assistant command:
powershell -command [Console]::OutputEncoding=[System.Text.Encoding]::UTF8;{{ACS::ScriptFileName|Ext(.ps1)}};exit $LastExitCodeWith this setting, UTF-8 encoding is automatically applied to all PowerShell scripts executed in this task, eliminating the need to modify individual script files.