Help Center/ ModelArts/ Troubleshooting/ Inference Deployment/ Service Prediction/ Error "APIG.XXXX" Occurred in a Prediction Failure
Updated on 2024-06-11 GMT+08:00

Error "APIG.XXXX" Occurred in a Prediction Failure

A request is intercepted on API Gateway due to a fault, and error "APIG.XXXX" occurs.

Rectify the fault by referring to the methods provided in the following typical cases:

For more details about API Gateway error codes and solutions, see .

APIG.0101 Incorrect Prediction URL

If the prediction URL is incorrect, API Gateway intercepts the request and reports error message "APIG.0101:The API does not exist or has not been published in the environment". In this case, go to the real-time service details page and obtain the correct API address on the Usage Guides tab page.

If you have specified a custom path in the configuration file, add this path to the called API path. For example, if you have specified custom path /predictions/poetry, the called API path will be {API address}/predictions/poetry.

Figure 1 Obtaining an API address

APIG.0201 Request Body Oversized

If a request body is oversized, API Gateway intercepts the request and reports error message "APIG.0201:Request entity too large". Reduce the prediction request body and try again.

If you perform prediction by calling an API address, the maximum size of the request body is 12 MB. If the size of the request body exceeds 12 MB, the request will be intercepted.

If you perform prediction on the Prediction tab of the service details page, the maximum size of the request body is 8 MB. The size limit varies between the two tab pages because they use different network links.

Figure 2 Request error APIG.0201

APIG.0301 Authentication Failed

If an API is called for service prediction or a token is used for application authentication, a correct token must be obtained. If the token is invalid, API Gateway intercepts the request and reports error message "APIG.0301:Incorrect IAM authentication information: decrypt token fail". Obtain the correct token and enter it in X-Auth-Token for prediction.

To obtain a token in a region, obtain the endpoint for this region and the resource-path (/v3/auth/tokens) in the URI of the API that is used to obtain a user token. Then, construct the URL as follows:

https://{iam-endpoint}/v3/auth/tokens