This topic provides answers to the frequently asked questions (FAQ) about error messages that are returned after Content Moderation API operations are called.

For more information about the Content Moderation API, see FAQ about the Content Moderation API.

Why is error message "You have not opened Yundun Content Moderation Service" returned when I call a Content Moderation API operation?

Cause: Content Moderation is not activated.

Solution: Log on to the Content Moderation console.On the Activate page, activate the service. Then, call API operations.

Why is error message "SDK.ServerUnreachable: Speicified endpoint or uri is not valid" returned when I use the Content Moderation API on an Elastic Compute Service (ECS) instance but no exceptions are reported in on-premises testing?

Cause: The ECS instance cannot be accessed over the Internet. However, a Content Moderation operation must be called over the Internet.

Solution: Enable access to the ECS instance over the Internet. Check network connectivity by sending PING messages to the endpoint of the environment to access. If the network is connected, check whether the dependencies in the corresponding programming language are installed or the aliyun-**-sdk-core library is of the required version. We recommend that you use the sample code provided in the SDK documentation to call Content Moderation operations. For more information, see SDK overview.

Why is error message "SDK.ServerUnreachable : SocketTimeoutException has occurred on a socket read or accept" returned after I use a Content Moderation SDK to call an operation on an ECS instance?

Cause: A network access error occurs. A Content Moderation operation must be called over the Internet.

Solution: Enable access to the ECS instance over the Internet. Check network connectivity by sending PING messages to the endpoint of the environment to access. If the network is connected, check whether the dependencies in the corresponding language are installed or the aliyun-**-sdk-core library is of the required version. We recommend that you use the sample code provided in the SDK documentation to call Content Moderation operations. For more information, see SDK overview.

Why is error message "algo failed(ocridcard-modelnotexist)" returned after I call a Content Moderation operation?

Cause: The optical character recognition (OCR) card model cannot be used in the region that corresponds to the current endpoint.

Solution: Select an endpoint of a region in which the OCR card model can be used. For more information, see Endpoints.

Why is error message "Your using subaccount is not authorized, please refer to the page" returned after I call a Content Moderation operation?

Cause: The RAM user is not authorized to call Content Moderation operations.

Solution: You can call a Content Moderation operation as a RAM user. Before that, you must create a RAM user and authorize the RAM user to call Content Moderation operations. For more information, see Authorize a RAM user to call the Content Moderation API.

Why is a 401 NOT_ALLOWED error returned after I call a Content Moderation operation?

Cause: The image or video URL that you usedis insecure.

Solution: Check whether the image or video URL is secure or whether your IP address belongs to the following internal CIDR blocks. You must use a public IP address to access Content Moderation.
  • 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 a 400 BAD_REQUEST error returned after I call a Content Moderation operation?

Cause: One or more request parameters are invalid. If error message [task.url] is bad format is returned, the URL is invalid.

Solution: We recommend that you check whether the request parameters for the Content Moderation operation are specified as required. If you are prompted with a message that indicates an invalid URL, check the URL. If you can open the URL in a browser, check whether the URL contains special characters. If the URL contains special characters, encode the special characters. For more information, see Common parameters.

Why is a 594 EXPIRED error returned after I call a Content Moderation operation?

Cause: The task ID has expired. For example, tasks for asynchronous image moderation are valid for 24 hours. If you call an operation to query the result of such a task that was submitted over 24 hours ago, EXPIRED is returned.

Solution: After you submit such a task, we recommend that you set the interval for querying moderation results to 30 seconds. This ensures that you can obtain moderation results before the task expires.

Why is a 596 PERMISSION_DENY error returned after I call a Content Moderation operation?

Cause: Content Moderation is not activated, or the account has no required permissions, is disabled, or has an overdue payment. To identify the specific cause, see the returned error message.

Solution: Check whether Content Moderation is activated and whether the account that you use to call the Content Moderation operation has required permissions, is disabled, or has an overdue payment. If you call a Content Moderation operation as a RAM user, you must grant the RAM user the permissions to use the API. If you have not activated Content Moderation, log on to the Content Moderation console and go to the activation page to activate the service. For more information, see Authorize a RAM user to call the Content Moderation API.

Why is an AlgorithmTimeOut error returned or the detected text in the moderated image incomplete after I call a synchronous OCR operation?

Cause: Error AlgorithmTimeOut indicates a moderation timeout. Because image OCR is time-consuming, a default timeout period of 3 seconds is allowed for a synchronous OCR operation. If you call a synchronous OCR operation to moderate an image that contains a large amount of text, a timeout error is likely to occur.

Solution: If your business requires you to process images that contain a large amount of text, we recommend that you call the /green/image/asyncscan operation. This way, Content Moderation retries the OCR operation multiple times and optimizes the OCR process to prevent a timeout error.

Why is a 592 DOWNLOAD_TIMEOUT error returned after I call a Content Moderation operation?

Cause: The download times out. The download duration is limited to 3 seconds. The size of the content to be moderated must be allowed by the Content Moderation operation.

Solution: We recommend that you check whether the image URL is accessible or whether the image can be downloaded within 3 seconds. If an Alibaba Cloud CDN (CDN) domain is used, the download timeout may be caused due to the communication between CDN and the origin server. Therefore, we recommend that you do not use a CDN domain. If you access services across regions, a timeout error is very likely to occur. For example, you want to access an Object Storage Service (OSS) bucket in the US (Silicon Valley) region from the Singapore region. We recommend that you access an OSS bucket in the same region.

Why is error message "[task.dataId] is too long(>256)" returned after I call a text moderation operation?

Cause: The value of the dataId parameter exceeds 128 characters in length. The dataId parameter uniquely identifies your data. Its value can contain letters, digits, underscores (_), hyphens (-), and periods (.). Example: cfd33235-71a4-468b-8137-a5ffe323a7e8.

Solution: Specify the dataId parameter in the API request based on the API reference. For more information, see /green/text/scan.

Why is a 400 error returned after I call an operation by using an HTTP request?

Cause: The signature mechanism for HTTP requests is complex. If you construct a signature on your own, code errors are likely to occur.

Solution: We recommend that you use Content Moderation SDKs. The signature process is encapsulated in the SDKs, and you do not need to write the code for signature. If you can call operations only by using HTTP requests, we recommend that you first understand the signature mechanism of Content Moderation. For more information, see SDK overview and Signature method.

Why is a 480 DOWNLOAD_FAILED error returned after I call a Content Moderation operation?

Cause: The download fails. The issue may occur in the following scenarios: the URL of the object to be moderated is inaccessible, the content to be moderated cannot be downloaded, or the size or resolution of the content to be moderated exceeds the upper limit.

Solution: If the object is an image, check whether the image URL is accessible. If the object is a video, specific images in the sequence of captured frames may fail to be downloaded. In this case, check whether parameters related to frame capturing, such as the time parameter, are valid. If the object is a video stream, check whether the video stream is being pushed during the moderation.

Why is a 480 error returned for specific URLs after I call the /green/video/syncscan operation?

Cause: The download fails. The issue may occur in the following scenarios: the URL of the object to be moderated is inaccessible, the content to be moderated cannot be downloaded, or the size or resolution of the content to be moderated exceeds the upper limit.

Solution: If the object is a video, specific images in the sequence of captured frames may fail to be downloaded. In this case, check whether parameters related to frame capturing, such as the time parameter, are valid. You can also contact us by using the Online Service . For more information, see Video snapshots.

Why is a 480 GIF_TOO_MUCH_PIXELS error returned when I call an operation to moderate images?

Cause: The download fails. The GIF_TOO_MUCH_PIXELS error message indicates that the size or resolution of the content to be moderated exceeds the upper limit.

Solution: Content Moderation can moderate an image of which the size does not exceed 20 MB, the height or width does not exceed 30,000 pixels, and the total resolution does not exceed 0.25 billion pixels. If the size or resolution of an image to be moderated exceeds the upper limit, compress the image and then submit it for moderation. For more information, see /green/image/scan.

Why is a 480 Input/output error returned after I call an operation to moderate video live streams?

Cause: The download fails. In general, error message Input/output error is returned because an error occurs in media streaming files. To be specific, this error message is returned because the URL of the content to be moderated is inaccessible or the content cannot be downloaded.

Solution: If the object is a video stream, check whether the video stream is being pushed and whether the live streaming is stopped. If the object is a video, specific images in the sequence of captured frames may fail to be downloaded. In this case, check whether parameters related to frame capturing, such as the time parameter, are valid.

Why is a 500 GENERAL_ERROR error returned after I call a Content Moderation operation?

Cause: A temporary error occurs on the server. Troubleshoot the error based on the returned error message.

Solution: If the error is occasionally returned, try again. If the error is continuously returned, contact us by using the Online Service and provide the returned error message to help technical support engineers troubleshoot the error at the earliest opportunity.

Why is a 500 service interrupted error returned when I use a Content Moderation SDK?

Cause: A temporary error occurs on the server. Error message service interrupted may be returned because your SDK version is incompatible with the server version.

Solution: Check whether the latest SDK version is used. If the SDK version is not the latest, update the SDK. For more information, see Installation.

Why is a 586 ALGO_FAILED error returned after I call a Content Moderation operation?

Cause: An error occurs in the algorithm service. In general, the error code is returned because a timeout error occurs due to the network jitter when the algorithm service is running.

Solution: If the error is occasionally returned, try to call the operation again. If the error is continuously returned, contact us by using the Online Service . Technical support engineers will troubleshoot the error at the earliest opportunity.

Why is a 588 EXCEED_QUOTA error returned after I call a Content Moderation operation?

Cause: The number of moderation requests per second exceeds the concurrency quota. The default concurrency quota per second is 50 images, 20 videos,100 text entries, or 10 images for OCR.

Solution: We recommend that you reduce the number of moderation requests per second and queue the content to be moderated. Alternatively, you can contact your customer manager to raise the concurrency quota based on your concurrency requirements during peak hours.

Why is a 586 error returned after I call a Content Moderation operation to moderate images?

Cause: An error occurs in the algorithm service. If the error code is returned only for specific images or videos, the 586 error may be caused by an encoding or decoding failure.

Solution: check whether the images or videos to be moderated are damaged. Alternatively, use a codec to test whether the images or videos can be normally encoded or decoded. The following image formats are supported: PNG, JPG, JPEG, BMP, GIF, and WEBP. For more information, see /green/image/scan.

Why is error message "InvalidTimeStamp.Expired" returned after I call a Content Moderation operation?

Cause: The timestamp for calling the operation has expired. This error message is returned when the offset between the timestamps on the client and server exceeds 15 minutes.

Solution: Check whether the server time has been adjusted recently or whether the time zone on the client is the same as that on the server. For more information, see Common parameters.

Why is an error returned when I use the audit feature in the Content Moderation console after the console is idle for a long period?

Cause: A console access error occurs. It may be caused due to different reasons. For example, it may be caused because the access authorization fails due to an invalid logon session.

Solution: If the error message indicates an invalid request ID, refresh your browser and log on to the console again. If the error is continuously reported after a successful logon, contact us by using the Online Service and provide the error message or error screenshot. Our technical support engineers will troubleshoot the error at the earliest opportunity.

Why is no data returned after I use a Content Moderation SDK to moderate a string that contains HTML code tags?

Cause: If the string to be moderated contains code tags such as HTML code tags, the firewall determines that the string contains risky code and blocks your network request. As a result, no response is returned for the request.

Solution: We recommend that you filter out code tags, such as the characters that contain HTML code or SQL code, in text before you send a request to moderate the text. This prevents the request from being blocked by the firewall. For more information, see /green/text/scan.

Why is error message "Specified time stamp or date value is expired" returned after I call an OCR operation for content moderation before 09:00 in the morning or after 21:00 at night?

Cause: The timestamp for calling the operation has expired. This error message is returned when the offset between the timestamps on the client and server exceeds 15 minutes.

Solution: We recommend that you use a Content Moderation SDK provided by the Alibaba Cloud official website to call the operation. Content Moderation supports SDKs in different programming languages such as Java, Python, and PHP. If you can use only HTTP requests to call the operation, check whether the server time has been adjusted recently or whether the time zone on the client is the same as that on the server. For more information, see Common parameters.

Why is a 406 error returned after I call a Content Moderation operation?

Cause: This may be because the used and referenced SDK versions are not the same. For example, you use the code of a later SDK version to call operations but reference an earlier SDK version.

Solution: Check whether the referenced SDK version is the latest. If you use Content Moderation SDK for Java, update the referenced core and green packages to the latest version. Content Moderation supports SDKs in different programming languages such as Java, Python, and PHP. For more information, see SDK overview.

Why is error message "The API is invalid" returned after I call an operation to manage the configurations of custom text libraries?

Cause: The operation that is used to manage the configurations of custom text libraries can be called only in the China (Shanghai) region. You cannot call this operation in other regions such as the China (Beijing) region. You can call this operation to query text libraries. If no text library is created, no data is returned after you call this operation.

Solution: Call the operation that is used to manage the configurations of custom text libraries in the China (Shanghai) region. For more information, see CreateKeywordLib.

Why is a UnicodeEncodeError error returned after I run Content Moderation SDK for Python in Jupyter Notebook or by using a command-line interface?

Cause: An error occurs in the integrated development environment (IDE).

Solution: We recommend that you run Content Moderation SDK for Python in a mainstream IDE such as PyCharm. For errors caused by your IDE, we recommend that you check the IDE to troubleshoot the errors.