As of May 17th, 2022, Google has resolved an internal issue that caused GCP functions to receive "response error" log messages whenever their response header status code differed from 200.
This issue occurred because Cloud Function executions were returning non-200 responses with the correct status code, but the service logged a "response error." The issue only affected GCP Function logs and did not impact API gateway logs, which displayed the correct status code of the function invocation.
To illustrate the issue, a code snippet was provided that sets the response status code to 201, which previously triggered a "response error" in the logs. After the fix, this code will now correctly log the specified status code (201 in this case).
If you encounter any further issues related to status code handling or logs for GCP Functions, you are advised to contact Google Support through the issue tracker or file a support case.
The above is the detailed content of Why Did My GCP Function Logs Show \'Response Error\' for Non-200 Status Codes?. For more information, please follow other related articles on the PHP Chinese website!