This topic describes common errors that occur when you use Cloud Assistant CLI and provides troubleshooting solutions.
General troubleshooting methods
If you encounter an issue or receive an error message when you use Cloud Assistant CLI, perform the following checks first to troubleshoot the problem.
Check the network status
Network connectivity issues between the client and the server can prevent requests from reaching the server. Check your network status to ensure that you can access Alibaba Cloud APIs.
Check for missing options
Some commands have required options. The command fails to run if you do not include a required option or if you pass an invalid value for an option. You can view command or API details in the following ways:
When you configure credentials, see Configure credentials and Manage multiple credential configurations to check whether the required options for the configuration command are included.
When you call an OpenAPI, view the required options in the API documentation.
When you use the
--forceoption to call an API, you must also use the--versionoption to specify the OpenAPI version.
Check the command and parameter format
If Cloud Assistant CLI reports that a command does not exist or a parameter is not recognized, the command or parameter format may be incorrect. Check your command in the following ways:
See Command structure and the corresponding OpenAPI documentation to check the command for spelling or format errors.
Check whether the passed parameters are correct.
Check whether the passed parameters contain special characters that require processing. For more information, see Parameter format.
Check the region and endpoint
An error may occur if an Alibaba Cloud service does not support calls from your specified endpoint or region, or if the resource you want to access is in another region. Cloud Assistant CLI prioritizes endpoints and regions in the following order:
The endpoint specified by the
--endpointoption.The region ID specified by the
--regionoption.The region ID saved in the credential configuration
profile.The region ID saved in the
ALIBABA_CLOUD_REGION_IDenvironment variable.
Check the request details
If a command returns an unexpected result, you can check whether the request parameters are structured correctly using the following methods.
Use the dry run feature to view request details
Use the --dryrun option to perform a dry run. This operation does not affect your cloud resources. The dry run feature displays information such as identity credentials, the region, and the API version. For more information, see Dry run feature.
Enable and check Cloud Assistant CLI logs
After you enable the log output feature, Cloud Assistant CLI outputs more detailed call information when you run a command. For more information, see Dry run feature.
Confirm credential validity
If you do not configure your identity credentials correctly, various errors may occur when you make calls. Check the following items to ensure that your identity credentials are valid:
Check the current configuration
If you use an unexpected credential configuration to make a call, the command result may be unexpected. Cloud Assistant CLI prioritizes credential configurations in the following order:
The configuration specified by the
--profileoption.The configuration specified by the
ALIBABA_CLOUD_PROFILEenvironment variable.The current configuration specified by the
aliyun configure switchcommand. For more information, see Set the current credential configuration.
Check the credential information saved in the configuration
If the credential information saved in the configuration is incorrect, Cloud Assistant CLI cannot use this configuration to call an OpenAPI. You can check the credential information using the following methods:
Run the
aliyun configure listcommand to view summary information for all credential configurations.Run the
aliyun configure getcommand to view detailed information of a single credential configuration.
If the credential information is incorrect, reconfigure the identity credentials or run the aliyun configure set command to modify the saved credential information. For more information, see Modify a specified identity credential configuration.
Check the credential mode
When you use credential modes such as RamRoleArn and EcsRamRole, check whether the credential provider works as expected. If Cloud Assistant CLI cannot obtain valid identity credentials, API calls fail.
RamRoleArn, ChainableRamRoleArn: To use this credential mode, ensure that the management permissions of Security Token Service (STS) (AliyunSTSAssumeRoleAccess) are granted to the Resource Access Management (RAM) user or RAM role. For more information, see AssumeRole - Obtain temporary identity credentials of a RAM role.
EcsRamRole: To use this credential mode, see Permission examples to grant the required permissions to the current user identity.
External, CredentialsURI: To use this credential mode, check whether the external program command can obtain credentials.
Check if the identity corresponding to the credentials has access permissions
If your credential information is correct, your current identity may not have the permissions required to perform the current operation. Grant the required permissions to your current identity and try running the command again.
Update or reinstall Cloud Assistant CLI
Cloud Assistant CLI updates often introduce support for new Alibaba Cloud services, features, and parameters. This new functionality is available only in versions of Cloud Assistant CLI released after the functionality is introduced. If you have confirmed that the command and parameter formats are correct, but Cloud Assistant CLI still reports that the command does not exist or a parameter is not recognized, reinstall or update Cloud Assistant CLI to the latest version.
FAQ
The aliyun command is not found
The version returned by the aliyun version command is different from the installed version
The aliyun command can still be used after Alibaba Cloud CLI is uninstalled
The command is not recognized
String parsing is abnormal
A "required parameters not assigned" error occurs when you call an API
A "fail to set configuration" error occurs when you configure identity credentials
Network connection timeout
Invalid credentials
Error messages
The following table lists common error codes for Cloud Assistant CLI and related information. For error codes returned when you call an OpenAPI, you can find diagnostic solutions and log information in OpenAPI Explorer.
Technical support
The preceding solutions are intended to help you use Cloud Assistant CLI more easily. If you encounter other issues, submit feedback on GitHub Issues or open a ticket to help us improve the Cloud Assistant CLI experience.
References
If you encounter an issue when you use the aliyun oss command, see ossutil FAQ.