When an API request fails, the server returns an error message. This topic describes the error codes for the image recognition API.
If you have questions about API access, interface usage, or other issues related to the Alibaba Cloud Visual Intelligence API, contact us in the DingTalk group (23109592).
Troubleshooting Center
You can use the Troubleshooting Center to diagnose API call issues more efficiently.
Image recognition error codes
Status code | Error code | Description |
403 | AuthFailed | Authorization failed. Check your RAM permission settings. |
400 | ClientError.IllegalArgument | Check the parameters. For example, check if the database represented by the parameter value exists. |
400 | EntityNotExist.Role | You do not have RAM permissions. Contact your Alibaba Cloud account to grant you the AliyunVIAPIFullAccess permission. For more information, see Control access using RAM policies. |
400 | IllegalUrlParameter | The URL is invalid. Check if the URL can be opened. For image URLs that are not for OSS in the China (Shanghai) region, see Handle file URLs. |
500 | InternalError | An internal server error occurred. If this affects your business, contact us through the DingTalk group (23109592). |
500 | InternalError.Algo | An internal algorithm processing error occurred. If this affects your business, contact us through the DingTalk group (23109592). |
500 | InternalError.Timeout | An internal algorithm service processing timeout error occurred. Try again later. If this affects your business, contact us through the DingTalk group (23109592). |
500 | InternalServerError | An internal system error occurred. If this affects your business, contact us through the DingTalk group (23109592). |
400 | InvalidAccessKeyId.Inactive | The AccessKey ID is disabled. Check if the AccessKey is active. Use an enabled AccessKey. |
404 | InvalidAccessKeyId.NotFound | The AccessKey ID does not exist. Check if you used the correct AccessKey for the call. |
400 | InvalidAccessKeySecret | The AccessKey ID or AccessKey secret is incorrect. Check if the AccessKey ID and AccessKey secret are correct. |
400 | InvalidAction.NotFound | The capability was not found. Check if the category and capability match, and if the endpoint and capability match. For more information, see Endpoints. Select a programming language and modify the sample code to integrate the API. For more information, see SDK overview. |
400 | InvalidApi.ForbiddenInvoke | The call is restricted. Check if the capability you are calling is restricted. For restricted capabilities, go to the console, find the capability, and submit a request. You can call the capability only after the request is approved or you manually activate it. If this is not the case, check if your account has an overdue payment. |
403 | InvalidApi.NotPurchase | The service is not enabled. Enable the service first. |
400 | InvalidApi.OutOfService | The product is not enabled. Enable the product. |
400 | InvalidFile.Content | Check the file content by referring to the algorithm documentation. Replace the file with one that meets the algorithm requirements. |
400 | InvalidFile.Decode | Check if the file can be opened. |
400 | InvalidFile.Download | The file cannot be downloaded. Check your on-premises network and if the link is accessible. For file URLs that are not for OSS in the China (Shanghai) region, see Handle file URLs. |
400 | InvalidFile.REGION | The file link is for the wrong region. For file URLs that are not for OSS in the China (Shanghai) region, see Handle file URLs. |
400 | InvalidFile.Resolution | The file resolution exceeds the limit. Check the file resolution and content, modify the file resolution, and then retry. |
400 | InvalidFile.Type | The file type is invalid. Use a file type that is supported by the algorithm, as specified in the algorithm API reference. Alibaba Cloud Visual Intelligence API determines the actual file type by reading the file, not from the file extension. Relying on the file extension alone is invalid. For more information, see File type determination and handling. |
400 | InvalidFile.URL | The file cannot be downloaded. Check your on-premises network and if the link is accessible. For file URLs that are not for OSS in the China (Shanghai) region, see Handle file URLs. |
400 | InvalidImage.Content | The input image content is invalid. The input image is an empty string. The image is an invalid Base64-encoded image. The image content is invalid. |
400 | InvalidImage.Decode | Image decoding failed. The input image is not a valid Base64 string. Remove the extra header from the Base64 string, such as `data:image/jpg:base64`. The length of Base64-encoded data must be a multiple of 4. If the length is insufficient, add |
400 | InvalidImage.Download | The image cannot be downloaded. Check your on-premises network, if the link is accessible, and if the OSS link has expired. For image URLs that are not for OSS in the China (Shanghai) region, see Handle file URLs. URLs do not support spaces or Chinese characters. If a URL contains these characters, encode it using URLEncode before passing it. |
404 | InvalidImage.NotFoundFace | No face was found in the image. Check if your image contains a face or if the face is too small. |
400 | InvalidImage.Region | The image is in the wrong region. |
400 | InvalidImage.Resolution | The image resolution does not meet the requirements. You can view the image resolution limits in the image restrictions section of the corresponding API documentation. |
400 | InvalidImage.Timeout | The image download timed out. Check your on-premises network, if the link is accessible, and if the OSS link has expired. For file URLs that are not for OSS in the China (Shanghai) region, see Handle file URLs. |
400 | InvalidImage.Type | Invalid image type. Check the image type and use a type supported by the algorithm. For more information, see the API documentation for the algorithm. |
400 | InvalidImage.Unsafe | The URL is not secure. |
400 | InvalidImage.URL | The image URL is invalid. Check if the image URL is accessible. For image URLs that are not for OSS in the China (Shanghai) region, see Handle file URLs. For OSS links in the China (Shanghai) region, use standard OSS domain names. Accelerated domain names and custom domain names are not supported. |
400 | InvalidParameter | Invalid parameter. Check the parameter value based on the algorithm API documentation and the error message. Check for extra spaces or other special characters before or after the parameter value. |
400 | InvalidParameter.BadRequest | Invalid parameter. Check the parameter value based on the algorithm API documentation and the error message. Check for extra spaces or other special characters before or after the parameter value. |
400 | InvalidParameter.NotFound | Invalid parameter. Check the parameter value based on the algorithm API documentation and the error message. Check for extra spaces or other special characters before or after the parameter value. |
400 | InvalidParameter.TooLarge | The content to be detected is too large. Make sure the content is within the API's limits. |
400 | InvalidRamRole | You do not have RAM permissions. Contact your Alibaba Cloud account to grant you the AliyunVIAPIFullAccess permission. For more information, see Control access using RAM policies. |
400 | InvalidResult | Invalid parameter. Check the parameter value and the file content by referring to the documentation. Check if the image content is incomplete or too blurry. |
400 | InvalidSide | Specified parameter Side is not valid. Enter the correct Side parameter by referring to the documentation. |
400 | InvalidTimeStamp.Expired | The difference between the user's time and the server's time is more than 15 minutes. Check your timestamp settings to make sure the difference is within 15 minutes. |
400 | MissingAccessKeyId | The AccessKey ID is missing. Check if the AccessKey ID and AccessKey secret are correct. |
400 | MissingParameter | A parameter is missing. Check the parameter value by referring to the documentation. |
403 | NeedOpen | Enable the service first. |
400 | ParameterError | Invalid parameter. Check the parameter value. |
400 | ParameterError | Invalid parameter. Check the parameter value. |
403 | RamRoleAuth | Grant permissions to the role first. For more information, see Control access using RAM policies. |
503 | ServiceUnavailable | The service is unavailable. If the server has returned a RequestId, contact us through the DingTalk group (23109592). |
400 | SignatureDoesNotMatch | The signature is incorrect. Recalculate the signature. For more information, see Request signing. |
400 | SignatureNonceUsed | The signature has been used. Recalculate the signature. For more information, see Request signing. |
400 | Throttling | Throttling was triggered. For paid APIs, purchase a higher QPS. For free APIs with special requirements, contact us through the DingTalk group (23109592). Note When throttling is triggered, both `Throttling` and `Throttling.User` may occur. Consider both when handling the error. |
400 | Throttling.User | Your traffic for this period has exceeded the limit. For paid APIs, purchase a higher QPS. For free APIs with special requirements, contact us through the DingTalk group (23109592). Note When throttling is triggered, both `Throttling` and `Throttling.User` may occur. Consider both when handling the error. |
408 | Timeout | The request timed out. |
400 | Unauthorized | You do not have RAM permissions. Contact your Alibaba Cloud account to grant you the AliyunVIAPIFullAccess permission. For more information, see Control access using RAM policies. |
403 | UnsupportedHTTPMethod | The HTTP request method is not supported. Check the API call method documentation for each product. |
Common error codes
For common API error codes, see the API Error Center.
Troubleshooting suggestions
If a service request returns an error code, refer to the error code description to identify the cause and resolve the error. The following suggestions can help you resolve common and frequent errors.
URL-related error codes
These errors typically occur when the file URL does not meet the requirements. For example, the URL may be insecure or invalid. For more information, see Handle file URLs.
Image loading error codes
These errors are often related to image URLs, such as an image download error or a region error. We recommend that you use the China (Shanghai) region. If you generate a URL using OSS, the bucket that you create in OSS must also be in the China (Shanghai) region. For more information, see Handle file URLs.
Parameter-related error codes
These errors typically occur when input parameters do not meet the requirements. For example, a parameter may be missing or have an incorrect data type. To confirm the parameter requirements, see the request parameters table in the relevant API document.
System service error codes
If this type of error occurs, resend the service request. If the problem persists, contact us in the DingTalk group (23109592).