Available in Classic and VPC
You might run into the following problems when using Cloud Functions: Find out causes and possible solutions.
"Request larger than allowed" error
- The size of the requested body is less than 10 MB, but an error occurs when I call the API Gateway trigger.
- When I call the API Gateway trigger, the following error message is displayed:
{ "code": "<code>", "error": "Request larger than allowed: 2097152 > 1048576 bytes." }
Cause
It means the size of the requested body exceeds the maximum size (1 MB/1,048,576 bytes) that Cloud Functions allows. The size limit of the API Gateway's request body is 10 MB, but in the case of integrating with Cloud Functions, 1 MB, the Cloud Functions' parameter size limit, is applied. For more information, see Cloud Functions resource limit specifications.
Solution
- Adjust the size of the request body to fall below the Cloud Functions' parameter size limit (1 MB).
- If you need to transfer large data, consider other ways, such as configuring it to read the Object Storage's file from the Cloud Functions' code.
"ACTION_BODY_INVALID_TYPE" error
-
When I request Put Action API, the "ACTION_BODY_INVALID_TYPE" error occurs.
-
The following error message is displayed:
{ "error": { "errorCode": "80305", "message": "ACTION_BODY_INVALID_TYPE", "details": "The requested body is in an invalid action format." } }{ "error": { "errorCode": "80305", "message": "ACTION_BODY_INVALID_TYPE", "details": "The type of 'timeout' needs to be verified." } }
Cause
- In the case of
"details": "The requested body is in an invalid action format."- This error message is displayed when the format of the request body is not valid. The processing method may vary depending on the language, but in Python, you need to request using the JSON parameter.
- For example, if you request as follows, this error occurs because the string is transferred as it is:
response = requests.put(url, headers=headers, data=body)
- In the case of
"details": "The type of '{timeout}' needs to be verified."- This error message is displayed when the type of the PutAction API's request body field value is defined incorrectly.
Solution
-
In the case of
"details": "The requested body is in an invalid action format."
Enterjson=bodyso that it can automatically JSON-serialize and send request properly.
The proper request method is as follows:import requests body = {"description": "Create Action", ... } response = requests.put(url, headers=headers, json=body) -
In the case of
"details": "The type of '{timeout}' needs to be verified."- Edit the incorrectly defined field type.
For more information, see Put Action API.
"Not Found Exception" error
- The "Not Found Exception" error occurs.
- The following error message is displayed:
{ "error": { "errorCode": "300", "message": "Not Found Exception", "details": "URL not found." } }
Cause
- The "Not Found Exception" error may occur when the URL and Method to call were entered incorrectly.
- If the API Gateway subscription method is protection mode, calling is not available and the "Not Found Exception" error may occur. If the API Gateway subscription type is "Public", calling is available regardless of the API Key registration/approval status to Product. But if it is "Protected-approval needed", calling is not available unless it is the registered/approved API Key.
Solution
- Check if the URL and Method to call are entered correctly.
- Check the API Gateway subscription type and change it to "Public." For how to change subscription type, see Edit Product of the API Gateway guide.
HTTP Status code other than 200 returned
An HTTP status code other than 200 is returned.
Cause
202 (Accepted) returns when making an asynchronous execution call (blocking=false query param). It only checks whether the action is run, and is not involved with whether activities within the action code succeeded or failed. In case of synchronous calls, 200 (OK) is returned if the execution was successful. If the action runs for 1 minute or more, it is switched to an asynchronous execution and returns 202 (Accepted).
Solution
As explained in the cause section, it is a normal operation and it does not need any action.
If you're still having trouble finding what you need, click on the feedback icon and send us your thoughts and requests. We'll use your feedback to improve this guide.