Running a Cloud Assistant command in the ECS console is the same as running a command after you log in to an instance. A command succeeds only if it meets all required conditions. After you run a command, check its execution result and status to ensure the operation has completed. If an execution fails, use the error message to troubleshoot the issue.
Background
A command's execution status and results can vary due to issues like missing dependencies on an ECS instance, network anomalies, command syntax errors, script execution errors, or an abnormal instance state. To diagnose and resolve these issues, review the error information in the execution results through the console or by using an API.
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 execution results.
-
If a command succeeds, view its output in the execution result.
-
Find the command execution result with an Execution Status of Successful.
-
In the Actions column, click View.
-
On the Execution complete tab of the Instances page, view the command execution result.

-
-
If a command fails, view the error message in the execution result to troubleshoot the issue.
-
Find the command execution result with an Execution Status of Failed.
-
In the Actions column, click View.
-
On the Failed tab of the Instances page, view the error message.
For common error messages and recommended solutions, see Common errors and solutions for execution failures.

-
-
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 Manage Alibaba Cloud resources using Alibaba Cloud CLI.
-
Obtain the command execution ID (InvokeId) from the response from RunCommand or InvokeCommand.
-
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
DescribeInvocationsto view the execution status of the command.aliyun ecs DescribeInvocations --RegionId cn-shanghai --InvokeId t-sh054h***** -
Call
DescribeInvocationResultsto view the command execution result.aliyun ecs DescribeInvocationResults --RegionId cn-shanghai --InvokeId t-sh054h******
-
API
-
Obtain the command execution ID (InvokeId) from the response from RunCommand or InvokeCommand.
-
Call the DescribeInvocations or DescribeInvocationResults operation with the InvokeId and the region ID of the ECS instance to query the command execution result.
Troubleshooting
Common errors
|
Error code |
Error message |
Solution |
|
InstanceNotRunning |
The instance was not running when the task was created. |
Ensure 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. |
Because the Cloud Assistant Agent is stopped or not installed, please follow the steps below to start or install the Cloud Assistant Agent.
Note
If the Cloud Assistant Agent still fails to start, reinstall it. For more information, see Install the Cloud Assistant Agent. |
|
ClientNetworkBlocked |
The instance is experiencing a network connectivity issue. |
Note
|
|
SecurityGroupRuleDenied |
A security group rule denies access to the Cloud Assistant service. |
|
|
ClientNotResponse |
The Cloud Assistant Agent is not responding. |
Examine the Cloud Assistant Agent logs to troubleshoot this issue.
|
|
ClientNeedUpgrade |
The Cloud Assistant Agent requires an upgrade to support a specific feature. |
|
|
ClientNotOnline |
The Cloud Assistant Agent is not connected to the server. |
Restart the Cloud Assistant Agent. For instructions on managing the agent, see Stop and uninstall the Cloud Assistant Agent. |
|
DeliveryTimeout |
The Cloud Assistant service failed to send the task to the Cloud Assistant Agent. |
The command was not delivered to the instance. Run the command again. |
|
ExecutionTimeout |
The command execution timed out. |
If a command times out, increase its execution timeout value.
|
|
ExecutionException |
An exception occurred during command execution. |
View the detailed error message in the ErrorInfo field. |
|
ExitCodeNonzero |
The command finished with a non-zero exit code. |
Check the command script and the command output. |
|
ClientRestarted |
The task was interrupted because the Cloud Assistant Agent was restarted. |
Run the command again after the agent restarts. You can check the agent's status in the Cloud Assistant console or by calling the DescribeCloudAssistantStatus operation. |
|
InstanceReleased |
The instance was released during command execution. |
The command failed because the instance was released during execution. |
|
DirectoryNotExists |
The specified working directory does not exist on the instance. |
Create the specified working directory on the instance and then run the command. |
Command execution
|
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 check the status of the Cloud Assistant Agent on the Cloud Assistant console or by calling the DescribeCloudAssistantStatus operation. |
|
InstanceDeregistered |
The managed instance has been deregistered. |
You cannot run commands on a deregistered managed instance. |
|
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 |
|
DefaultWorkingDirectoryNotAvailable |
The default working directory on the instance is not available. |
Check the default working directory on the instance:
You can also specify a working directory when you run a command. You can specify the directory in the Cloud Assistant console or by using the |
|
CommandNotApplicable |
The command type is not applicable to the specified instance. |
Each command type supports the following operating systems:
|
|
InvalidCommandText |
The command content is invalid. |
Check the command content. The content can be plaintext or Base64-encoded. |
|
CommandContentDecodeError |
Failed to decode the command content. |
If the command content is Base64-encoded, verify that the encoding is correct. |
|
AccountNotExists |
The specified user does not exist on the instance. |
Create the specified user on the instance before running the command.
You can also specify another existing user to run the command. You can specify the user in the Cloud Assistant console or by using the |
Scheduled commands
|
Error code |
Error message |
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 run. |
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 value must be an integer from 0 to 59. Do not use leading zeros 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. Do not use leading zeros 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 value must be an integer from 0 to 59. |
|
TimezoneInformationCorrupt |
The Cloud Assistant Agent cannot parse the time zone information. This failure may be caused by a corrupted time zone file or other issues. |
Note
If the required time zone file is missing, create it before you run the command. |
|
InvalidRateExpression |
The rate expression is invalid. |
Modify the rate expression. For more information, see Fixed interval execution. |
|
RateFrequencyTooLarge |
The execution interval specified in the rate expression is too long. |
The execution interval must not exceed 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 run. |
Do not specify an expired timestamp when you run the command. |
Run commands in containers
|
Error code |
Error message |
Solution |
|
InvalidContainerName |
The container name is invalid. |
A container name must start with a letter or digit and can contain only letters, digits, periods (.), underscores (_), and hyphens (-). The name must be no more than 255 characters long. |
|
UnsupportedContainerRuntime |
The container runtime specified in the container ID is not supported. |
Cloud Assistant supports only CRI-managed containers that use the docker, containerd, or cri-o container runtime. |
|
InvalidContainerId |
The container ID is invalid. |
The container ID must be a 64-bit hexadecimal string. You can add the |
|
ContainerConnectFailed |
Failed to connect to the container. |
Verify that the container is running. You can use
|
|
ContainerStateAbnormal |
The container state is abnormal. |
Cloud Assistant can run commands only in running containers. Check the container state by using |
|
ContainerNotFound |
The container was not found. |
Verify that 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 |
Multiple containers with the same name exist on the node. The target container cannot be identified. |
|
|
ContainerNameAndIdNotMatch |
The specified container ID and container name do not match. |
Verify that the container ID and container name are correct. |
Run commands as a non-default user
The following errors may occur when you run commands on a Windows instance as a user other than the default System user.
|
Error code |
Error message |
Solution |
|
UserOrPasswordInvalid |
The username or password is incorrect. |
Ensure that the provided username and password are correct. For more information, see encrypted parameters and Set a regular user to run Cloud Assistant commands. |
|
QueryParameterStoreFailed |
Failed to retrieve parameters from Parameter Store. |
Verify that the password is stored in the CloudOps Orchestration Service parameter store. For more information, see encrypted parameters. Verify that the RAM role attached to the instance has the required permissions. For more information, see Set a RAM role for a Windows instance. |
|
InstanceRoleInvalid |
An instance role is not attached to the instance. |
Call the DescribeInstanceRamRole operation to verify that a RAM role is attached to the instance. |
Stop command
|
Error code |
Error message |
Recommendation |
|
TerminationException |
Failed to stop the task. |
Check the ErrorInfo field for the detailed error message, or try stopping the task again. |
Sending files
|
Error code |
Error message |
Recommendation |
|
FileAlreadyExists |
A file with the same name already exists in the destination path. |
To resolve this issue, do one of the following:
Change the file name or destination path on the target instance. |
|
FileNameInvalid |
The file name is invalid. |
Change the file name to comply with the naming conventions of the Windows or Linux operating system.
|
|
FilePathInvalid |
The file path is invalid. |
Change the file path to comply with the path conventions of the Windows or Linux operating system.
|
|
FileAuthorityInvalid |
The file permissions are invalid. |
Change the file permissions. This setting applies only to Linux instances and uses the same format as the |
|
UserGroupNotExists |
The specified user group does not exist on the instance. |
The default user group is Example: |
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? How do I resolve this issue?
A: This happens because the PowerShell environment for Cloud Assistant does not use UTF-8 encoding by default. When a script outputs non-ASCII characters, such as Chinese characters, the encoding mismatch prevents the console from parsing them correctly.
This results in garbled text.
There are two solutions:
-
Modify the script content: Add a command to the start of your script to force UTF-8 output encoding.
On Windows Server 2022, Cloud Assistant correctly encodes Chinese characters by default, so you can skip this step.
Add the following code to your PowerShell script:
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 Write-Output "Testing Chinese output..." -
Modify the Launcher: In the advanced options of a Cloud Assistant command, use the Launcher field to automatically set the encoding before script execution.
Enter the following command in the Launcher field:
powershell -command [Console]::OutputEncoding=[System.Text.Encoding]::UTF8;{{ACS::ScriptFileName|Ext(.ps1)}};exit $LastExitCodeThis setting automatically applies UTF-8 encoding to all PowerShell scripts executed in this task, so you do not need to modify each script file.