All Products
Search
Document Center

Elastic Compute Service:View execution results and fix common issues

Last Updated:Dec 23, 2025

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

Background information

A command may have different execution statuses and results due to issues such as missing dependencies on an ECS instance, network problems, command semantic errors, script debugging failures, or an abnormal instance 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. 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. 地域

  3. On the Command Execution Result 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 where the Execution Status is Successful.

      2. In the Actions column, click View.

      3. On the Instances page, you can view the command execution results on the Task Completed tab.

        执行成功

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

      1. Find the command execution result where the Execution Status is Execution failed.

      2. In the Actions column, click View.

      3. On the Instances page, you can view the error message on the Execution failed tab.

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

        执行失败

    • View the output of a scheduled task.

      1. Find the command execution result whose Execution Status is Scheduled.

      2. In the Actions column, click View.

      3. On the Instances page, you can view the result of the command.

View results using Alibaba Cloud CLI

For more information about how to use the Cloud Assistant 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.

Ensure that the instance is in the Running state.

InstanceRestarted

The instance was restarted during the task execution.

Do not restart the instance during the task execution.

ClientNotRunning

The Cloud Assistant Agent is not running.

The Cloud Assistant Agent is stopped or not installed. You must 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 service in the Services Manager.

Note

If the Cloud Assistant Agent still fails to start, reinstall it. For more information, see Install the Cloud Assistant Agent.

ClientNetworkBlocked

The instance has network connectivity issues.

  1. Run the following command to check for 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 so 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 still 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 is not responding.

Check the Cloud Assistant Agent logs.

  1. Open the Cloud Assistant Agent log file. 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 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 systems, 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 service in the Services Manager.

ClientNeedUpgrade

The Cloud Assistant Agent must 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 the specified version or later.

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 was not sent to the instance. Run the command again.

ExecutionTimeout

The command execution timed out.

Extend the command execution timeout period as required.

  • When you create and run a command in the console, the default value for the Timeout parameter is 60 seconds. Ensure that you 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. 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. Set it to an appropriate value when you create the command, or call the ModifyCommand operation to change the value after the command is created.

ExecutionException

An exception occurred during the 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 command output.

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 the command execution.

The command cannot be executed because the instance was released during the 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.

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 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 on the instance is not available.

Check the default working directory on 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 that are 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

The command content failed to be decoded.

If the command content is Base64-encoded, check whether the encoding is correct.

AccountNotExists

The specified user does not exist on the instance.

Create the specified user on 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 that is 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 can be from 0 to 59. Leading zeros are not supported for the hour.

InvalidGMTOffsetHourForTimezone

The GMT offset hour value that is 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 that is specified in the cron expression is invalid.

Check the minute value of the GMT offset time zone.

The minute value can be 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 that is specified in the Rate expression is too high.

The scheduled execution frequency cannot exceed 7 days.

InvalidAtExpression

The UNIX timestamp (At expression) is invalid.

Modify the UNIX timestamp. For more information, see Run a command only once at a specified time.

AtExpressionExpired

The UNIX timestamp (At expression) has expired. The corresponding scheduled task will not be executed.

Do not specify an expired UNIX 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 letters, lowercase letters, periods (.), underscores (_), and hyphens (-). The name cannot exceed 255 characters in length.

UnsupportedContainerRuntime

The container runtime that is 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

A connection to the container cannot be established.

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 requirements, 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 other 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 (a user other than 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 specified 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.

    • 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 destination path or the name of the file on the destination ECS instance.

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 a file, ensure 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.

  • In the Cloud Assistant console, when you upload the file, ensure 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 on the instance.

The default user group is root. Create the specified user group on 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 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

The content is displayed as garbled characters because the platform cannot parse it correctly.

You can use one of the following solutions:

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

    In Windows Server 2022, Cloud Assistant correctly handles Chinese character encoding by default. You do not need to set the encoding to UTF-8.

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

    [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
    
    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 Bootstrap Program field of the Cloud Assistant command, enter the following code:

    powershell -command [Console]::OutputEncoding=[System.Text.Encoding]::UTF8;{{ACS::ScriptFileName|Ext(.ps1)}};exit $LastExitCode

    All PowerShell scripts that run in this task will automatically apply UTF-8 encoding. You do not need to modify each script file.