GCP logs indicate "response error" for non-200 response header status codes
A user reports encountering a "response error" message in GCP logs whenever their function's response header status code is set to anything other than 200. This issue has recently emerged and has not been observed previously.
The user has attempted to deploy a simple test function that solely sets the response status code to 201, replacing the default 200 value. However, this change still results in a "response error" in GCP logs. Conversely, explicitly setting the status code back to 200 eliminates the error.
Interestingly, GCP occasionally automatically reinvokes the function with a status code of 200 after a previous invocation ends in a response error. The user suspects that no actual code execution occurs during this re-invocation.
From the user's observations, "response error" messages appear exclusively in Cloud Function Logs, while API gateway logs correctly display the function's status code.
The above is the detailed content of Why Does My GCP Cloud Function Log 'Response Error' for Non-200 Status Codes?. For more information, please follow other related articles on the PHP Chinese website!