All Products
Search
Document Center

Elastic Compute Service:View execution results and fix common issues

Last Updated:Sep 29, 2025

Running a Cloud Assistant command in the ECS console is similar to running a command after logging on to an instance. The command succeeds only if all conditions are met. After you run a command, you should view its result and status to ensure that the target operation is complete. If the execution fails, you can use the error messages to find and fix the problem.

Background information

A command may show different execution statuses and results if an ECS instance lacks dependencies, has network issues, contains command semantic errors, fails script debugging, or has an abnormal status. You can view error messages in the execution results from the console or using an API to diagnose and fix the problem.

View execution results

View results in the console

  1. ECS console - Storage Capacity Units
  2. In the top navigation bar, select the region and resource group of the resource that you want to manage. 地域

  3. On the Command Execution Results tab, you can view the command execution results.

    • If the command is successful, you can view the output in the execution results.

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

      2. In the Actions column, click View.

      3. On the Instance List page, you can view the command execution results on the Execution Finished tab.

        执行成功

    • If the command fails, you can view the error message in the execution results and use the message to diagnose and fix the problem.

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

      2. In the Actions column, click View.

      3. On the Execution Failed tab of the Instance List page, view the error message.

        For information about common error messages and recommended solutions, see Common execution failure errors and recommended solutions.

        执行失败

    • You can 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 Instance List page, you can view the command execution result.

View results using Alibaba Cloud CLI

For more information about 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 of the RunCommand or InvokeCommand operation.

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

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

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

View results using an API

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

  2. In the DescribeInvocations or DescribeInvocationResults operation, enter the InvokeId and the region ID of the ECS instance to query the command execution result.

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

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

    • For Linux, run the following command.

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

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

    • For Linux, run the following command.

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

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.

  1. Run the following command to check network connectivity. If the ID of the current instance is returned, the network is connected.

    curl https://{region-id}.axt.aliyun.com/luban/api/instance/instance-id
  2. If the ID of the current instance is not returned, check the security group, firewall, DNS settings, and route table for network issues. You must allow outbound traffic on TCP port 443, TCP port 80, and UDP port 53 over the internal network to ensure that Cloud Assistant can access the following addresses:

    • 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

      The OSS bucket that stores the Cloud Assistant Agent installation package is private. Only the installation package file has public-read permissions. Therefore, if an "AccessDenied" message is returned when you verify the connectivity of this domain name, it indicates that the domain name is accessible.

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

  • For the domain names and IP addresses of Cloud Assistant servers in each region, see Fine-grained configurations.

SecurityGroupRuleDenied

A security group rule denies access to the Cloud Assistant service.

  • View the security group ID and the Cloud Assistant service IP address that are denied access in the ErrorInfo field. Then, modify the security group rule to allow access to the Cloud Assistant service.

  • For more information about the configuration, see Configure network permissions for the Cloud Assistant Agent.

ClientNotResponse

The Cloud Assistant Agent did not respond.

Check the logs of the Cloud Assistant Agent.

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

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

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

  2. Check whether the corresponding command execution ID exists in the log.

    • If the ID exists, check the context for exceptions, such as whether the Cloud Assistant command has 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 systems that support systemctl
        systemctl restart aliyun.service
        
        # For Linux systems that do not support systemctl
        /etc/init.d/aliyun-service restart
      • For Windows, start the Aliyun Assist Service in the Services Manager.

ClientNeedUpgrade

The Cloud Assistant Agent needs to be upgraded to support the specified feature.

  • View the feature and the minimum supported version number in the ErrorInfo field. Upgrade the Cloud Assistant Agent to at least the specified version.

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.

  • When you create and run a command in the console, the default value for Timeout is 60 seconds. You should set this parameter to an appropriate value.

  • If you call the RunCommand operation to run a command, the default value of the Timeout parameter is 60 seconds. You can set it to an appropriate value.

  • 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 it to an appropriate value when you create the command. You can also call the ModifyCommand operation to change the value after the command is created.

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

DefaultWorkingDirectoryNotAvailable

The default working directory in the instance is not available.

Check the default working directory in the instance:

  • For a Linux instance, the default directory is the home directory of the administrator (root user), which is /root.

  • For a Windows instance, the default directory is where the Cloud Assistant Agent process is located, such as C:\Windows\System32.

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

CommandNotApplicable

The command type is not applicable to the specified instance.

The operating systems supported by each command type are as follows:

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

  • For Linux ECS instances, commands are run as the root user by default.

  • For Windows ECS instances, commands are run as the System user by default.

You can also specify another existing user to run the command. You can specify the user in the Cloud Assistant console or using the Username parameter of the RunCommand operation.

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.

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

  • For Windows instances, check whether the corresponding time zone file exists in the registry, such as HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.

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

ContainerConnectFailed

Cannot connect to the container.

Check whether the container is running. You can use kubectl or the Cloud Assistant Agent to view the container status. 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 the container runtime. Only containers that are managed by Kubernetes through the CRI and run on docker, containerd, or cri-o container runtimes are supported.

  • If the container runtime meets the Cloud Assistant limits, check whether the command run in the container meets the requirements. For more information, see Limits.

ContainerStateAbnormal

The container status is abnormal.

Check the container status. You can run commands using Cloud Assistant only on running containers. You can use kubectl or the Cloud Assistant Agent to view the container status. A State of Running indicates that the container is running. For more information, see Use Cloud Assistant to run commands in a container.

ContainerNotFound

The container does not exist.

Check whether a container with the specified name or ID exists.

Method 1: Use kubectl

kubectl --namespace <specified namespace> describe pod <specified pod>

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

The node has containers with the same name. The container on which to run the command cannot be identified.

  • When you specify a container name to run a command, the node cannot have containers with the same name.

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

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:

  • Delete the file with the same name from the path.

  • Allow overwriting the file with the same name in the same path.

    • Cloud Assistant console: When you upload the file, enable Overwrite.

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

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.

  • Cloud Assistant console: When you upload the file, make sure that the File Name meets the requirements.

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

FilePathInvalid

The file path is invalid.

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

  • Cloud Assistant console: When you upload the file, make sure that the Destination Path meets the file path requirements.

  • OpenAPI: When you call the SendFile operation, make sure that the TargetDir parameter meets the file path requirements.

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: groupadd <groupname>. <groupname> is the name of the user group to be created.

FAQ

Q: When I run a PowerShell script on a Windows server using Cloud Assistant, the Chinese characters in the output are garbled. Why does this happen and how can I fix it?

A: This is because the default environment that Cloud Assistant uses to execute PowerShell scripts does not use UTF-8 encoding to process the output, resulting in an encoding mismatch when the script outputs non-ASCII characters, such as Chinese characters, which causes the control

Garbled text appears because the platform cannot correctly parse the content.

There are two solutions:

  1. Modify the script content: Add a line of code at the beginning of the script file to force the output encoding to UTF-8.

    Add the following code to the beginning of the PowerShell script:

    [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
    
    # --- Original script below ---
    Write-Output "Testing Chinese output..."
  2. 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 the script runs.

    In the Cloud Assistant command's Bootstrap Program field, enter the following code:

    powershell -command $currentCulture=Get-Culture;if($currentCulture.LCID -eq 1033){[Console]::OutputEncoding=[System.Text.Encoding]::UTF8};{{ACS::ScriptFileName|Ext(.ps1)}};exit $LastExitCode

    All PowerShell scripts run in this task will automatically apply UTF-8 encoding. You do not need to modify the script files individually.