This topic describes common error messages that you may encounter when you use the AI Guardrails API.
-
Why do I receive the "algo failed(ocridcard-modelnotexist)" error when I call an API operation?
-
Why is error code 401 (NOT_ALLOWED) returned when I call an API operation?
-
Why is error code 400 (BAD_REQUEST) returned when I call an API operation?
-
Why is error code 594 (EXPIRED) returned when I call an API operation?
-
Why is error code 596 (PERMISSION_DENY) returned when I call an API operation?
-
Why is error code 592 (DOWNLOAD_TIMEOUT) returned when I call an API operation?
-
Why do I receive a signature error with "Status Code: 400" when I call an API operation over HTTP?
-
Why is error code 480 (DOWNLOAD_FAILED) returned when I call an API operation?
-
Why is error code 480 (GIF_TOO_MUCH_PIXELS) returned when I call the image moderation API operation?
-
Why is error code 500 (GENERAL_ERROR) returned when I call an API operation?
-
Why is error code 500 (service interrupted) returned when I use the AI Guardrails SDK?
-
Why is error code 586 (ALGO_FAILED) returned when I call a AI Guardrails API operation?
-
Why is error code 588 (EXCEED_QUOTA) returned when I call a AI Guardrails API operation?
-
Why is error code 586 returned when I call the image detection API operation?
-
Why do I receive the "InvalidTimeStamp.Expired" error when I call a AI Guardrails API operation?
-
Why does an error occur in the console's human review feature after a long period of inactivity?
-
Why is error code 406 returned when I call a AI Guardrails API operation?
For answers to frequently asked questions (FAQs) about API calls, see AI Guardrails API.
Why do I receive the "You have not opened Yundun AI Guardrails Service" error when I call an API operation?
Cause: AI Guardrails is not activated.
Solution: Log on to the AI Guardrails service activation page to activate the service. You can then call the API operation.
Why do I receive the "SDK.ServerUnreachable: Speicified endpoint or uri is not valid" error when I call an API operation on an ECS instance, even though local tests run normally?
Cause: The AI Guardrails API requires access over the public network, but the ECS instance is not configured with public network access permissions.
Solution: Configure the public network access permissions to ensure that the ECS instance is accessible. First, ping the endpoint of the environment to check the network connection. If the network connection is normal, check for missing dependencies for the programming language or an outdated version of aliyun-**-sdk-core. Use the sample code in the SDK reference to make the call. For more information, see SDK overview.
Why do I receive the "SDK.ServerUnreachable : SocketTimeoutException has occurred on a socket read or accept" error when I use the AI Guardrails SDK?
Cause: A network access error occurred. The AI Guardrails API requires access over the public network.
Solution: You can configure public network access permissions to ensure that the ECS instance is accessible. You can also check your network environment by pinging the endpoint of your environment. If the network connection is normal, you can check whether the required dependencies for your programming language are missing or the version of aliyun-**-sdk-core is outdated. You can use the sample code in the SDK reference to make the call. For more information, see SDK overview.
Why do I receive the "algo failed(ocridcard-modelnotexist)" error when I call an API operation?
Cause: The region of the current endpoint does not support the OCR card model (ocridcard-model).
Solution: Select an endpoint in a region that supports this feature. For more information, see Endpoints.
Why do I receive the "Your using subaccount is not authorized, please refer to the page" error when I call an API operation?
Cause: The RAM user is not authorized.
Solution: To call the AI Guardrails API as a RAM user, you must first create the RAM user and grant the required permissions. For more information, see Use a RAM user to call the AI Guardrails API.
Why is error code 401 (NOT_ALLOWED) returned when I call an API operation?
Cause: This error usually occurs because you used an insecure URL for an image, video.
Solution: Check whether your URL is secure. The IP address of the server that hosts the content must be a public IP address and cannot be in one of the following internal CIDR blocks.
-
10.0.0.0/8
-
11.0.XX.XX/8
-
100.64.0.0/10
-
172.16.0.0/12
-
192.168.0.0/16
-
127.0.0.1/32
-
33.0.XX.XX/8
Why is error code 400 (BAD_REQUEST) returned when I call an API operation?
This error is typically caused by incorrect request parameters. For example, the error message [task.url] is bad format indicates that the URL is invalid.
Solution: Check whether the API parameters are passed as specified in the API reference. If the error indicates an invalid URL, check the URL. If you can open the URL in a browser, check for special characters. If special characters exist, you must URL-encode them. For more information, see Common parameters.
Why is error code 594 (EXPIRED) returned when I call an API operation?
Cause: The task ID has expired. For example, the task ID for an asynchronous image moderation task is valid for only 24 hours. If you query a task after this period, the system returns EXPIRED.
Solution: After you submit an asynchronous detection task, we recommend setting the query interval to 30 seconds to prevent the TaskID from expiring.
Why is error code 596 (PERMISSION_DENY) returned when I call an API operation?
Cause: The account is not authorized, has an overdue payment, is disabled, or the service is not activated. The returned error message provides more details.
Solution: Check whether the account is authorized or has an overdue payment. If you use a RAM user to call AI Guardrails API operations, grant the required permissions to the RAM user. If you have not activated AI Guardrails, log on to the AI Guardrails service activation page to activate the service. For more information, see Use a RAM user to call the AI Guardrails API.
Why do I receive an "AlgorithmTimeOut" error or experience text truncation in the image when I call a synchronous OCR detection operation?
Cause: The AlgorithmTimeOut error indicates a detection timeout. OCR for images can be a time-consuming process. Synchronous API calls have a default timeout of 3 seconds, so this error is more likely to occur when processing images that contain a large amount of text.
Solution: If the images in your business scenario contain a large amount of text, we recommend that you call the asynchronous OCR text recognition API operation (Asynchronous detection). The system increases the number of retries and performs more optimizations to prevent timeout issues.
Why is error code 592 (DOWNLOAD_TIMEOUT) returned when I call an API operation?
Cause: The download timed out. The download time limit is 3 seconds. This can happen if the content to be detected is too large or the network is slow.
Solution: Check whether the image URL is accessible and if the image can be downloaded within 3 seconds. If you use a CDN URL for an image, a download timeout may occur because of a back-to-origin request from the CDN. We recommend that you do not use CDN links. If you make a cross-region request, such as requesting an OSS address in the US (West) region from a service in the Singapore region, a timeout is more likely to occur. We recommend that you use an OSS address within the service region.
Why do I receive the "[task.dataId] is too long(>256)" error when I call the text moderation API operation?
This error occurs because the DataId exceeds the 128-character limit. A DataId is a unique identifier for your business data. It can contain uppercase and lowercase letters, digits, underscores (_), hyphens (-), and periods (.). For example, a DataId can be cfd33235-71a4-468b-8137-a5ffe323a7e8.
Solution: Adjust the DataId parameter as described in the API reference. For more information, see Synchronous text detection.
Why do I receive a signature error with "Status Code: 400" when I call an API operation over HTTP?
Cause: The signature mechanism for HTTP calls is complex. If you build the signing method yourself, code errors can easily occur.
Solution: We recommend that you use the AI Guardrails SDK. The SDK encapsulates the signing process so that you do not need to write signing code. If you must call the API operation over HTTP, review the AI Guardrails signature mechanism. For more information, see SDK overview and Signature mechanism.
Why is error code 480 (DOWNLOAD_FAILED) returned when I call an API operation?
Cause: The download failed. This error may occur because the URL of the content to be detected is inaccessible, or the content size and resolution exceed the limits.
Solution: If you are moderating an image, confirm that you can open the image URL. If you are detecting video snapshots, some images in the snapshot sequence may fail to download. Check whether the snapshot-related parameters, such as the time parameter, are correct. If you are detecting a video stream, confirm that the video stream is being pushed during detection.
Why does the synchronous video detection API operation consistently return error code 480 for some links?
Cause: The download failed. This may be because the URL of the content to be detected is inaccessible or cannot be downloaded, or the content size and resolution exceed the limits.
Solution: If you are detecting video snapshots, some images in the snapshot sequence may fail to download. Check whether the snapshot-related parameters, such as the time parameter, are correct. Alternatively, contact us through online support. For more information, see Video snapshot.
Why is error code 480 (GIF_TOO_MUCH_PIXELS) returned when I call the image moderation API operation?
Cause: The download failed with the error message GIF_TOO_MUCH_PIXELS. This error indicates that the content size and resolution exceed the specified limits.
Solution: Image moderation supports images up to 20 MB in size. The height or width cannot exceed 30,000 pixels (px), and the total number of pixels cannot exceed 250 million. If the image to be detected exceeds these limits, compress the image before you submit it for detection. For more information, see Synchronous detection.
Why is error code 480 (Input/output error) returned when I call the live video stream moderation API operation?
Cause: The download failed. The error message Input/output error usually indicates a problem with the streaming media file. This occurs because the URL is inaccessible or the file fails to download.
Solution: If you are detecting a video stream, confirm that the video stream is being pushed and that the live video has not stopped. If you are detecting video snapshots, some images in the snapshot sequence may fail to download. Check whether the snapshot-related parameters, such as the time parameter, are correct.
Why is error code 500 (GENERAL_ERROR) returned when I call an API operation?
Cause: This is usually a temporary server-side error. You need to locate the specific problem based on the returned error message.
Solution: If this error occurs occasionally, retry the request. If the error persists, contact us through online support and provide the specific error message. Our technical support team will investigate the issue.
Why is error code 500 (service interrupted) returned when I use the AI Guardrails SDK?
Cause: This is typically a temporary server-side error. The error message service interrupted can occur because of an incompatibility between the SDK and server versions.
Solution: Check if you are using the latest SDK version. If you are using an old version, upgrade it. For more information, see Installation.
Why is error code 586 (ALGO_FAILED) returned when I call a AI Guardrails API operation?
Cause: An error occurred in the algorithm service. This is usually caused by a timeout due to network jitter in the algorithm service.
Solution: If this error occurs occasionally, retry the request. If the error persists, contact us through online support. Our technical support team will investigate the issue.
Why is error code 588 (EXCEED_QUOTA) returned when I call a AI Guardrails API operation?
Cause: The request frequency exceeds the concurrency quota. The default concurrency is 50 images per second for image detection, 20 streams per second for video detection, 100 entries per second for text detection, and 10 images per second for image OCR.
Solution: Reduce the request frequency and queue the content for detection. Alternatively, evaluate your peak concurrency requirements based on your business needs and contact your account manager to request a quota increase.
Why is error code 586 returned when I call the image detection API operation?
Cause: An error occurred in the algorithm service. If the error occurs only for specific images or videos, it may be caused by an encoding or decoding failure.
Solution: Check if the image or video file is corrupted. You can also use an encoding and decoding tool to test if the image or video can be processed correctly. The supported image formats are PNG, JPG, JPEG, BMP, GIF, and WEBP. For more information, see Synchronous detection.
Why do I receive the "InvalidTimeStamp.Expired" error when I call a AI Guardrails API operation?
Cause: The timestamp for the API call has expired. This error is reported if the difference between the client timestamp and the server timestamp is more than 15 minutes.
Solution: Check if the server time has changed significantly recently, or if the time zones of the client and server are the same. For more information, see Common parameters.
Why does a human review error occur in the console after a long period of inactivity?
Cause: A console access error occurred. Depending on the specific error message, this may occur because the logon session has expired, which causes the access authorization to fail.
Solution: If a Request ID error occurs, try to refresh the browser and log on to the console again. If the error persists, contact us through online support and provide the specific error message or a screenshot. Our technical support team will investigate the issue promptly.
Why is no data returned when I use the AI Guardrails text API SDK to detect a string that contains HTML tags?
Cause: If the string to be detected contains code tags such as HTML tags, the firewall may identify it as a risky code injection attempt and block the network request. As a result, no response is returned.
Solution: When you use text detection, first filter out web code tags, such as characters from HTML or SQL code, from the content to prevent the request from being blocked by the firewall. For more information, see Synchronous text detection.
Why do I receive the "Specified time stamp or date value is expired" error when I call the AI Guardrails OCR API operation before 9:00 or after 21:00?
Cause: The timestamp for the API call has expired. This error is reported if the difference between the client timestamp and the server timestamp is more than 15 minutes.
Solution: We recommend that you use the official SDK to make the call. The AI Guardrails SDK supports languages such as Java, Python, and PHP. If you can only use HTTP, check if the server time has changed significantly recently, or if the time zones of the client and server are the same. For more information, see Common parameters.
Why is error code 406 returned when I call a AI Guardrails API operation?
Cause: This may be caused by an SDK version mismatch. For example, you use code from a new SDK version but reference an old SDK version.
Solution: Check if the referenced SDK version is the latest. If you use the Java SDK, upgrade both the Core and Green packages to the latest versions. The AI Guardrails SDK supports languages such as Java, Python, and PHP. For more information, see SDK overview.
Why do I receive "The API is invalid" error when I call a configuration management API operation for a custom text library?
The endpoint for configuration management API operations on custom text libraries supports only cn-shanghai, not cn-beijing. This request retrieves a list of text libraries. If you have not created any text libraries, the API operation returns no data.
Solution: You can use the cn-shanghai endpoint for management API operations. For more information, see Create a text library.
Why do I receive a "UnicodeEncodeError" when I run the AI Guardrails Python SDK in a Jupyter notebook or from the command line?
Cause: A UnicodeEncodeError is an error caused by the integrated development environment (IDE). You need to check the IDE environment to determine the specific cause.
Solution: We recommend that you run the Python SDK in a mainstream IDE, such as PyCharm. For issues caused by the IDE, we cannot know the specific environment, so we recommend that you investigate the issue yourself.