Why am I unable to execute an HTTP function?
- If a new trigger is created, updating the cache for the trigger takes about 10 seconds. You can try again later.
- Check whether the handler function specified for your function is correct. An HTTP function uses a different handler function than that of a common function. For more information about HTTP functions in different languages, see the following documentation:
Why am I unable to end an HTTP function?
Check whether a function for sending a response is invoked.
- For a Node.js HTTP function, you must invoke
response.send()
. - For a Python HTTP function, you must invoke
return
. - For a PHP HTTP function, you must invoke
return new Response()
. - For a Java HTTP function, you must invoke
HttpServletResponse
. - For a C# HTTP function, you must invoke
return
. - For an HTTP function in a custom runtime, you must invoke a function for sending a response based on the corresponding language.
Troubleshoot errors
You may encounter the following types of errors:
- Request errors: A request error occurs if a request does not meet specific requirements. In this case, a status code 4xx is returned in the response.
- Function errors: A function error occurs if the function code is invalid. In this case, a status code 5xx is returned.
Error type | X-Fc-Error-Type | HTTP status code | Description | Billable |
---|---|---|---|---|
Request error | FcCommonError | 400 | The error returned because your request exceeds the limits on HTTP requests. For more information, see Restrictions. | No |
FcCommonError | 400 | The error returned because the request for a function that requires authentication does not contain date or authorization information. | No | |
FcCommonError | 403 | The error returned because the signature of a request for a function that requires authentication is invalid, that is, the authorization information is invalid. The date information is used in signature calculation and a signature is only valid for 15 minutes. A common cause is that you use an HTTP trigger that requires access authentication, but the date information in the request header is more than 15 minutes from the current time. In this case, the signature becomes invalid. | No | |
FcCommonError | 403 | The error returned because your request uses a request method that is not configured in the HTTP trigger. For example, you only configure the GET method in an HTTP trigger but send an HTTP request that uses the POST method. | No | |
FcCommonError | 404 | The error returned because you send an HTTP request to a function for which no HTTP trigger is configured. | No | |
User throttling | FcCommonError | 429 | The error returned because your traffic is throttled. You can reduce concurrent requests or contact the Alibaba Cloud Function Compute team to increase your concurrency. | No |
Function errors | UnhandledInvocationError | 502 | The error returned because the response of a function exceeds the limits on HTTP responses. For more information, see Restrictions. | Yes |
UnhandledInvocationError | 502 | The error returned because the code of a function has a syntax error or exception. | Yes | |
UnhandledInvocationError | 502 | The error returned because an HTTP request is sent to a function that does not use an HTTP handler function. | Yes | |
System error | FcCommonError | 500 | The error returned because the Function Compute system is abnormal. You can try again. | No |
System throttling | FcCommonError | 503 | The error returned because throttling is implemented for the Function Compute system. You can try again by using exponential backoff. | No |
If your problem persists, Contact us.