Check Cloud Assistant command execution results, diagnose failures by error code, and resolve common issues.
Background
Commands can fail for various reasons, such as missing dependencies, network issues, syntax errors, debug failures, or an abnormal instance state. Check error details in the execution results from the console or through the API.
View execution results
Console
In the upper-left corner of the page, select a region and resource group.
-
Click the Command execution result tab.
-
If a command executed successfully:
-
Find the 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 output.
In the execution results table, the Execution Status column shows Success, and the ExitCode is
0. The area below displays the JSON output returned by the command.
-
-
If a command failed:
-
Find the result with an Execution Status of Failed.
-
In the Actions column, click View.
-
On the Failed tab of the Instances page, view the error information.
For common errors and solutions, see Common execution errors and solutions.
In the example, the ExitCode is
5, and the error description is The command execution ended with a non-zero exit code. Key information in the command output:Not ECS : False(indicating the instance is an ECS instance). Other output includesVersion : 3.5.12,Region ID: cn-hangzhou, andCPU Type : amd64.
-
-
For a scheduled command:
-
Find the result with an Execution Status of Scheduled.
-
In the Actions column, click View.
-
On the Instances page, view the scheduled execution details.
-
-
CLI
For CLI usage, see Use Alibaba Cloud CLI to manage Alibaba Cloud resources.
-
Get the InvokeId from the RunCommand or InvokeCommand response.
-
Query results by InvokeId and RegionId. The following example uses China (Shanghai). For other region IDs, see Regions and zones.
-
View execution status with
DescribeInvocations:aliyun ecs DescribeInvocations --RegionId cn-shanghai --InvokeId t-sh054h***** -
View execution results with
DescribeInvocationResults:aliyun ecs DescribeInvocationResults --RegionId cn-shanghai --InvokeId t-sh054h******
-
API
-
Get the InvokeId from the RunCommand or InvokeCommand response.
-
Call DescribeInvocations or DescribeInvocationResults with the InvokeId and region ID.
Troubleshooting
Common errors
|
Error code |
Error message |
Recommendation |
|
InstanceNotRunning |
The instance was not running when the command was issued. |
Ensure the instance is in the Running state. |
|
InstanceRestarted |
The instance was restarted during command execution. |
Avoid restarting the instance during command execution. |
|
ClientNotRunning |
The Cloud Assistant Agent is not running. |
The Cloud Assistant Agent is stopped or not installed. Start or install it:
Note
If the Cloud Assistant Agent still fails to start, see Install the Cloud Assistant Agent to reinstall it. |
|
ClientNetworkBlocked |
The instance has network connectivity issues. |
Note
|
|
SecurityGroupRuleDenied |
A security group rule denies access to the Cloud Assistant service. |
|
|
ClientNotResponse |
The Cloud Assistant Agent did not respond. |
Check the Cloud Assistant Agent logs:
|
|
ClientNeedUpgrade |
The Cloud Assistant Agent must be upgraded to support the specified feature. |
|
|
ClientNotOnline |
The Cloud Assistant Agent is not connected to the Cloud Assistant server. |
Restart the Cloud Assistant Agent. See Stop and uninstall the Cloud Assistant Agent. |
|
DeliveryTimeout |
The Cloud Assistant server failed to send the command to the Cloud Assistant Agent. |
Run the command again. |
|
ExecutionTimeout |
The command execution timed out. |
Increase the command timeout as needed.
|
|
ExecutionException |
An exception occurred during command execution. |
Check the ErrorInfo field for details. |
|
ExitCodeNonzero |
The command finished with a non-zero exit code. |
Check the command script and output. |
|
ClientRestarted |
The command was interrupted because the Cloud Assistant Agent was restarted. |
Re-run the command after the agent restarts. Check the agent status in the Cloud Assistant console or by calling DescribeCloudAssistantStatus. |
|
InstanceReleased |
The instance was released during command execution. |
The command failed because the target instance was released. |
|
DirectoryNotExists |
The specified working directory does not exist on the instance. |
Create the working directory on the instance, then re-run the command. |
Run commands
|
Error code |
Error message |
Solution |
|
ClientIsUpgrading |
The Cloud Assistant Agent is being upgraded. |
Re-run the command after the upgrade completes. Check the agent status in the Cloud Assistant console or by calling DescribeCloudAssistantStatus. |
|
InstanceDeregistered |
The managed instance has been deregistered. |
The command failed because the managed instance has been deregistered. |
|
InvalidSystemBuiltInParameter |
The built-in environment parameter is invalid. |
The built-in environment parameter is not supported. For supported parameters, see the |
|
DefaultWorkingDirectoryNotAvailable |
The default working directory on the instance is not available. |
Check the default working directory:
You can also specify a working directory in the console or via 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. |
Verify the command content. It can be plaintext or Base64-encoded. |
|
CommandContentDecodeError |
Failed to decode the command content. |
If Base64-encoded, verify the encoding is correct. |
|
AccountNotExists |
The specified user does not exist on the instance. |
Create the user on the instance before running the command.
You can also run a command as another user via the console or the |
Run scheduled commands
|
Error code |
Error message |
Solution |
|
BadCronExpression |
The cron expression is invalid. |
Fix the cron expression. See Clock-based scheduling. |
|
CronExpressionExpired |
The cron expression has expired. The scheduled task will not run. |
Specify a non-expired cron expression. |
|
InvalidGMTOffsetForTimezone |
The cron expression contains an invalid GMT offset time zone format. |
Check the format of the GMT offset time zone. Supported range: GMT-12:59 to GMT+14:59. Minutes: 0-59. Leading zeros are not supported for the hour. |
|
InvalidGMTOffsetHourForTimezone |
The GMT offset hour in the cron expression is invalid. |
Check the hour value of the GMT offset time zone. Supported range: GMT-12:59 to GMT+14:59. Leading zeros are not supported for the hour. |
|
InvalidGMTOffsetMinuteForTimezone |
The GMT offset minute in the cron expression is invalid. |
Check the minute value of the GMT offset time zone. Valid values: 0 to 59. |
|
TimezoneInformationCorrupt |
The Cloud Assistant Agent cannot parse the time zone information because the time zone file is corrupted. |
Note
If the time zone file does not exist, create it before running the command. |
|
InvalidRateExpression |
The rate expression is invalid. |
Fix the rate expression. See Fixed-interval execution. |
|
RateFrequencyTooLarge |
The scheduled execution frequency is too high. |
The execution frequency cannot exceed 7 days. |
|
InvalidAtExpression |
The timestamp (at expression) is invalid. |
Fix the timestamp. See Run a command only once at a specified time. |
|
AtExpressionExpired |
The timestamp (at expression) has expired. The scheduled task will not run. |
Specify a non-expired timestamp. |
Running commands in a container
|
Error code |
Error message |
Solution |
|
InvalidContainerName |
The container name is invalid. |
The name must start with a letter or digit, contain only letters, digits, periods (.), underscores (_), and hyphens (-), and be 255 characters or fewer. |
|
UnsupportedContainerRuntime |
The container runtime specified in the container ID is not supported. |
Only containers managed by Kubernetes through the CRI specification on docker, containerd, or cri-o runtimes are supported. |
|
InvalidContainerId |
The container ID is invalid. |
A container ID must be a 64-bit hexadecimal string. Optionally add a prefix ( |
|
ContainerConnectFailed |
Cannot connect to the container. |
Check whether the container is running. Use
|
|
ContainerStateAbnormal |
The container status is abnormal. |
Ensure the container is running. Cloud Assistant runs commands only in running containers. Use |
|
ContainerNotFound |
The container does not exist. |
Verify the container exists by name or ID. Method 1: Use kubectl
Method 2: Use the Cloud Assistant Agent
|
|
ContainerNameDuplicated |
The target container cannot be identified because multiple containers on the node share the same name. |
|
|
ContainerNameAndIdNotMatch |
The specified container ID and container name do not match. |
Verify that the container ID and name refer to the same container. |
Run commands as a non-default user on Windows
The following issues may occur when running commands on a Windows instance as a non-default user.
|
Error code |
Error message |
Solution |
|
UserOrPasswordInvalid |
The username or password is incorrect. |
The username or password is incorrect. See Encrypted parameters and Set a regular user to run Cloud Assistant commands. |
|
QueryParameterStoreFailed |
Failed to retrieve parameters from the parameter store. |
Verify that the password exists in the CloudOps Orchestration Service parameter store. See Encrypted parameters. Verify the instance RAM role has the required permissions. See Configure a RAM role for a Windows instance. |
|
InstanceRoleInvalid |
A RAM role is not attached to the instance. |
Call DescribeInstanceRamRole to check whether a RAM role is attached to the instance. |
Stop command
|
Error code |
Error message |
Solution |
|
TerminationException |
Failed to stop the task. |
Check the ErrorInfo field, or retry the command. |
Sending files
|
Error code |
Error message |
Solution |
|
FileAlreadyExists |
A file with the same name already exists in the destination path. |
Resolve this by one of the following:
3. Change the destination path or file name on the target instance. |
|
FileNameInvalid |
The file name is invalid. |
Ensure the file name follows the Windows or Linux naming conventions.
|
|
FilePathInvalid |
The file path is invalid. |
Ensure the file path follows the Windows or Linux path conventions.
|
|
FileAuthorityInvalid |
The file permissions are invalid. |
Adjust the file permissions. This applies only to Linux instances and uses the same format as chmod. |
|
UserGroupNotExists |
The specified user group does not exist on the instance. |
Default group: root. Create the user group on the Linux instance. Example command: |
FAQ
Q: When I use Cloud Assistant to run a PowerShell script on a Windows server, why does the output display garbled characters, and how can I fix it?
A: The PowerShell environment used by Cloud Assistant does not default to UTF-8 output encoding.
Non-ASCII characters (such as Chinese) display as garbled text because the console cannot parse them correctly.
Two solutions:
-
Modify the script: Add UTF-8 encoding at the beginning of the script.
On Windows Server 2022, Cloud Assistant handles Chinese character encoding correctly by default. No manual UTF-8 setting is needed.
Add to the beginning of your PowerShell script:
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 Write-Output "Testing Chinese output..." -
Modify the Launcher: In Cloud Assistant advanced options, set the encoding before execution.
In advanced options, enter in the Launcher field:
powershell -command [Console]::OutputEncoding=[System.Text.Encoding]::UTF8;{{ACS::ScriptFileName|Ext(.ps1)}};exit $LastExitCodeThis applies UTF-8 encoding to all PowerShell scripts in this task. No individual script changes are needed.