All Products
Search
Document Center

Elastic Compute Service:Execution results and troubleshooting

Last Updated:Mar 27, 2026

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

  1. Go to ECS console - ECS Cloud Assistant.

  2. In the top navigation bar, select the region and resource group of the resource that you want to manage. Region

  3. On the Command execution result tab, view the execution results.

    • If a command succeeds, view its output in the execution result.

      1. Find the command execution result with an Execution Status of Successful.

      2. In the Actions column, click View.

      3. 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.

      1. Find the command execution result with an Execution Status of Failed.

      2. In the Actions column, click View.

      3. 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.

      1. Find the command execution result with an Execution Status of Scheduled.

      2. In the Actions column, click View.

      3. 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.

  1. Obtain the command execution ID (InvokeId) from the response from RunCommand or InvokeCommand.

  2. 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 DescribeInvocations to view the execution status of the command.

      aliyun ecs DescribeInvocations --RegionId cn-shanghai --InvokeId t-sh054h*****
    • Call DescribeInvocationResults to view the command execution result.

      aliyun ecs DescribeInvocationResults --RegionId cn-shanghai  --InvokeId t-sh054h******

API

  1. Obtain the command execution ID (InvokeId) from the response from RunCommand or InvokeCommand.

  2. 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.

  1. Check whether the Cloud Assistant Agent process is running.

    • For Linux, run the following command.

      ps -ef |grep aliyun-service
    • For Windows, check for the aliyun_assist_service process in Task Manager.

  2. If the process does not exist, start the Cloud Assistant Agent.

    • For Linux, run the following command.

      # For Linux distributions that support systemctl
      systemctl start aliyun.service
      
      # For Linux distributions that do not support systemctl
      /etc/init.d/aliyun-service start
    • For Windows, start the Aliyun Assist Service in Services.

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.

  1. Run the following command to check network connectivity. If the command returns the ID of the current instance, the network connection is working.

    curl https://{region-id}.axt.aliyun.com/luban/api/instance/instance-id
  2. If the instance ID is not returned, check your security group, firewall, DNS, and route table settings. Ensure that outbound traffic is allowed on TCP ports 443 and 80, and UDP port 53 to the following Cloud Assistant service endpoints:

    • https://{region-id}.axt.aliyun.com:443/

    • http://100.100.100.200:80/

    • http://aliyun-client-assist-{region-id}.oss-{region-id}-internal.aliyuncs.com

      Because the OSS bucket that contains the Cloud Assistant Agent installation package is private and only the installation package file has public read permissions, an "AccessDenied" message returned when you test the domain's connectivity indicates that the domain is connected properly.

Note
  • {region-id} represents the region where the instance is located. For example, the region ID for China (Hangzhou) is cn-hangzhou.

  • For a list of Cloud Assistant service endpoints and IP addresses for each region, see Fine-grained configurations.

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.

  1. Open the Cloud Assistant Agent log file. The default log file paths are as follows:

    • Linux: /usr/local/share/aliyun-assist/<Cloud Assistant Agent version>/log/aliyun_assist_main.log

    • Windows: C:\ProgramData\aliyun\assist\<Cloud Assistant Agent version>\log\aliyun_assist_main.log

  2. Search the log for the command's execution ID.

    • If the ID exists, check the surrounding log entries for exceptions. For example, check whether the Cloud Assistant command finished executing and whether the result was reported successfully.

    • If the ID does not exist, run the command again. If the command still fails, restart the Cloud Assistant Agent.

      • For Linux, run the following command.

        # For Linux distributions that support systemctl
        systemctl restart aliyun.service
        
        # For Linux distributions that do not support systemctl
        /etc/init.d/aliyun-service restart
      • For Windows, start the Aliyun Assist Service in Services.

ClientNeedUpgrade

The Cloud Assistant Agent requires an upgrade to support a specific feature.

  • Check the ErrorInfo field for the required feature and minimum supported version. You must upgrade the Cloud Assistant Agent to at least this version.

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.

  • If you create and run a command in the console, the default value for Timeout Period is 60 seconds. Set this parameter to an appropriate value.

  • If you use the RunCommand operation, the default value of the Timeout parameter is 60 seconds. Set this parameter to a higher value as needed.

  • If you call the CreateCommand operation to create a command and then call the InvokeCommand operation to run it, the default value of the Timeout parameter is 60 seconds. You can set a higher value when creating the command or change it later by using the ModifyCommand operation.

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 CommandContent parameter description in RunCommand.

DefaultWorkingDirectoryNotAvailable

The default working directory on the instance is not available.

Check the default working directory on the instance:

  • On a Linux instance, the default directory is the home directory of the root user, which is /root.

  • On a Windows instance, the default directory is the location of the Cloud Assistant Agent process, typically C:\Windows\System32.

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 WorkingDir parameter in the RunCommand operation.

CommandNotApplicable

The command type is not applicable to the specified instance.

Each command type supports the following operating systems:

  • RunBatScript: Batch (BAT) commands for Windows instances.

  • RunPowerShellScript: PowerShell commands for Windows instances.

  • RunShellScript: Shell commands for Linux instances.

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.

  • By default, commands run as the root user on Linux ECS instances.

  • By default, commands run as the System user on Windows ECS instances.

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 Username parameter of the RunCommand operation.

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.

  • For Linux instances, verify that the corresponding time zone file exists in the /usr/share/zoneinfo directory. For example, /usr/share/zoneinfo/Asia/Shanghai is the file for the Asia/Shanghai time zone.

  • For Windows instances, verify that the corresponding time zone information exists in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.

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 docker://, containerd://, or cri-o:// prefix to specify the container runtime.

ContainerConnectFailed

Failed to connect to the container.

Verify that the container is running. You can use kubectl or the Cloud Assistant Agent to check the container state. A State of Running indicates that the container is running. For more information, see Use Cloud Assistant to run commands in a container.

  • If the container is running, check its container runtime. Cloud Assistant supports only CRI-managed containers that use the docker, containerd, or cri-o container runtime.

  • If the container runtime is supported, ensure the command follows the documented Limits.

ContainerStateAbnormal

The container state is abnormal.

Cloud Assistant can run commands only in running containers. Check the container state by using kubectl or the Cloud Assistant Agent. A State of Running confirms the container is running. For more information, see Use Cloud Assistant to run commands in a container.

ContainerNotFound

The container was not found.

Verify that a container with the specified name or ID exists.

Method 1: Use kubectl

kubectl --namespace <namespace> describe pod <pod-name>

Method 2: Use the Cloud Assistant Agent

aliyun-service list-containers --source cri --all

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.

  • When running a command by container name, ensure the name is unique on the node.

  • Specify the container ID to run the command. You can use kubectl or the Cloud Assistant Agent to find the container ID. For more information, see Use Cloud Assistant to run commands in a container.

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:

  • Delete the existing file from the path.

  • Allow the existing file to be overwritten.

    • In the Cloud Assistant console, enable Overwrite when you upload the file.

    • OpenAPI: When you call the SendFile operation, set the Overwrite parameter to true.

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.

  • In the Cloud Assistant console, ensure that the File Name meets the requirements when you upload the file.

  • OpenAPI: When you call the SendFile operation, ensure that the Name parameter meets the requirements.

FilePathInvalid

The file path is invalid.

Change the file path to comply with the path conventions of the Windows or Linux operating system.

  • In the Cloud Assistant console, ensure that the Destination Path meets the file path requirements when you upload the file.

  • OpenAPI: When you call the SendFile operation, ensure that the TargetDir parameter is set to a valid path.

FileAuthorityInvalid

The file permissions are invalid.

Change the file permissions. This setting applies only to Linux instances and uses the same format as the chmod command.

UserGroupNotExists

The specified user group does not exist on the instance.

The default user group is root. If you specified a different group, you must create it on the Linux instance.

Example: groupadd <groupname>, where <groupname> is the name of the user group to create.

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:

  1. 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..."
  2. 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 $LastExitCode

    This setting automatically applies UTF-8 encoding to all PowerShell scripts executed in this task, so you do not need to modify each script file.