All Products
Search
Document Center

Elastic Compute Service:Check Cloud Assistant command results and troubleshoot

Last Updated:Jul 15, 2026

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

  1. Go to ECS console - Cloud Assistant.

  2. In the upper-left corner of the page, select a region and resource group.

  3. Click the Command execution result tab.

    • If a command executed successfully:

      1. Find the 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 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:

      1. Find the 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 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 includes Version : 3.5.12, Region ID: cn-hangzhou, and CPU Type : amd64.

    • For a scheduled command:

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

      2. In the Actions column, click View.

      3. On the Instances page, view the scheduled execution details.

CLI

For CLI usage, see Use Alibaba Cloud CLI to manage Alibaba Cloud resources.

  1. Get the InvokeId from the RunCommand or InvokeCommand response.

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

  1. Get the InvokeId from the RunCommand or InvokeCommand response.

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

  1. Check the Cloud Assistant Agent process:

    • Linux:

      ps -ef |grep aliyun-service
    • Windows: Check whether the aliyun_assist_service process exists in Task Manager.

  2. If the process does not exist, start it:

    • Linux:

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

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.

  1. Check network connectivity. If the instance ID is returned, the network is connected.

    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. Allow outbound traffic on TCP port 443, TCP port 80, and UDP port 53 over the internal network so Cloud Assistant can reach:

    • 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

      An "AccessDenied" response is expected when testing this domain's connectivity, because the OSS bucket is private while only the installation package file has public read permissions. This message indicates a successful connection.

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

  • For Cloud Assistant server addresses in each region, see Fine-grained configurations.

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:

  1. Open the Cloud Assistant Agent log file. Default paths:

    • 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 for the command's InvokeId in the log:

    • If found, check surrounding entries for exceptions, such as whether the command finished and if its result was reported.

    • If not found, re-run the command. If it still fails, restart the Cloud Assistant Agent:

      • Linux:

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

ClientNeedUpgrade

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

  • Check the ErrorInfo field for the required feature and minimum version. Upgrade the Cloud Assistant Agent to that version or later.

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.

  • In the console, the default Timeout Period is 60 seconds. Increase as needed.

  • When calling RunCommand, the default Timeout is 60 seconds. Set a higher value as needed.

  • When using CreateCommand followed by InvokeCommand, the default Timeout is 60 seconds. Set a custom value during creation, or update it later with ModifyCommand.

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

DefaultWorkingDirectoryNotAvailable

The default working directory on the instance is not available.

Check the default working directory:

  • Linux: The root user's home directory /root by default.

  • Windows: The directory containing the Cloud Assistant Agent process, e.g. C:\Windows\System32.

You can also specify a working directory in the console or via the WorkingDir parameter of RunCommand.

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.

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.

  • 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 run a command as another user via the console or the Username parameter of RunCommand.

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.

  • Linux: Check the time zone file in /usr/share/zoneinfo, e.g. /usr/share/zoneinfo/Asia/Shanghai.

  • Windows: Check the registry, e.g. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.

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

ContainerConnectFailed

Cannot connect to the container.

Check whether the container is running. Use kubectl or the Cloud Assistant Agent to check the container status. The container is running if State is Running. See Use Cloud Assistant to run commands in a container.

  • If running, verify the runtime. Only docker, containerd, and cri-o runtimes managed by Kubernetes through CRI are supported.

  • If the runtime is compliant, verify that the command meets the requirements. See Limits.

ContainerStateAbnormal

The container status is abnormal.

Ensure the container is running. Cloud Assistant runs commands only in running containers. Use kubectl or the Cloud Assistant Agent to check. The container is running if State is Running. See Use Cloud Assistant to run commands in a container.

ContainerNotFound

The container does not exist.

Verify the container exists by name or ID.

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

See Use Cloud Assistant to run commands in a container.

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:

  • Delete the existing file from the destination path.

  • Overwrite the existing file.

    • In the Overwrite, enable Overwrite when you upload the file.

    • When calling SendFile, set the Overwrite parameter to true.

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.

  • In File Name, ensure the name is valid.

  • When calling SendFile, ensure the Name parameter is valid.

FilePathInvalid

The file path is invalid.

Ensure the file path follows the Windows or Linux path conventions.

  • In Destination Path, ensure the path is valid.

  • When calling SendFile, ensure the TargetDir parameter specifies a valid path.

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: groupadd <groupname>, where <groupname> is the name of the new user group.

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:

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

    This applies UTF-8 encoding to all PowerShell scripts in this task. No individual script changes are needed.